Qwen · 2024-09 · Dense

Qwen2.5 7B

Qwen2.5 7B is a grouped-query attention (GQA) transformer released by Qwen in 2024-09, with 28 layers, hidden size 3584 and a context window of 32,768 tokens.

Layer stack

Attention ×28 · Layers 28

Key facts

FamilyQwen
Released2024-09
Params7.6 B
Context32,768 tokens
AttentionGQA (28:4)
Layers28
Hidden3,584
Heads28
Vocab152,064
PositionRoPE
NormRMSNorm
Activationsilu
Dtypebf16
Architecture classQwen2ForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 152,064 → Hidden 3,584 Q1 Q2 Q3 Qn KV1 KV2 KV3 KVn Heads 28 KV heads 4 head dim 128 · RoPE FFN · SwiGLU FFN dim 18,944 × 28 transformer block Attention Feed-forward / MoE RMSNorm pre-norm Final norm · RMSNorm LM head → Vocab 152,064 p p p → next token Position RoPE Dtype BF16 Context 32K tok
Drawn from the shipped config.json · 28 layers / width 3,584 / context 32,768. Original diagram by this atlas.

Attention

grouped-query attention (GQA) — 28 q-heads / 4 kv-heads. RoPE θ=1,000,000.

Feed-forward / MoE

It is a dense model: all 7.6B parameters participate in computing every token.

Field-level comparison

Compared against the previous model of the same lab; where none exists, against the structurally closest model. The ratio column is this model divided by the comparison model.

Full-field comparison vs predecessor Qwen2.5 72B
ModelQwen2.5 7BQwen2.5 72BRatio
model_typeqwen2qwen2
architecturesQwen2ForCausalLMQwen2ForCausalLM
hidden_size35848192×0.438
num_hidden_layers2880×0.350
num_attention_heads2864×0.438
num_key_value_heads48×0.500
intermediate_size1894429568×0.641
hidden_actsilusilu
rope_theta10000001000000≈1
max_position_embeddings3276832768≈1
sliding_window131072131072≈1
rms_norm_eps0.0000010.000001≈1
vocab_size152064152064≈1
torch_dtypebfloat16bfloat16
attention_dropout00
bos_token_id151643151643≈1
eos_token_id151645151645≈1
initializer_range0.020.02≈1
max_window_layers2870×0.400
tie_word_embeddingsfalsefalse
transformers_version4.43.14.43.1
use_cachetruetrue
use_sliding_windowfalsefalse

Most similar architectures

Similarity values range from 0 (no shared categorical features) to 1 (identical profiles).

Raw config fields

23 fields
architecturesQwen2ForCausalLM
attention_dropout0
bos_token_id151643
eos_token_id151645
hidden_actsilu
hidden_size3584
initializer_range0.02
intermediate_size18944
max_position_embeddings32768
max_window_layers28
model_typeqwen2
num_attention_heads28
num_hidden_layers28
num_key_value_heads4
rms_norm_eps0.000001
rope_theta1000000
sliding_window131072
tie_word_embeddingsfalse
torch_dtypebfloat16
transformers_version4.43.1
use_cachetrue
use_sliding_windowfalse
vocab_size152064