GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
arXiv preprint

The Llama 3 Herd of Models

Meta's 405B dense model on 15.6T tokens with 128K context, matching GPT-4 on many benchmarks, plus an unusually frank account of training on 16K GPUs: 419 unexpected failures in 54 days.

Breakdown by FDE Interviews · 13 min read · Updated

About the original · 2024
AUTHORS
Llama Team, AI @ Meta
FROM
Meta
PUBLISHED
Jul 2024 · arXiv preprint
CITED BY
20,924Semantic Scholar · Nov 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 17% of this breakdown.

01

The paper in one minute

The Llama 3 report covers a family of dense Transformers at 8B, 70B and 405B parameters (the results are for the Llama 3.1 release). Meta names three levers: data, scale and managing complexity. The architecture barely changes from Llama 2. The data and the scale change a great deal.

On data, Meta pretrained on about 15 trillion multilingual tokens after heavier deduplication, heuristic and model-based quality filtering, and a data mix chosen with small-scale scaling experiments: roughly half general knowledge, a quarter math and reasoning, 17% code and 8% multilingual text. A new 128K-token vocabulary packs 3.94 characters per token of English instead of 3.17. On scale, the 405B model used 3.8 × 10^25 FLOPs, almost 50 times Llama 2's largest model, and its size came from a scaling law built to predict benchmark accuracy rather than only loss. On complexity, Meta deliberately chose a dense model over mixture-of-experts, and DPO over PPO, to keep training stable.

Context grows to 128K tokens in six stages near the end of pretraining. Post-training repeats a round of reward modeling, rejection sampling, supervised fine-tuning and DPO several times. The 405B model lands close to GPT-4-class closed models on knowledge, code and math benchmarks, and Meta released its weights along with Llama Guard 3, a safety classifier. The infrastructure section is the most candid public account of what training at this scale involves: 466 job interruptions in a 54-day window, most of them hardware.

THE IDEA, VISUALLY
LLAMA 3 405B: DATA AND SCALE, NOT ARCHITECTURE 15.6T training tokens 3.8e25 FLOPs, ~50x Llama 2 128K context, in 6 stages PRETRAINING DATA MIX (SECTION 3.1) general 50% math 25% code 17% 8% ARCHITECTURE DELTAS FROM LLAMA 2 (TABLE 3) GQA, 8 KV heads all sizes 128K vocabulary 3.17 to 3.94 chars/token RoPE base 500,000 for long context Document masks no cross-doc attention 405B: 126 layers, d_model 16,384, 128 heads. Sized by a scaling law that predicts benchmark accuracy, extrapolated four orders of magnitude. post-training: rounds of reward model, rejection sampling, SFT and DPO; no PPO 54 DAYS ON 16K H100S (TABLE 5, BY COUNT) Faulty GPU 148 GPU HBM3 memory 72 Software bug 54 Network switch/cable 35 Host maintenance 32 Other GPU parts 48 Other 28 419 unexpected interruptions, one every 3.1 hours; GPU-related: 268 = 64% by count (table prints 58.7%) still over 90% effective training time SERVING 405B (ONE 8 X 80 GB NODE = 596 GiB) BF16 weights 754 GiB FP8 weights 377 GiB KV, one 128K seq 63 GiB node limit MMLU 87.3 (GPT-4 0125: 85.1, GPT-4o: 89.1) arXiv 2407.21783, Llama Team, Meta, July 2024
Llama 3's gains come from data and scale, not architecture: 15.6 trillion tokens, a 128K-token vocabulary, 3.8 × 10^25 FLOPs and a dense 405B model sized by its own scaling law. Running that on 16,384 H100s meant an unexpected interruption every three hours, most of them GPUs.
Research notes: the problem, approach and results
3.8 × 10^25

pretraining FLOPs for the 405B model on 15.6T tokens, almost 50x Llama 2's largest (Section 1)

419 in 54 days

unexpected job interruptions during a 54-day snapshot, about 78% hardware-related (Section 3.3.4)

87.3

Llama 3 405B on MMLU 5-shot, against 85.1 for GPT-4 (0125) and 89.1 for GPT-4o (Table 2)

THE PROBLEM

Open models trailed GPT-4-class systems by a wide margin in 2024, and the hard parts of closing the gap (data at the 15-trillion-token scale, a compute budget in the 10^25 FLOPs range, and keeping a 16,000-GPU job running) were rarely documented.

THE IDEA

Keep the dense Llama architecture, adding a 128K-token vocabulary, grouped-query attention in every size, a larger RoPE base and document-boundary attention masks. Pick the 405B size with a scaling law that predicts benchmark accuracy, train on 15.6T tokens, extend context to 128K in six stages, and post-train with several rounds of SFT, rejection sampling and DPO.

THE RESULT

Llama 3 405B scored 87.3 on MMLU (GPT-4 0125: 85.1; GPT-4o: 89.1), 89.0 on HumanEval and 96.8 on GSM8K, and was released with open weights alongside 8B and 70B models and Llama Guard 3. Training ran at 38-43% MFU with over 90% effective training time despite 419 unexpected interruptions in 54 days.

02

Why it matters to an FDE

Llama 3 405B was the first open-weight model to sit near GPT-4 on most standard benchmarks, which changed what "keep it on our own infrastructure" could mean for a customer.

Serving 405B is a real commitment. At 16-bit precision the weights alone are about 754 GiB, more than an 8 × 80 GB node holds. Meta's answer is FP8 inference, which halves that. Long context adds more: a single 128K-token conversation needs about 63 GiB of KV cache even with grouped-query attention. The 70B or 8B model is usually the practical choice; the 405B is often best used to generate training data or to judge outputs.

The scaling-law method is reusable. Meta forecast benchmark accuracy before training by chaining two fits: compute to task loss, then task loss to accuracy. The same two-step idea works for deciding whether a bigger fine-tuning run will clear a customer's accuracy bar.

Reliability numbers set expectations. One unexpected interruption every 3.1 hours on 16,384 GPUs, more than half of them GPU faults. If a customer plans its own large training run, checkpointing, automated restart and failure diagnosis are not optional, and this paper gives the numbers to plan around.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 290 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    Data over architecture, the scaling-law method, the infrastructure lessons and two misreadings

    Free account
  2. 04How it works

    Data curation, architecture deltas, sizing by scaling law, parallelism, long context, post-training

    Premium
  3. 05The numbers that matter

    Benchmarks against GPT-4-class models, training scale, utilization and the failure breakdown

    Premium
  4. 06Try it yourself

    Recheck the compute and scaling-law numbers, audit the failure table, and size 405B for serving

    Premium
  5. 07Where it breaks

    Benchmark comparisons, multimodal results that were not released, cost to serve, and slips

    Premium
  6. 08Using it on a deployment

    Picking among 8B, 70B and 405B, memory planning with FP8, and using 405B as a teacher

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →