Mixtral 8x7B
Mistral AI · Mixtral · open weights
- GQA
- RoPE
- Pre-norm
- MoE
Facts and where they come from
| Released | 2023-12 | labmodel cardHF repository created December 2023 |
|---|---|---|
| Licence | apache-2.0 | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 47B | paperarXiv 2401.04088abstract: 47B parameters, 13B active |
| Active parameters | 13B | paperarXiv 2401.04088abstract: 13B active parameters |
| Context length | 32K tokens | config.jsonconfig.jsonmax_position_embeddings |
| Norm placement | pre | codemodelling codetransformers 5.18.0 / repo modelling code for mixtral: input_layernorm before attention, post_attention_layernorm before the MLP |
| Norm type | RMSNorm | codemodelling codetransformers 5.18.0 / repo modelling code for mixtral: input_layernorm before attention, post_attention_layernorm before the MLP |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | RoPE | codemodelling coderotary on the full head (default) |
| Parallel attention and MLP | no | codemodelling codetransformers 5.18.0 / repo modelling code for mixtral: 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.
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) | 46.7B |
|---|---|
| Active per token (modelled) | 12.9B |
| Without embeddings and output head | 46.4B total, 12.6B active |
| Published weights (Hugging Face count) | 46.7B |
| KV cache per token, BF16 (layers that grow with context) | 128 KiB |
| KV cache + state at 32K tokens, BF16 | 4 GiB |
| Decode FLOPs per token at 4K context | 27.6 GFLOP |
| Prefill FLOPs for a 4K prompt | 108 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 4,096 | config.jsonconfig.jsonhidden_size |
| vocab | 32,000 | config.jsonconfig.jsonvocab_size |
| tied_embeddings | false | config.jsonconfig.jsontie_word_embeddings |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 32 | config.jsonconfig.jsonnum_attention_heads |
| mixers.full.kv_heads | 8 | config.jsonconfig.jsonnum_key_value_heads |
| mixers.full.head_dim | 128 | codemodelling codetransformers 5.18.0: head_dim = hidden_size / num_attention_heads |
| ffns.moe.type | moe | codemodelling codeMoE block |
| ffns.moe.experts | 8 | config.jsonconfig.jsonnum_local_experts |
| ffns.moe.active | 2 | config.jsonconfig.jsonnum_experts_per_tok |
| ffns.moe.d_expert | 14,336 | config.jsonconfig.jsonintermediate_size |
| ffns.moe.gated | true | codemodelling codeexperts are gated MLPs |
| layout | 32× full/moe | config.jsonconfig.jsonnum_hidden_layers |
Sources
- config.json @ fc7ac94
- model card
- arXiv 2401.04088
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision