Qwen · 2024-02 · Dense

Qwen1.5 7B

Qwen1.5 7B is a multi-head attention (MHA) transformer released by Qwen in 2024-02, with 32 layers, hidden size 4096 and a context window of 32,768 tokens.

Layer stack

Attention ×32 · Layers 32

Key facts

FamilyQwen
Released2024-02
Params6.6 B
Context32,768 tokens
AttentionMHA (32:32)
Layers32
Hidden4,096
Heads32
Vocab151,936
PositionRoPE
NormRMSNorm
Activationsilu
Dtypebf16
Architecture classQwen2ForCausalLM

Architecture overview

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

Attention

multi-head attention (MHA) — 32 q-heads / 32 kv-heads. RoPE θ=1,000,000.

Feed-forward / MoE

It is a dense model: all 6.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 most-similar DeepSeek-Coder 6.7B
ModelQwen1.5 7BDeepSeek-Coder 6.7BRatio
model_typeqwen2llama
architecturesQwen2ForCausalLMLlamaForCausalLM
hidden_size40964096≈1
num_hidden_layers3232≈1
num_attention_heads3232≈1
num_key_value_heads3232≈1
intermediate_size1100811008≈1
hidden_actsilusilu
rope_theta1000000100000×10.00
max_position_embeddings3276816384×2.00
sliding_window32768
rms_norm_eps0.0000010.000001≈1
vocab_size15193632256×4.71
torch_dtypebfloat16bfloat16
attention_dropout0
bos_token_id15164332013×4.74
eos_token_id15164332014×4.74
initializer_range0.020.02≈1
max_window_layers28
tie_word_embeddingsfalsefalse
transformers_version4.37.04.34.1
use_cachetruetrue
use_sliding_windowfalse

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_id151643
hidden_actsilu
hidden_size4096
initializer_range0.02
intermediate_size11008
max_position_embeddings32768
max_window_layers28
model_typeqwen2
num_attention_heads32
num_hidden_layers32
num_key_value_heads32
rms_norm_eps0.000001
rope_theta1000000
sliding_window32768
tie_word_embeddingsfalse
torch_dtypebfloat16
transformers_version4.37.0
use_cachetrue
use_sliding_windowfalse
vocab_size151936