Mistral · 2024-04 · Sparse MoE

Mixtral 8x22B

Mixtral 8x22B is a grouped-query attention (GQA) transformer released by Mistral in 2024-04, with 56 layers, hidden size 6144 and a context window of 65,536 tokens.

Layer stack

Attention ×56 · Layers 56

Key facts

FamilyMistral
Released2024-04
Params140.6 B
Active39.1 B
Context65,536 tokens
AttentionGQA (48:8)
Layers56
Hidden6,144
Heads48
Vocab32,000
PositionRoPE
NormRMSNorm
Activationsilu
Dtype
Architecture classMixtralForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 32,000 → Hidden 6,144 Q1 Q2 Q3 Qn KV1 KV2 KV3 KVn Heads 48 KV heads 8 head dim 128 · RoPE Router E1 E2 E3 E4 E5 E6 E7 E8 top-2 of 8 experts · ≈ 39.1B params active per token × 56 transformer block Attention Feed-forward / MoE RMSNorm pre-norm Final norm · RMSNorm LM head → Vocab 32,000 p p p → next token Position RoPE Dtype Context 64K tok
Drawn from the shipped config.json · 56 layers / width 6,144 / context 65,536. Original diagram by this atlas.

Attention

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

Feed-forward / MoE

It is a sparse mixture-of-experts with 8 routed experts and top-2 routing; about 39.1B parameters are active per 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 Mistral 7B
ModelMixtral 8x22BMistral 7BRatio
model_typemixtralmistral
architecturesMixtralForCausalLMMistralForCausalLM
hidden_size61444096×1.50
num_hidden_layers5632×1.75
num_attention_heads4832×1.50
num_key_value_heads88≈1
intermediate_size1638414336×1.14
hidden_actsilusilu
num_experts_per_tok2
rope_theta100000010000×100.00
max_position_embeddings6553632768×2.00
sliding_window4096
rms_norm_eps0.000010.00001≈1
vocab_size3200032000≈1
torch_dtypebfloat16bfloat16
attention_dropout0
bos_token_id11≈1
eos_token_id22≈1
initializer_range0.020.02≈1
num_local_experts8
output_router_logitsfalse
router_aux_loss_coef0.001
tie_word_embeddingsfalsefalse
transformers_version4.38.04.34.0.dev0
use_cachetruetrue

Most similar architectures

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

Raw config fields

24 fields
architecturesMixtralForCausalLM
attention_dropout0
bos_token_id1
eos_token_id2
hidden_actsilu
hidden_size6144
initializer_range0.02
intermediate_size16384
max_position_embeddings65536
model_typemixtral
num_attention_heads48
num_experts_per_tok2
num_hidden_layers56
num_key_value_heads8
num_local_experts8
output_router_logitsfalse
rms_norm_eps0.00001
rope_theta1000000
router_aux_loss_coef0.001
tie_word_embeddingsfalse
torch_dtypebfloat16
transformers_version4.38.0
use_cachetrue
vocab_size32000