Qwen Architecture › Architecture Overview

Michael BrenndoerferUpdated August 7, 20254 min read
Language AI HandbookAll chapters
Part 29 of 67Modern Decoder Models
Chapter 212Qwen Architecture › Architecture Overview
Reading section 3 of 11 · Architecture Overview · 4 minSection 3 of 11 · 4 min

Book contents

Section 3 of 11 · 4 min read

Qwen Architecture › Architecture OverviewOne section · Sections in this chapter3 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Before examining specific components, let's place Qwen among modern LLMs and identify its architectural differences.

Foundation: Decoder-Only Transformer

Out[3]:
Visualization
Diagram showing Qwen's decoder-only transformer architecture with token inputs flowing through embedding layer, N stacked transformer blocks, and output projection.
High-level Qwen architecture showing the flow from token input through embedding, transformer blocks, and final output projection. Qwen shares the decoder-only foundation with LLaMA but introduces specific modifications.

Qwen adopts the decoder-only Transformer architecture, following the successful pattern established by GPT and refined by LLaMA. Like its predecessors, Qwen uses:

Key Architectural Differences

Qwen combines proven innovations from LLaMA with additional refinements:

Architectural comparison between LLaMA and Qwen. Key differences include QKV bias, larger vocabulary, and universal GQA.
ComponentLLaMAQwenRationale
NormalizationRMSNorm (pre-norm)RMSNorm (pre-norm)Training stability
ActivationSwiGLUSwiGLUModel quality
Positional EncodingRoPERoPELength extrapolation
AttentionMulti-head (7B) / GQA (70B)GQA (all sizes)Memory efficiency
Attention BiasNo biasQKV biasImproved attention quality
Vocabulary Size32,000151,936Multilingual optimization
Embedding TyingTiedUntiedBetter output distribution

The most specific differences are the addition of bias terms in attention projections, the much larger vocabulary optimized for Chinese, and the use of Grouped-Query Attention across all model sizes.