Mistral · 2023-09 · Dense

Mistral 7B

Mistral 7B is a grouped-query attention (GQA) transformer released by Mistral in 2023-09, with 32 layers, hidden size 4096 and a context window of 32,768 tokens.

Layer stack

Attention ×32 · Layers 32

Key facts

FamilyMistral
Released2023-09
Params7.24 B
Context32,768 tokens
AttentionGQA (32:8)
Layers32
Hidden4,096
Heads32
Vocab32,000
PositionRoPE
NormRMSNorm
Activationsilu
Dtype
Architecture classMistralForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 32,000 → Hidden 4,096 Q1 Q2 Q3 Qn KV1 KV2 KV3 KVn Heads 32 KV heads 8 head dim 128 · RoPE FFN · SwiGLU FFN dim 14,336 × 32 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 32K tok
Drawn from the shipped config.json · 32 layers / width 4,096 / context 32,768. Original diagram by this atlas.

Attention

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

Feed-forward / MoE

It is a dense model: all 7.24B 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 Hunyuan 7B
ModelMistral 7BHunyuan 7BRatio
model_typemistralhunyuan_v1_dense
architecturesMistralForCausalLMHunYuanDenseV1ForCausalLM
hidden_size40964096≈1
num_hidden_layers3232≈1
num_attention_heads3232≈1
num_key_value_heads88≈1
head_dim128
intermediate_size1433614336≈1
hidden_actsilusilu
rope_theta1000010000≈1
max_position_embeddings3276832768≈1
sliding_window4096
rms_norm_eps0.000010.00001≈1
vocab_size32000128167×0.250
torch_dtypebfloat16bfloat16
bos_token_id11≈1
eos_token_id2127960×0.000
initializer_range0.020.02≈1
tie_word_embeddingsfalsetrue
transformers_version4.34.0.dev04.41.2
use_cachetruetrue

Most similar architectures

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

Raw config fields

20 fields
architecturesMistralForCausalLM
bos_token_id1
eos_token_id2
hidden_actsilu
hidden_size4096
initializer_range0.02
intermediate_size14336
max_position_embeddings32768
model_typemistral
num_attention_heads32
num_hidden_layers32
num_key_value_heads8
rms_norm_eps0.00001
rope_theta10000
sliding_window4096
tie_word_embeddingsfalse
torch_dtypebfloat16
transformers_version4.34.0.dev0
use_cachetrue
vocab_size32000