The Llama 3 Herd of Models
A 405B Dense Transformer, Its Scaling Laws, 16K-GPU Training Stack, SFT + Rejection Sampling + DPO Post-Training, and Compositional Vision & Speech Adapters
Llama Team, AI @ Meta
9
Concepts
Paper Overview
The Llama 3 Herd of Models (Llama Team, AI @ Meta, 2024) is a 92-page engineering report, and it makes an unfashionable argument: a frontier model does not need a new architecture. The flagship is a dense Transformer with 405B parameters and a 128K-token context window, pre-trained on 15.6T tokens with FLOPs — almost 50x the largest Llama 2 — and it performs on par with GPT-4 across a wide range of tasks.
The authors name three levers: data, scale, and managing complexity. Data means roughly 15T multilingual tokens (versus 1.8T for Llama 2) with much stricter curation. Scale means a flagship sized by the team's own scaling laws to be approximately compute-optimal for its budget. Managing complexity means choosing the boring option whenever it scales better: a standard dense Transformer instead of mixture-of-experts, and SFT + rejection sampling + DPO instead of PPO-style RLHF.
This breakdown follows the method. It covers the architecture tweaks (GQA, RoPE base 500,000, a 128K vocabulary), the IsoFLOP scaling laws that picked 405B, the data mix and annealing, the six-stage extension to 128K context, the 4D-parallel training stack on 16K H100s, the post-training loop, and the compositional vision and speech adapters that add modalities without touching the language model's weights.
Chapter Roadmap
Click any topic to jump in
Data, Scale, Managing Complexity
Meta's thesis: frontier quality comes from better data, far more compute, and deliberately boring design choices that scale.
A Deliberately Standard Dense Transformer
No mixture-of-experts. GQA with 8 KV heads, RoPE base 500,000, a 128K-token vocabulary and a cross-document attention mask.
Compute-Optimal Sizing of the 405B
IsoFLOP parabolas from 6e18 to 1e22 FLOPs extrapolate to 402B params on 16.55T tokens at a 3.8e25 FLOP budget.
What the model sees
Data Mix + Annealing
~15T curated multilingual tokens: 50% general, 25% math/reasoning, 17% code, 8% multilingual — finished by annealing on high-quality data.
Extending to 128K Context
Six gated stages from 8K to 128K using ~800B tokens, only advancing once short-context scores recover and needle retrieval is perfect.
4D Parallelism on 16K H100s
TP, CP, PP and FSDP nested by bandwidth need; 38-43% BF16 MFU and >90% effective training time despite 419 unexpected interruptions.
SFT + Rejection Sampling + DPO Rounds
Six rounds of reward model, best-of-K rejection sampling, SFT and DPO — no PPO — with model averaging at every stage.
Compositional Vision & Speech
Frozen LLM plus trained encoders: cross-attention adapters for images/video, a token-embedding adapter for speech.
Results
405B lands on par with GPT-4-class models (87.3 MMLU, 96.8 GSM8K, 89.0 HumanEval); the adapters beat GPT-4V and Whisper.
Concept by concept
9 sections, in reading order.
Unlock the full breakdown
All 9 concepts — figures, key points, formulas and interactive demos — are part of PixelBank Premium.
- 01Data, Scale, and Managing Complexity
- 02A Deliberately Standard Dense Transformer
- 03Compute-Optimal Sizing of the 405B
- 04The Pre-Training Data Mix and Annealing
- 05Extending the Context Window to 128K
- 064D Parallelism on 16K H100s
- 07Post-Training: SFT, Rejection Sampling, and DPO in Rounds
- 08Compositional Vision and Speech Adapters
- 09Results
Keep reading
Related Papers
Go deeper