Qwen · 2025-04 · Dense

Qwen3 8B

Qwen3 8B is a grouped-query attention (GQA) transformer released by Qwen in 2025-04, with 36 layers, hidden size 4096 and a context window of 40,960 tokens.

Layer stack

Attention ×36 · Layers 36

Key facts

FamilyQwen
Released2025-04
Params7.9 B
Context40,960 tokens
AttentionGQA (32:8)
Layers36
Hidden4,096
Heads32
Vocab151,936
PositionRoPE
NormRMSNorm
Activationsilu
Dtypebf16
Architecture classQwen3ForCausalLM

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 8 head dim 128 · RoPE FFN · SwiGLU FFN dim 12,288 × 36 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 40K tok
Drawn from the shipped config.json · 36 layers / width 4,096 / context 40,960. Original diagram by this atlas.

Attention

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

Feed-forward / MoE

It is a dense model: all 7.9B 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 Qwen3 32B
ModelQwen3 8BQwen3 32BRatio
model_typeqwen3qwen3
architecturesQwen3ForCausalLMQwen3ForCausalLM
hidden_size40965120×0.800
num_hidden_layers3664×0.563
num_attention_heads3264×0.500
num_key_value_heads88≈1
head_dim128128≈1
intermediate_size1228825600×0.480
hidden_actsilusilu
rope_theta10000001000000≈1
max_position_embeddings4096040960≈1
rms_norm_eps0.0000010.000001≈1
vocab_size151936151936≈1
torch_dtypebfloat16bfloat16
attention_biasfalsefalse
attention_dropout00
bos_token_id151643151643≈1
eos_token_id151645151645≈1
initializer_range0.020.02≈1
max_window_layers3664×0.563
tie_word_embeddingsfalsefalse
transformers_version4.51.04.51.0
use_cachetruetrue
use_sliding_windowfalsefalse

Most similar architectures

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

Raw config fields

24 fields
architecturesQwen3ForCausalLM
attention_biasfalse
attention_dropout0
bos_token_id151643
eos_token_id151645
head_dim128
hidden_actsilu
hidden_size4096
initializer_range0.02
intermediate_size12288
max_position_embeddings40960
max_window_layers36
model_typeqwen3
num_attention_heads32
num_hidden_layers36
num_key_value_heads8
rms_norm_eps0.000001
rope_theta1000000
tie_word_embeddingsfalse
torch_dtypebfloat16
transformers_version4.51.0
use_cachetrue
use_sliding_windowfalse
vocab_size151936