In one line: Meta's full playbook for a GPT-4-class open model: 405B dense on 15.6T tokens (50/25/17/8 data mix, 3-stage recipe with 128K long-context extension and annealing), six rounds of RM + rejection sampling + SFT + DPO, on 16K H100s at 38-43% MFU with 419 unexpected interruptions in 54 days (78% hardware) yet >90% effective training time.
Verdict: Believe the engineering record: the cluster, the parallelism layout, the failure log and the recipe are the most detailed public account of a frontier-scale run, and its scaling-law forecast reproduces from its own figures. Read the benchmark claims as approximate: rivals' scores mix self-run and reported numbers, many gaps sit inside the noise, and the paper's own human evaluation has the 405B behind GPT-4o rather than level with it. How much of this to believe
The idea in one sentence: a plain dense Transformer, Llama 2's with four small changes, reaches GPT-4-class quality because of what surrounds it: 15.6T cleaner tokens, a size picked by a scaling law aimed at benchmark accuracy, engineering that keeps 16,384 H100s training through an unexpected stop every three hours, and a post-training loop (reward model, rejection sampling, SFT, DPO) simple enough to repeat six times.
You need: the parallelism forms (data and FSDP, tensor, pipeline, context) from Distributed training, scaling laws and IsoFLOPs curves from Pretraining (section 3), and SFT, reward models and DPO from Alignment. This page says what Llama 3 did with each.
New terms
In mid-2024 the best open-weight models trailed GPT-4-class closed models by a wide margin, and no open release explained how to build one end to end: the data curation, how to size the model for a compute budget, the infrastructure that keeps 16,000 GPUs busy, and a post-training recipe that scales. Llama 3 is Meta's answer on both counts: a dense 405-billion-parameter model that it says "delivers comparable quality to leading language models such as GPT-4 on a plethora of tasks", released with its weights, and a 92-page report of how it was made (abstract, §1; 92 pages in the v3 PDF).
The report names three levers (§1):
The question: can an open team reach GPT-4 quality with nothing exotic, only more and cleaner data, a budget sized by a scaling law, and engineering that keeps the run alive?
The herd is three sizes, each as a pre-trained and an instruction-tuned model. Llama 3 8B and 70B came out in April 2024; Llama 3.1 in July 2024 added the 405B, eight-language multilingual support, a 128K-token context and tool use at every size. Every result in the paper is for the 3.1 models, which it calls Llama 3 (Table 1). The April 8B and 70B "were pre-trained on multilingual data but were intended for use in English at the time" (footnote 1).
The architecture is Llama 2's with four changes; the paper credits its gains "primarily" to data and scale, not architecture (§3.2):
The design lineage (Llama 1 to 4, the licence, why Meta stayed dense until Llama 4) is on the Meta lab page; this page keeps to what the report itself adds.
| 8B | 70B | 405B |
|---|
Rows from Table 3; all three use SwiGLU, RoPE with θ = 500,000 and a 128,000-token vocabulary as printed (the released config.json says 128,256). The parameter row is recounted here from those shapes: attention, SwiGLU feed-forward, two RMSNorm vectors per layer, untied input and output embeddings. The 405B comes out at , the 70B at and the 8B at ; the tables tab shows the breakdown.
The corpus has knowledge up to the end of 2023 and is mostly web text, cleaned in seven stages (§3.1.1): safety and PII filtering, a custom HTML parser that strips markdown, de-duplication by URL, document and line (the methods are on Deduplication), heuristic filters, model-based quality classifiers, separate code and maths pipelines, and per-language multilingual processing.
The mix was chosen with a knowledge classifier (to downsample categories over-represented on the web, such as arts and entertainment) and scaling-law experiments on candidate mixes: train small models on a mix, predict a large model's performance, repeat, then train a larger model on the winner (§3.1.2). The final mix is the bar beside this section: about half general knowledge, a quarter maths and reasoning.
The mix also moved during the run: more non-English data, upsampled maths, more recent web data late on to advance the knowledge cut-off, and less of subsets later judged low quality (§3.4.1).
Annealing as a data lever. Annealing on small amounts of high-quality code and maths lifts benchmark scores; no benchmark training sets go into the annealing data, so few-shot scores stay honest. In a test that did use them, annealing a pre-trained 8B on the GSM8K and MATH training sets raised its validation scores by 24.0% and 6.4%, while the gains for the 405B were "negligible" (§3.1.3). Annealing is also Meta's cheap test of a new dataset: take an 8B trained to 50%, anneal its learning rate linearly to 0 over 40B tokens with 30% weight on the new data and 70% on the default mix, and measure. That costs far less than a scaling-law study per dataset.
Ordinary scaling laws predict next-token loss, not benchmark scores, and laws fitted on small runs can be unreliable (Pretraining owns scaling laws and compute-optimal allocation). Meta's answer is a two-stage method (§3.2.1):
Fig. 1, step by step: from 133 small runs to the size of the flagship
Fig. 1 rebuilds the paper's Figures 2 and 3 in 3D: the 133 points are read from the vector PDF in the arXiv source, the parabolas and the power law are refitted by this page's recompute.py (the forecast tab has them in 2D, with residuals), and loss is drawn to scale above 0.67. Scaling laws and compute-optimal allocation in general are taught on Pretraining.
The runs span budgets from 6 × 1018 to 1022 FLOPs and models from 40M to 16B parameters. At each budget a parabola is fitted to validation loss against training tokens (Figure 2); its minimum is that budget's compute-optimal model. A power law through the ten minima gives the optimal number of training tokens:
Cosine learning rate with 2,000 warm-up steps, peak between 2 × 10−4 and 4 × 10−4 by size, decay to 0.1 of peak, weight decay 0.1 times the learning rate, and a fixed batch of 250K to 4M tokens per budget (§3.2.1).
Try: switch between the constants printed in the text, the ones printed in the figure's own legend, and a refit of the ten points read from the figure's vector graphics. Drag the budget to 4 × 1025.
Points: the ten compute-optimal models of Figure 3, read from the vector PDF in the arXiv source and calibrated on the figure's gridlines (their budgets come out at exactly 6 × 1018 … 1022, which checks the calibration). The refit is an ordinary least-squares line in log-log space. Parameters for a budget are C / (6D⋆), the standard approximation the paper does not state but its numbers match.
So the printed constants are rounded too hard to reproduce the printed forecast: they give 10.5T tokens. The figure itself carries the fuller values in its legend, α = 0.537 and A = 0.299, and a refit of its ten points gives α = and A = . With the refit, the paper's 16.55T comes out at a budget of FLOPs, where C / 6D gives parameters: the paper's "402B on 16.55T" reproduces exactly at 4.0 × 1025, not at the 3.8 × 1025 it names (derived here; the paper does not say which budget it plugged in). At 3.8 × 1025 the same law gives tokens and parameters. The Meta lab page flagged this gap as unconfirmed; the legend and the refit close it.
The run that followed used 15.6T tokens, and 6 × × 15.6T = FLOPs reproduces the stated 3.8 × 1025. Meta chose 405B because the IsoFLOPs curves "become flatter around the minimum as the compute budget increases", so being a few percent off the optimal size costs little loss. The curvature of the fitted parabolas falls from about 0.09 per decade squared at the small budgets to 0.05 to 0.06 at the largest two (recomputed in the forecast tab).
The benchmark forecast. For ARC Challenge, stage 1 fits a line through seven scaling-law models (6 × 1019 to 1022 FLOPs) and extrapolates 3.6 orders of magnitude to the flagship; stage 2 maps the predicted NLL to accuracy. The paper calls the result "quite accurate: it only slightly underestimates the final performance" (Figure 4). Read from the figure: predicted NLL 1.201 against an actual 1.190, and predicted accuracy 95.8% against 96.0% (the pre-trained 405B scores 96.1 ± 1.1 in Table 12). The forecast tab refits both stages and shows what the forecast leans on: the scaling-law models all score 27% to 34%, near the 25% chance level, so the sigmoid's shape comes from four Llama 2 models and from fixing its ceiling at 100%.
The cluster in one line (§3.3.1): up to 16K H100s, eight per server on NVLink, 400 Gbps RoCE between servers in a three-layer Clos network whose pods of 3,072 GPUs are joined at 1:7 oversubscription, so traffic that crosses pods is seven times scarcer and the layout below keeps the chatty groups inside servers and pods (Interconnects and scaling owns RoCE, Clos fabrics and collectives).
The cluster (§3.3.1). Llama 1 and 2 trained on Meta's AI Research SuperCluster; Llama 3 moved to Meta's production clusters for "production-grade reliability". The 405B used up to 16K H100 GPUs (700 W, 80 GB HBM3) in Grand Teton servers of eight GPUs and two CPUs, NVLink inside each server, scheduled by MAST, Meta's global training scheduler. Storage is Tectonic, Meta's distributed file system: 240 PB on 7,500 SSD servers, 2 TB/s sustained and 7 TB/s peak, sized for bursty checkpoint writes of 1 MB to 4 GB per GPU.
The network. The 405B ran on RDMA over Converged Ethernet (RoCE) with Arista 7800 and Minipack2 switches; the smaller models used Nvidia Quantum2 InfiniBand; both at 400 Gbps between GPUs, tuned to equal performance. The RoCE cluster is a three-layer Clos network of 24K GPUs (Llama 3 used up to 16K): 16 GPUs per rack under one top-of-rack switch, 192 racks per pod of 3,072 GPUs at full bisection bandwidth, and eight pods joined by aggregation switches at 1:7 oversubscription. So traffic that crosses pods is seven times scarcer, and the parallelism layout and the scheduler are topology-aware. Two fixes replace classic congestion control: the collective library opens 16 flows between each GPU pair, which Enhanced-ECMP hashes across paths, and deep-buffer spine switches absorb bursts. The cluster runs without DCQCN.
4D parallelism (§3.3.2, Figure 5). Four ways of splitting the job compose on one device mesh, ordered from the most to the least bandwidth-hungry; what each form splits and sends is taught on Distributed training, and here is where Llama 3 put each:
Communicates inside every layer, so it stays inside one 8-GPU NVLink server (Megatron-LM).
Only in the long-context stage. Each rank holds 2 of 2×CP chunks (the i-th and the (2×CP − 1 − i)-th) to balance the causal mask.
The 126 layers in 16 stages; only point-to-point traffic between neighbouring stages.
Optimiser state and gradients sharded (ZeRO). Weights are not resharded after the forward pass, saving an all-gather in the backward. Outermost because prefetching weights and reducing gradients asynchronously hides long latencies.
The three configurations of the run reach 38% to 43% BF16 model FLOPs utilisation (Table 4):
| GPUs | TP | CP | PP | DP | Seq. len. | Batch/DP | Tokens/batch | TFLOPs/GPU | MFU |
|---|
Every row multiplies out: TP × CP × PP × DP is the GPU count and DP × batch × sequence length is 16.8M tokens (224); the middle row's printed 41% MFU recomputes as 40.4%, and v1's DP = 4 in the 128K row was corrected to 8 in v3 (the tables tab has the check). MFU dropped from 43% to 41% going from 8K to 16K GPUs because keeping 16M tokens per batch halves the batch per data-parallel group.
Engineering details that made it work:
The device mesh, rank by rank, and where each group lands in the racks and pods is in the 16K-GPU tab; the Meta lab page shows the three Table 4 meshes at a glance, and Distributed PyTorch covers FSDP and DTensor in general.
Synchronous training is fragile: one failed GPU can stop the whole job. Over a 54-day snapshot of 405B pre-training there were 466 interruptions: 47 planned (automated firmware and kernel upgrades, operator changes to configuration or data) and 419 unexpected. About 78% of the unexpected ones were confirmed or suspected hardware: GPU or host failures, silent data corruption, unplanned host maintenance. Which rows of Table 5 make up that 78% is not stated: GPU, host and unplanned maintenance alone give 76.6% of the 419, adding the network switches and cables gives 85.0%, so the grouping is unconfirmed; GPUs alone, 268 of 419 (64.0%), are the largest single source. Automated maintenance alone caused at least one interruption a day. Yet the job kept "higher than 90% effective training time" (useful training time over elapsed time), and only three incidents needed significant manual intervention (§3.3.4).
54 days × 24 hours / 419 = 3.1 hours between unexpected stops, or 2.8 hours counting the 47 planned ones. At that rate, losing even 20 minutes per stop (restart plus the work since the last checkpoint) would cost about 11% of the run, already past the 10% the paper's ">90%" allows. That is why checkpoint frequency, job start-up time and automated diagnosis dominate this section; recovery designs and the checkpoint interval are on Fault tolerance at scale. The 16K-GPU tab replays the 54 days with adjustable checkpointing and restart times.
The tooling that kept effective time above 90%:
Two physical effects: throughput varied 1% to 2% with the time of day, because midday heat changes the GPUs' dynamic voltage and frequency scaling; and tens of thousands of GPUs idling or resuming together (waiting on a checkpoint or a collective, or the job starting or stopping) swing the data centre's power draw by tens of megawatts, "stretching the limits of the power grid" (Power, cooling and reliability owns power swings and fleet failure rates).
Bars are the counts printed in Table 5. The counts add up to 419 but the percentages to 94.9%: the "Faulty GPU" row prints 148 interruptions and 30.1%, and 148 of 419 is 35.3%, so by count GPUs caused 268 of 419 unexpected stops, 64.0%, not the text's "58.7%" (the tables tab checks every row).
Three stages; the 8B and 70B used similar recipes (§3.4):
Steps come from dividing each phase's tokens by its batch (taking M as 220, which makes Table 4's 16M exactly 224): 60, then 342,101, then 758,767, about 1.10 million steps for 15.6T tokens, so the cosine's 1.2 million-step horizon is slightly longer than the run and the learning rate never reaches 8 × 10−7 before annealing takes over (derived; the paper gives no step count for the end of the run, nor how the long-context and annealing tokens sit inside the 15.6T). The model card puts the 405B at 30.84M H100 hours: 3.8 × 1025 FLOPs over that time is TFLOP/s per GPU, of peak; restarts, checkpoints, the long-context stage and any work not in the final run all count (model card; MFU accounting is on Performance math). On 16,384 GPUs those hours are days.
Drawn from the numbers above; the shaded band is the last 800B tokens of long-context training, and the final 40M tokens of annealing are too short to see on this scale. Over the whole run the 405B averaged of peak, below Table 4's 38% to 43%, because restarts, checkpoints and the long-context stage all count.
Each round trains on top of the pre-trained checkpoint (§4.1). Fig. 2 runs one prompt through a round, and through the PPO-based pipeline Llama 3 moved away from; the difference is where generation happens and how many networks are held while the weights change.
Fig. 2, step by step: one prompt, one round
The Llama 3 steps follow §4.1 and §4.2; the PPO steps follow InstructGPT (Llama 2 combined rejection sampling with PPO in later rounds; Llama 2, §3.2.3). Counters are per prompt and illustrative of structure, not measured costs: "networks held" counts the networks resident while weights change. How a reward model learns from a ranking, and one PPO step model by model, are drawn on Alignment (sections 3 and 4).
A new multi-message chat format with header and termination tokens marks each message's source and destination (user, ipython) so one assistant turn can contain several messages, such as a tool call and the answer after it (§4.1.1).
DPO's loss for one pair is −log σ(β[(log π(yw) − log πref(yw)) − (log π(yl) − log πref(yl))]); every token of the chosen response yw gets pushed up and every token of the rejected yl pushed down, with the same weight β(1 − σ). A termination token sits at the end of both, after different text, so it is pushed up in one context and down in the other: the paper's hypothesis for the "tail repetition or abruptly generating termination tokens" it saw (§4.1.4). Masking removes those tokens from both sums; the NLL term adds a plain likelihood pull on the chosen response. Try the per-pair numbers:
Log-ratio means log π(y) − log πref(y) summed over the response's tokens, in nats; β = 0.1 and the NLL coefficient 0.2 are the paper's. The NLL term here is per token of the chosen response (its scaling over length is not stated in the paper; illustrative). The formula is DPO's; inputs are yours.
The data (§4.2, Tables 6 and 7). Preference data and SFT data cover overlapping domains but are curated differently. Compared with Llama 2, prompts and responses got longer, and prompts got harder each round where the model lagged. The bars beside this section show both mixes, by examples and by tokens. Mostly model-generated, the SFT data is heavily cleaned:
Each capability got its own data machinery (§4.3); open any for the recipe.
The headline (Table 2). The instruction-tuned 405B scores MMLU 87.3 (5-shot) and 88.6 (0-shot with chain of thought), MMLU-Pro 73.3, IFEval 88.6, HumanEval 89.0, GSM8K 96.8, MATH 73.8, ARC Challenge 96.9, GPQA 51.1, MGSM 91.6, BFCL 88.5 and Nexus 58.7: level with GPT-4 (0125), and close to GPT-4o and Claude 3.5 Sonnet, behind them on GPQA (59.4 for Claude), MMLU-Pro and some coding. The 70B (MMLU 86.0 with CoT, HumanEval 80.5, GSM8K 95.1) and 8B lead their size classes against Gemma 2 9B, Mistral 7B, Mixtral 8x22B and GPT-3.5 Turbo on most rows. The tables tab adds 95% confidence intervals: many of the gaps at the top are smaller than the noise.
How the comparisons were made. For other models Meta reports "the best score across results that are publicly reported or (where possible) that we reproduced ourselves", choosing the reported number when its settings are comparable or more conservative (§5.1, §5.2). Pre-trained results carry 95% confidence intervals, CI = 1.96 √(S(1 − S)/N), which the paper notes are a lower bound on the real variation (§5.1.1). The pre-trained 405B "substantially outperforms prior open-source models" and is competitive with GPT-4 where comparable numbers exist (ARC-C 96.1 against 96.3, GSM8K 89.0 against 92.0; Table 12).
Robustness and contamination. Pre-trained models barely move under changes to multiple-choice labels, few-shot label patterns, answer order and prompt wording on MMLU, the 405B least (§5.1.2). Adversarial versions of SQuAD and GSM8K score well below the originals, while paraphrase detection (PAWS) does not suffer (§5.1.3). An 8-gram overlap analysis estimates contamination and its effect per benchmark: high for PiQA and HellaSwag (55% and 85% contaminated, about 8 and 15 points of estimated gain), while Natural Questions' 52% contamination seems to change nothing; for MBPP, HumanEval, MMLU and MMLU-Pro the method flags so much that no gain can be estimated (Table 15, rebuilt in the tables tab).
Other evaluations. Proficiency exams (LSAT, SAT, GMAT, GRE, AP): the 405B is "very similar" to Claude 3.5 Sonnet and GPT-4o (Table 17). Long context: perfect single-needle retrieval at all depths and lengths, near-perfect multi-needle, and the best InfiniteBench En.QA and En.MC scores among the models compared, though Meta's own 70B beats the 405B on En.QA, 36.7 against 30.5 (§5.2.6, Table 21). Tool use: best on Nexus, behind Claude 3.5 Sonnet on API-Bank by "only 0.6%" in the text (Table 22 prints 92.3 against 92.6, 0.3), and in human evaluations ahead of GPT-4o on code execution and plots but behind on file uploads (§5.2.7).
Human evaluations (§5.3). About 7,000 prompts over six single-turn capabilities (English, reasoning, coding, Hindi, Spanish, Portuguese) and three multi-turn ones, 10% easy, 30% medium, 60% hard, kept from the modelling teams. Annotators compare two responses on a 7-point scale; "better" or "much better" counts as a win. The paper's summary: on par with GPT-4 (0125), "mixed results" against GPT-4o and Claude 3.5 Sonnet, and "the best-performing openly available model".
Win and loss rates and their 95% intervals are read from the vector PDFs of Figure 17 in the arXiv source (bar ends match the printed labels to 0.05 points). Ties are the remainder, roughly half of all comparisons. "Separated" means the win and loss intervals do not overlap.
Inference (§6). In BF16 the 405B does not fit on one 8-GPU H100 server, so it runs on two: tensor parallel inside each, pipeline parallel across, with micro-batching improving the throughput-latency trade-off. FP8 (released) quantises most feed-forward weights and activations, about 50% of inference compute, but not self-attention or the first and last layers; it uses row-wise scaling, caps dynamic scale factors at 1200 because high-perplexity tokens such as dates otherwise cause underflows and corrupted answers, and was validated on the distribution of reward-model scores over 100,000 responses because benchmarks hid the damage. FP8 gains up to 50% pre-fill throughput.
Safety (§5.4). Internal benchmarks of over 4,000 prompts per capability or language measure violation rate against false refusal rate. Safety data is mostly human-written, with adversarial and borderline prompts; smaller models need a larger share of safety data. Verbatim memorisation of training data by the 405B averages 1.13% for 50-gram and 3.91% for 1,000-gram prompts. Llama Guard 3 is released as an input and output classifier. Uplift studies with volunteers found "insignificant uplift" for cyberattacks and "no significant uplift" for chemical and biological weapons planning over web access alone (§5.4.5), and long-context mitigations hold up to 256-shot jailbreaks. The competitor numbers are internal and anonymised, so not reproducible.
Images, video and speech (§7, §8). Composed onto the language model rather than trained jointly: an image encoder joined by cross-attention adapter layers trained on image-text pairs with the language model frozen, a video adapter on top, and a speech encoder (pre-trained on about 15M hours) with an adapter that emits token representations, plus a streaming text-to-speech system. The paper calls them competitive with the state of the art and "not yet being broadly released". Beyond the paper: two months later Meta released the vision models as Llama 3.2 11B and 90B, built the same way, with adapter weights of cross-attention layers (Llama 3.2 announcement, 25 September 2024).
It was the first open-weights model credibly at GPT-4 level, and the report is still among the most detailed public accounts of a frontier-scale run: the failure taxonomy of a 16K-GPU job, the MFU per configuration, the 4D layout, the batch and context schedules, the annealing recipe. The Meta lab page calls it "the field's most complete public account of how a frontier model is trained".
What holds up.
What to discount.
Verdict. Believe the engineering: the infrastructure numbers, the failure log, the recipe and the scaling-law method are internally consistent, reproducible from the paper's own figures, and unmatched in detail. Believe that the 405B was the first open model in GPT-4's class. Treat the head-to-head rankings against GPT-4o and Claude 3.5 Sonnet as approximate: the benchmark gaps are often inside the noise, comparisons mix self-run and reported numbers, and Meta's own human evaluation puts the 405B behind GPT-4o.
Meta sized the 405B and predicted its benchmark scores before training it (§3.2.1). The arXiv source ships Figures 2 to 4 as vector PDFs, so every marker's position can be read exactly, calibrated on the figures' own gridlines (the ten budgets come back as exactly 6 × 1018 … 1022, and the human-evaluation bars match their printed labels to 0.05 points). Everything below is refitted from those points by recompute.py, not copied from the paper's curves.
At each budget, models of different sizes trade parameters for tokens. Validation loss against training tokens is fitted with a second-degree polynomial in log tokens; the minimum is the compute-optimal model for that budget.
Dots: the paper's runs. Lines: this page's least-squares parabolas. Diamonds: the minima drawn in the paper. Defaults reproduce the paper's minima independently: across the ten budgets the refitted minimum lands within of the drawn one in tokens. Curvature (the parabola's coefficient on (log10 tokens)2) is shown so the "flatter at higher compute" claim can be checked.
Upper: tokens of the compute-optimal model against budget, log-log. Lower: each point's residual from the chosen law, in percent. Default reproduces the paper's "402B parameters on 16.55T tokens" independently, at 4.0 × 1025 FLOPs; at the stated 3.8 × 1025 it gives 16.1T and 393B. The text's rounded constants do not reproduce it (10.5T). Parameters use N = C / 6D.
Stage 1: the normalised NLL of the correct answer falls linearly in log compute (seven scaling-law models). Stage 2: accuracy is a sigmoid of that NLL, fitted with the Llama 2 models, which reach much lower NLL. The sigmoid's floor and ceiling decide most of the answer.
Diamonds: scaling-law models; circles: Llama 2 models; triangle: the paper's prediction; square: the 405B as drawn. The drawn sigmoid is recovered by fitting a four-parameter logistic to the plotted curve (it comes out with floor 0.250 and ceiling 1.000, so the paper fixed them at chance and 100%). The default (floor and ceiling fixed, slope and midpoint refitted on the 11 points) reproduces the drawn curve independently and predicts at 3.8 × 1025; the 405B scored 96.0% as drawn and 96.1 ± 1.1 in Table 12. Letting the ceiling float instead gives : the data alone never constrain the top of the curve, because the best Llama 2 model reaches 86.8%.
Sources: points from the arXiv v3 source files assets/isoflops.pdf, datacompute.pdf and scaling_laws_benchmark.pdf, read by this page's extract_figs.py; fits by recompute.py (least squares; logistic fits by Nelder-Mead). The forecast's power law is on tokens, as the paper's Equation 1 states.
Three simulations of §3.3, each computed from the paper's own numbers: where every GPU sits in the 4D mesh and the network, how the pipeline schedule trades idle time against memory, and what interruptions every three hours cost. Workloads and timings that the paper does not give are labelled illustrative.
GPUs are grouped in the order [TP, CP, PP, DP], innermost first, so a GPU's rank is tp + TP·(cp + CP·(pp + PP·dp)). Pick a configuration and a GPU: each strip is the whole job, with pod boundaries every 3,072 GPUs, and the ticks are the GPU's partners in that group.
Topology from §3.3.1: 8 GPUs per server on NVLink, 16 per rack, 3,072 per pod at full bisection bandwidth, pods joined at 1:7 oversubscription. Placing consecutive ranks in consecutive servers is this page's assumption; the paper says the scheduler and the layout are topology-aware but not how ranks are mapped. The three Table 4 meshes side by side are on the Meta lab page.
Counts are per GPU for the recounted 405.85B parameters. Assumed layout (the paper gives only its outline): BF16 weights of the GPU's TP × PP shard stay gathered through forward and backward (the paper's "do not reshard after forward"); FP32 gradients of that shard are accumulated over micro-batches before the FP32 reduce-scatter; FP32 master weights and AdamW's two moments (12 bytes per parameter) are sharded across DP. Activations, buffers and fragmentation take the rest of the 80 GB and are not modelled; the paper fits 8K-token sequences without activation checkpointing. Defaults: Table 4's first configurations (TP 8, PP 16, DP 128).
Four pipeline ranks hold eight stages (V = 2 per rank, interleaved), as in Figure 6. Each micro-batch goes forward through stages 0 to 7 and backward from 7 to 0; a forward takes 1 time unit and a backward 2. N is how many contiguous micro-batches each stage processes before switching: depth-first needs N = PP, breadth-first N = M; Llama 3 lets N float.
The schedule, step by step (all three modes)
A list scheduler executes each rank's operations strictly in order: warm-up forwards (2(PP − 1 − rank) + (V − 1)N, the Megatron interleaved rule with N in place of PP), then one forward and one backward alternately, then the remaining backwards. With no latency it reproduces the paper's bubble formula (PP − 1)/(V × M) exactly for every N ≥ PP (independently: the formula is not used by the simulation). Latency and unit times are illustrative; "in flight" counts micro-batch stages whose activations a rank holds between forward and backward. The table sweeps N at the current latency for M = 10; below N = PP this page's warm-up rule stalls or deadlocks, and the paper does not say how its implementation handles that case.
Interruptions arrive at the paper's rate, 466 in 54 days (419 unexpected, coloured by Table 5's root causes, and 47 planned). Each costs the restart time plus the work since the last checkpoint; each checkpoint pauses training briefly. The paper reports only the outcome, more than 90% effective training time; the times below are yours to set (the defaults are one setting that clears 90%).
Arrival times are a seeded Poisson process at 466/54 per day; causes are drawn in proportion to Table 5's counts. Expected effective time is 1 − λ(R + I/2) − s/I for rate λ, restart R, interval I and pause s (derived here: half an interval of work is lost on average), maximised at I* = √(2s/λ). The paper's three manual interventions in 54 days are why the automated mode is the realistic one; the +2 h mode shows what the same failure rate would cost without that automation. Times are illustrative.
It opens on the whole 54 days; the play button replays them a week at a time, and every setting redraws the outcome.
The tables that carry the argument, transcribed from the arXiv HTML by mk_tables.py with the printed precision kept, and every derived number recomputed by recompute.py. Where a number does not reproduce, the box says so. Table 2 and Figure 17 carry the verdict and stay open; the others are closed blocks.
Bold: the best in the size class as printed. Shaded: within the noise of the Llama model's score (the gap is smaller than √(h₁² + h₂²), the interval of a difference). Intervals: printed in Table 18 (code), Table 21 (long context) and Table 22 (tool use), otherwise computed with the paper's formula 1.96 √(S(1 − S)/N) from benchmark sizes (MMLU 14,042; MMLU-Pro 12,032; IFEval 541; GSM8K 1,319; MATH 5,000; ARC-C 1,172; GPQA 448 assumed; MGSM 2,750). Marks after a score: △ 5-shot without CoT, ⊲ without CoT, ♢ zero-shot. The formula reproduces the paper's printed intervals (ARC-C 96.1 ± 1.1, GSM8K 89.0 ± 1.7, MATH 53.8 ± 1.4 in Table 12; HumanEval 89.0 ± 4.8 in Table 18) to 0.01, which checks the benchmark sizes.
Read from the vector PDFs in the arXiv source; percent of comparisons won and lost, ties being the remainder, with the drawn 95% intervals. Separated: intervals do not overlap. The paper's text: "approximately on par with" GPT-4 (0125), "mixed results (some wins and some losses)" against GPT-4o and Claude 3.5 Sonnet.
Per layer: attention 2d2 + 2 × d × 8 × 128 (query and output full width; keys and values for 8 heads of 128), SwiGLU 3 × d × dff, two RMSNorm vectors; plus untied embedding and output matrices of 128,256 × d and a final norm. Reproduces 8B, 70B and 405B independently: 8.03B, 70.55B, 405.85B.
Shares recompute to 100% in both tables. The SFT tokens column is derived: share of examples × average tokens per example, renormalised. Table 7's printed average of 846.1 tokens per example recomputes as from the rows.
Contam. %: share of each evaluation set flagged, at the overlap threshold that showed the largest significant estimated gain. Gain: the score on the full set minus the score on the clean part, per model size. Dashes: the paper excludes results that were not significant or behaved erratically; for HumanEval, MBPP, MMLU and MMLU-Pro 8-gram overlap flagged too much to estimate a gain (§5.1.4).
N is implied by the printed interval, N = 1.962 S(1 − S)/h2 (derived; the paper does not give set sizes). QuALITY's intervals imply about 21 questions, so its 95.2 against 90.5 in Table 2 is one question in 21.
Every link opens in a new tab. Reading time of the resources below: 5h 50m.
technical report, the paper itself; the HTML version has the anchors this page links to. abstract page, PDF.
(2h 30m)
Meta's model repository: model cards, the Llama 3.1 Community License, the chat format and reference inference code (about 20 minutes for the README and entry path). The training code is not released.
(20 min)
Sebastian Raschka: puts the Llama 3.1 recipe side by side with Qwen 2, Gemma 2 and Apple's AFM; the clearest view of what was standard practice in mid-2024 and what was Meta's own.
(35 min)
Oxen.ai: a section-by-section walkthrough with the emphasis on data and the training pipeline.
(30 min)
Arize: a compact tour of pre-training, post-training and the key levers.
(20 min)
Rudrite: an animated walkthrough with exhibits computed from the paper's formulas.
(25 min)
Meta AI blog: the release announcement for the models this paper reports.
(15 min)
Meta: training GPU hours per model (30.84M for the 405B), emissions, the supported languages and the licence terms.
(15 min)
PyTorch: PyTorch's open training stack that trains Llama 3.1 8B, 70B and 405B with FSDP2, tensor, pipeline and context parallelism: the closest public stand-in for the training code Meta did not release.
(30 min)
2022: the compute-optimal framework Llama 3 extends; its IsoFLOPs method is the one used here, and the 8B and 70B are deliberately trained far past it.
2020: the ancestor of the scaling-law method; Llama 3 adds a second stage from loss to benchmark accuracy.
2023: the alignment loss Llama 3 scales up, with formatting tokens masked and an NLL term added.
2022: the PPO-based RLHF pipeline Llama 3 explicitly moves away from.
2023: used here to more than double rejection-sampling throughput.
2021: rotary position embeddings, with the base raised to 500,000 here for long context.
2019: the tensor parallelism that is the innermost of the four dimensions.
2019: the sharded data parallelism that FSDP implements, the outermost dimension.
2022: the attention kernel family that makes 128K-token training affordable.
December 2024: the counterpoint, mixture of experts, FP8 training and RL-heavy post-training, against Llama 3's dense-and-simple bet.
the lab page: Llama's architecture, lineage, licence, the overtraining argument and what came after Llama 3.
pre-training recipes, annealing, SFT, rejection sampling and DPO.
deduplication, quality classifiers and data mixes.
large training clusters, schedulers, failures and checkpointing.
the comparison of model families that Llama sits in.
H100s, NVLink, RoCE and InfiniBand fabrics.
This page is one row of the Papers database; its properties (Paper, Takeaway, Topics, Year) live there.