Meta · 2024-07 · Dense
Llama 3.1 8B
Llama 3.1 8B is a grouped-query attention (GQA) transformer released by Meta in 2024-07, with 32 layers, hidden size 4096 and a context window of 131,072 tokens.
Layer stack
Attention ×32 · Layers 32
Key facts
| Family | Meta |
|---|---|
| Released | 2024-07 |
| Params | 8.03 B |
| Context | 131,072 tokens |
| Attention | GQA (32:8) |
| Layers | 32 |
| Hidden | 4,096 |
| Heads | 32 |
| Vocab | 128,256 |
| Position | RoPE |
| Norm | RMSNorm |
| Activation | silu |
| Dtype | bf16 |
| Architecture class | LlamaForCausalLM |
Architecture overview
Attention
grouped-query attention (GQA) — 32 q-heads / 8 kv-heads. RoPE θ=500,000.
Feed-forward / MoE
It is a dense model: all 8.03B 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 predecessor Llama 3.1 70B
| Model | Llama 3.1 8B | Llama 3.1 70B | Ratio |
|---|---|---|---|
| model_type | llama | llama | = |
| architectures | LlamaForCausalLM | LlamaForCausalLM | = |
| hidden_size | 4096 | 8192 | ×0.500 |
| num_hidden_layers | 32 | 80 | ×0.400 |
| num_attention_heads | 32 | 64 | ×0.500 |
| num_key_value_heads | 8 | 8 | ≈1 |
| head_dim | 128 | — | |
| intermediate_size | 14336 | 28672 | ×0.500 |
| hidden_act | silu | silu | = |
| rope_theta | 500000 | 500000 | ≈1 |
| max_position_embeddings | 131072 | 131072 | ≈1 |
| rms_norm_eps | 0.00001 | 0.00001 | ≈1 |
| vocab_size | 128256 | 128256 | ≈1 |
| torch_dtype | bfloat16 | bfloat16 | = |
| _name_or_path | meta-llama/meta-Llama-3.1-8B-Instruct | — | |
| attention_bias | false | false | = |
| attention_dropout | 0 | 0 | = |
| bos_token_id | 128000 | 128000 | ≈1 |
| eos_token_id | 128009 | 128001×1 + 128008×1 + 128009×1 | ≠ |
| initializer_range | 0.02 | 0.02 | ≈1 |
| mlp_bias | false | false | = |
| pad_token_id | 128004 | — | |
| pretraining_tp | 1 | 1 | ≈1 |
| tie_word_embeddings | false | false | = |
| transformers_version | 4.49.0.dev0 | 4.42.3 | ≠ |
| unsloth_fixed | true | — |
Most similar architectures
- Hunyuan-TurboS 7B (Hunyuan, 2026-05) 1.000
- Qwen3 8B (Qwen, 2025-04) 0.999
- Hunyuan 7B (Hunyuan, 2025-08) 0.999
- Mistral 7B (Mistral, 2023-09) 0.999
- Qwen2.5 7B (Qwen, 2024-09) 0.999
- Qwen3.6 27B (Qwen, 2026-04) 0.992
Similarity values range from 0 (no shared categorical features) to 1 (identical profiles).
Raw config fields
27 fields
| _name_or_path | meta-llama/meta-Llama-3.1-8B-Instruct |
|---|---|
| architectures | LlamaForCausalLM |
| attention_bias | false |
| attention_dropout | 0 |
| bos_token_id | 128000 |
| eos_token_id | 128009 |
| head_dim | 128 |
| hidden_act | silu |
| hidden_size | 4096 |
| initializer_range | 0.02 |
| intermediate_size | 14336 |
| max_position_embeddings | 131072 |
| mlp_bias | false |
| model_type | llama |
| num_attention_heads | 32 |
| num_hidden_layers | 32 |
| num_key_value_heads | 8 |
| pad_token_id | 128004 |
| pretraining_tp | 1 |
| rms_norm_eps | 0.00001 |
| rope_theta | 500000 |
| tie_word_embeddings | false |
| torch_dtype | bfloat16 |
| transformers_version | 4.49.0.dev0 |
| unsloth_fixed | true |
| use_cache | true |
| vocab_size | 128256 |