Llama 3.2 3B
Meta · Llama 3 · open weights
- GQA
- RoPE
- Pre-norm
Facts and where they come from
| Released | 2024-09 | config.jsonconfig.jsonHugging Face repository creation date (api.createdAt) |
|---|---|---|
| Licence | llama3.2 | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 3.21B | labmodel cardREADME table: 3B (3.21B) |
| Active parameters | not disclosed | not disclosed |
| Context length | 128K tokens | labmeta-llama/llama-models sku_list.py (pinned)model card (README): context length 128k |
| Norm placement | pre | codemodelling codetransformers 5.18.0 / repo modelling code for llama: input_layernorm before attention, post_attention_layernorm before the MLP |
| Norm type | RMSNorm | codemodelling codetransformers 5.18.0 / repo modelling code for llama: 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 llama: input_layernorm before attention, post_attention_layernorm before the MLP |
Architecture, drawn from the data
GQA 24q/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) | 3.21B |
|---|---|
| Active per token (modelled) | 3.21B |
| Without embeddings and output head | 2.82B total, 2.82B active |
| Published weights (Hugging Face count) | 3.21B |
| KV cache per token, BF16 (layers that grow with context) | 112 KiB |
| KV cache + state at 128K tokens, BF16 | 14 GiB |
| Decode FLOPs per token at 4K context | 7.83 GFLOP |
| Prefill FLOPs for a 4K prompt | 26 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 3,072 | labmeta-llama/llama-models sku_list.py (pinned)sku_list.py arch_args_3b: dim |
| vocab | 128,256 | labmeta-llama/llama-models sku_list.py (pinned)sku_list.py: LLAMA3_VOCAB_SIZE |
| tied_embeddings | true | labmeta-llama/llama-models sku_list.py (pinned)model card: shared embeddings |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 24 | labmeta-llama/llama-models sku_list.py (pinned)sku_list.py arch_args_3b: n_heads |
| mixers.full.kv_heads | 8 | labmeta-llama/llama-models sku_list.py (pinned)sku_list.py arch_args_3b: n_kv_heads |
| mixers.full.head_dim | 128 | codemodelling codetransformers 5.18.0: head_dim = hidden_size / num_attention_heads |
| ffns.dense.type | dense | codemodelling codeMLP block |
| ffns.dense.d_ff | 8,192 | labmeta-llama/llama-models sku_list.py (pinned)llama3/model.py FeedForward: int(2*4*dim/3), x ffn_dim_multiplier 1.0, rounded up to multiple_of 256 |
| ffns.dense.gated | true | codemodelling codeMLP: gated (SwiGLU/GeGLU) |
| layout | 28× full/dense | labmeta-llama/llama-models sku_list.py (pinned)sku_list.py arch_args_3b: n_layers |
Sources
- config.json @ 13afe51
- model card
- meta-llama/llama-models sku_list.py (pinned) · meta-llama/llama-models sku_list.py (pinned)
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision
Listed in the LLM Architecture Gallery checklist as “Llama 3.2 (3B)” (name only; see about).