Meta · 2023-07 · Dense

Llama 2 70B

Llama 2 70B is a grouped-query attention (GQA) transformer released by Meta in 2023-07, with 80 layers, hidden size 8192 and a context window of 4,096 tokens.

Layer stack

Attention ×80 · Layers 80

Key facts

FamilyMeta
Released2023-07
Params68.98 B
Context4,096 tokens
AttentionGQA (64:8)
Layers80
Hidden8,192
Heads64
Vocab32,000
Positionlearned/absolute
NormRMSNorm
Activationsilu
Dtype
Architecture classLlamaForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 32,000 → Hidden 8,192 Q1 Q2 Q3 Qn KV1 KV2 KV3 KVn Heads 64 KV heads 8 head dim 128 · learned/absolute FFN · SwiGLU FFN dim 28,672 × 80 transformer block Attention Feed-forward / MoE RMSNorm pre-norm Final norm · RMSNorm LM head → Vocab 32,000 p p p → next token Position learned/absolute Dtype Context 4K tok
Drawn from the shipped config.json · 80 layers / width 8,192 / context 4,096. Original diagram by this atlas.

Attention

grouped-query attention (GQA) — 64 q-heads / 8 kv-heads.

Feed-forward / MoE

It is a dense model: all 68.98B 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 1 7B
ModelLlama 2 70BLLaMA 1 7BRatio
model_typellamallama
architecturesLlamaForCausalLMLlamaForCausalLM
hidden_size81924096×2.00
num_hidden_layers8032×2.50
num_attention_heads6432×2.00
num_key_value_heads8
intermediate_size2867211008×2.60
hidden_actsilusilu
max_position_embeddings40962048×2.00
rms_norm_eps0.000010.000001×10.00
vocab_size3200032000≈1
torch_dtypefloat16float16
bos_token_id11≈1
eos_token_id22≈1
initializer_range0.020.02≈1
pad_token_id00
tie_word_embeddingsfalsefalse
transformers_version4.31.0.dev04.28.0.dev0
use_cachetruetrue

Most similar architectures

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

Raw config fields

19 fields
architecturesLlamaForCausalLM
bos_token_id1
eos_token_id2
hidden_actsilu
hidden_size8192
initializer_range0.02
intermediate_size28672
max_position_embeddings4096
model_typellama
num_attention_heads64
num_hidden_layers80
num_key_value_heads8
pad_token_id0
rms_norm_eps0.00001
tie_word_embeddingsfalse
torch_dtypefloat16
transformers_version4.31.0.dev0
use_cachetrue
vocab_size32000