llm-architectures-explained

/models

Mistral Small 3.1

Mistral AI · Mistral Small · open weights · multimodal (text stack modelled)

Facts and where they come from

Released2025-03config.jsonconfig.jsonHugging Face repository creation date (api.createdAt)
Licenceapache-2.0config.jsonconfig.jsonREADME metadata: license
Total parameters24Blabmodel cardmodel name Mistral-Small-3.1-24B
Active parametersnot disclosednot disclosed
Context length128K tokensconfig.jsonconfig.jsontext_config.max_position_embeddings
Norm placementprecodemodelling codetransformers 5.18.0 / repo modelling code for mistral: input_layernorm before attention, post_attention_layernorm before the MLP
Norm typeRMSNormcodemodelling codetransformers 5.18.0 / repo modelling code for mistral: input_layernorm before attention, post_attention_layernorm before the MLP
QK-normnocodemodelling codeno q/k normalisation in the attention block
Positional encodingRoPEcodemodelling coderotary on the full head (default)
Parallel attention and MLPnocodemodelling codetransformers 5.18.0 / repo modelling code for mistral: input_layernorm before attention, post_attention_layernorm before the MLP

Architecture, drawn from the data

GQA 32q/8kv. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.

Mistral Small 3.1: layer stack and blockslayers (40)mixer / FFNlayer 0: GQA: 32 query / 8 KV heads · head 128layer 0: Gated MLP: 32768layer 1: GQA: 32 query / 8 KV heads · head 128layer 1: Gated MLP: 32768layer 2: GQA: 32 query / 8 KV heads · head 128layer 2: Gated MLP: 32768layer 3: GQA: 32 query / 8 KV heads · head 128layer 3: Gated MLP: 32768layer 4: GQA: 32 query / 8 KV heads · head 128layer 4: Gated MLP: 32768layer 5: GQA: 32 query / 8 KV heads · head 128layer 5: Gated MLP: 32768layer 6: GQA: 32 query / 8 KV heads · head 128layer 6: Gated MLP: 32768layer 7: GQA: 32 query / 8 KV heads · head 128layer 7: Gated MLP: 32768layer 8: GQA: 32 query / 8 KV heads · head 128layer 8: Gated MLP: 32768layer 9: GQA: 32 query / 8 KV heads · head 128layer 9: Gated MLP: 32768layer 10: GQA: 32 query / 8 KV heads · head 128layer 10: Gated MLP: 32768layer 11: GQA: 32 query / 8 KV heads · head 128layer 11: Gated MLP: 32768layer 12: GQA: 32 query / 8 KV heads · head 128layer 12: Gated MLP: 32768layer 13: GQA: 32 query / 8 KV heads · head 128layer 13: Gated MLP: 32768layer 14: GQA: 32 query / 8 KV heads · head 128layer 14: Gated MLP: 32768layer 15: GQA: 32 query / 8 KV heads · head 128layer 15: Gated MLP: 32768layer 16: GQA: 32 query / 8 KV heads · head 128layer 16: Gated MLP: 32768layer 17: GQA: 32 query / 8 KV heads · head 128layer 17: Gated MLP: 32768layer 18: GQA: 32 query / 8 KV heads · head 128layer 18: Gated MLP: 32768layer 19: GQA: 32 query / 8 KV heads · head 128layer 19: Gated MLP: 32768layer 20: GQA: 32 query / 8 KV heads · head 128layer 20: Gated MLP: 32768layer 21: GQA: 32 query / 8 KV heads · head 128layer 21: Gated MLP: 32768layer 22: GQA: 32 query / 8 KV heads · head 128layer 22: Gated MLP: 32768layer 23: GQA: 32 query / 8 KV heads · head 128layer 23: Gated MLP: 32768layer 24: GQA: 32 query / 8 KV heads · head 128layer 24: Gated MLP: 32768layer 25: GQA: 32 query / 8 KV heads · head 128layer 25: Gated MLP: 32768layer 26: GQA: 32 query / 8 KV heads · head 128layer 26: Gated MLP: 32768layer 27: GQA: 32 query / 8 KV heads · head 128layer 27: Gated MLP: 32768layer 28: GQA: 32 query / 8 KV heads · head 128layer 28: Gated MLP: 32768layer 29: GQA: 32 query / 8 KV heads · head 128layer 29: Gated MLP: 32768layer 30: GQA: 32 query / 8 KV heads · head 128layer 30: Gated MLP: 32768layer 31: GQA: 32 query / 8 KV heads · head 128layer 31: Gated MLP: 32768layer 32: GQA: 32 query / 8 KV heads · head 128layer 32: Gated MLP: 32768layer 33: GQA: 32 query / 8 KV heads · head 128layer 33: Gated MLP: 32768layer 34: GQA: 32 query / 8 KV heads · head 128layer 34: Gated MLP: 32768layer 35: GQA: 32 query / 8 KV heads · head 128layer 35: Gated MLP: 32768layer 36: GQA: 32 query / 8 KV heads · head 128layer 36: Gated MLP: 32768layer 37: GQA: 32 query / 8 KV heads · head 128layer 37: Gated MLP: 32768layer 38: GQA: 32 query / 8 KV heads · head 128layer 38: Gated MLP: 32768layer 39: GQA: 32 query / 8 KV heads · head 128layer 39: Gated MLP: 3276802039× 40normGQA: 32 query / 8 KV heads · head 128+normGated MLP: 32768+full attentiondense FFN

Modelled costs

From the cost model, batch size 1. Totals the lab states are in the table above; differences come from rounding, from what a lab counts, or from parts the model does not describe (listed on the about page).

Parameters (modelled)23.6B
Active per token (modelled)23.6B
Without embeddings and output head22.2B total, 22.2B active
Published weights (Hugging Face count)24B
KV cache per token, BF16 (layers that grow with context)160 KiB
KV cache + state at 128K tokens, BF1620 GiB
Decode FLOPs per token at 4K context48.5 GFLOP
Prefill FLOPs for a 4K prompt188 TFLOP

KV cache against context

Mistral Small 3.1: KV cache bytes against context length101001,00010,000100,000980 KiB9.5 MiB95 MiB950 MiB9.3 GiBcontext (tokens)KV cache + state (BF16)Mistral Small 3.1

Compare with other models →

Every architecture field

FieldValueSource
d_model5,120config.jsonconfig.jsontext_config.hidden_size
vocab131,072config.jsonconfig.jsontext_config.vocab_size
tied_embeddingsfalsecodemodelling codetransformers 5.18.0: PretrainedConfig.tie_word_embeddings defaultnot in config
mixers.full.typeattncodemodelling codeattention block
mixers.full.heads32config.jsonconfig.jsontext_config.num_attention_heads
mixers.full.kv_heads8config.jsonconfig.jsontext_config.num_key_value_heads
mixers.full.head_dim128config.jsonconfig.jsontext_config.head_dim
ffns.dense.typedensecodemodelling codeMLP block
ffns.dense.d_ff32,768config.jsonconfig.jsontext_config.intermediate_size
ffns.dense.gatedtruecodemodelling codeMLP: gated (SwiGLU/GeGLU)
layout40× full/denseconfig.jsonconfig.jsontext_config.num_hidden_layers

Sources

Listed in the LLM Architecture Gallery checklist as “Mistral Small 3.1 (24B)” (name only; see about).