Primary-Source Mathematical Foundation · arXiv:2203.15556

Hoffmann et al. (DeepMind, 2022) demonstrated that earlier frontier models such as GPT-3 (175B on 300B tokens) and Gopher (280B on 300B tokens) were severely undertrained. For a fixed training FLOP budget C ≈ 6·N·D, minimizing pretraining cross-entropy loss requires scaling model parameters N and training tokens D in equal proportion—empirically around D ≈ 20 × N tokens per parameter.

1. The Core Compute & Loss Equations

C_train ≈ 6 · N · D | L(N, D) = E + A / N^α + B / D^β (α ≈ 0.34, β ≈ 0.28)

Why 6·N·D FLOPs?

In a standard dense decoder-only Transformer (when sequence length is small relative to 12 × d_model), each token performs one multiply-accumulate (2 FLOPs) per parameter during the forward pass (2ND) and two matrix multiplies during backpropagation—gradients with respect to activations and weights (4ND)—summing to 6ND total FLOPs.

Note that activation checkpointing increases executed hardware operations to ~8ND, which is why hardware-level HFU is higher than model-level MFU.

Converting FLOPs to Real Wall-Clock Dollars

GPU-Hours = (6 · N · D) / (3600 · Peak_FLOPs_per_sec · MFU)

Wall-clock time equals GPU-Hours / Cluster_Chips. Notice that MFU (Model FLOPs Utilization) sits directly in the denominator: dropping from 45% MFU to 22.5% MFU doubles both calendar time and cloud cost.

2. Reference Chinchilla-Optimal vs. Llama-3 Overtrained Run Table (H100 SXM BF16, 40% MFU)

Computed deterministically using NVIDIA H100 SXM dense BF16 (989 TFLOPS → 395.6 effective TFLOPS at 40% MFU) at a $2.99/GPU-hr public neocloud reference rate.

Model & Regime Params (N) Tokens (D) D / N Ratio Total FLOPs (6ND) H100 BF16 GPU-hrs Est. Cost @ $2.99/hr
7B Chinchilla-Optimal 7B 140B 20× 5.88 × 10²¹ 4,129 hrs $12,346
8B Llama-3-Class Overtrained 8B 15.0T 1,875× 7.20 × 10²³ 505,627 hrs $1.51M
32B Chinchilla-Optimal 32B 640B 20× 1.23 × 10²³ 86,289 hrs $258,004
70B Chinchilla-Optimal 70B 1.40T 20× 5.88 × 10²³ 412,928 hrs $1.23M
70B Inference-Overtrained (15T) 70B 15.0T 214× 6.30 × 10²⁴ 4,424,230 hrs $13.23M
405B Frontier Scale (15T) 405B 15.0T 37× 3.65 × 10²⁵ 25,597,333 hrs $76.54M

3. Beyond Chinchilla: Inference-Aware Overtraining

Sardana & Frankle ("Beyond Chinchilla-Optimal", 2024) formalized why production AI labs intentionally train far past 20 tokens/parameter: total lifecycle compute is C_total = 6·N·D_train + 2·N·D_inference. Once a model is deployed to millions of users, inference demand quickly exceeds training tokens by orders of magnitude.

Training an 8B model on 15T tokens costs roughly the same upfront FLOPs as training a Chinchilla-optimal 70B model on 1.4T tokens—yet the resulting 8B model serves at roughly 8× lower inference cost per token on a single GPU.

Read full Chinchilla vs. Overtraining breakdown →

4. Top Four MFU Bottlenecks on Multi-Node Clusters

  • Interconnect Starvation: Running ZeRO-3 / FSDP all-gathers over slow 25–100 Gbps Ethernet instead of 3.2 Tbps InfiniBand, EFAv2, or TPU ICI can slash MFU from 42% to under 18%.
  • Sub-Optimal Parallelism Topology: Keep Tensor Parallelism (TP) strictly inside an 8-GPU NVLink/NVSwitch node; use FSDP / Data Parallelism and Pipeline Parallelism across nodes.
  • Host Data-Loader Stalls: Shuffling terabytes from slow network storage without async prefetching starves Hopper/Blackwell Tensor Cores every step.
  • Stragglers & Checkpointing Pauses: Synchronous checkpoint writes to slow storage halt all 256–2,048 GPUs simultaneously; use asynchronous RAM-buffered checkpointing.

Primary References & Interactive Tools

Frequently Asked Questions

What is the exact formula from Hoffmann et al. (2022) for compute-optimal LLM scaling?
Hoffmann et al. (arXiv:2203.15556) modeled pretraining loss as L(N, D) = E + A / N^α + B / D^β with empirical exponents α ≈ 0.34 and β ≈ 0.28, subject to compute budget C ≈ 6ND. Minimizing L(N, D) under fixed C yields roughly equal scaling of model size N and training tokens D (N_opt ∝ C^0.50, D_opt ∝ C^0.50), corresponding empirically to roughly 20 training tokens per parameter.
Does C ≈ 6ND account for attention quadratic FLOPs at very long context lengths?
The 6ND approximation dominates when sequence length S is much smaller than 12 × d_model (typical for 2K–8K pretraining). At ultra-long context lengths (32K–128K+), self-attention adds approximately 12 × n_layers × d_model × S FLOPs per token during forward+backward, increasing actual FLOPs above 6ND.
Why does adding more GPUs to a training cluster not reduce total GPU-hours?
At constant Model FLOPs Utilization (MFU), total chip-hours equals Total FLOPs ÷ (3600 × Effective FLOP/s per chip), which is independent of cluster size. Doubling GPUs cuts wall-clock calendar days in half—unless multi-node all-reduce communication lowers MFU, in which case scaling out actually increases total GPU-hours and cloud spend.
How does activation checkpointing affect MFU vs. Hardware FLOPs Utilization (HFU)?
Activation (gradient) checkpointing discards intermediate activations during the forward pass and recomputes them during the backward pass, increasing actual hardware operations from ~6ND to ~8ND (HFU ≈ 1.33 × MFU). Always measure and budget with MFU (using the 6ND numerator) so recomputation overhead is honestly captured in wall-clock cost.
How does Mixture-of-Experts (MoE) change the 6ND Chinchilla equation?
In a sparse Mixture-of-Experts Transformer, only active parameters N_active participate in each token’s forward and backward matrix multiplications, so compute per token scales roughly with 6 × N_active × D rather than 6 × N_total × D—though total memory footprint, all-to-all expert routing bandwidth, and load-balancing losses scale with N_total.
How many H100 SXM GPU-hours does a Chinchilla-optimal 7B, 32B, or 70B run require?
In BF16 at 40% MFU on H100 SXM (989 dense TFLOPS → 395.6 effective TFLOPS/chip): a 7B model on 140B tokens (5.88×10^21 FLOPs) takes ~4,129 GPU-hours; a 32B model on 640B tokens (1.23×10^23 FLOPs) takes ~86,289 GPU-hours; and a 70B model on 1.4T tokens (5.88×10^23 FLOPs) takes ~412,928 GPU-hours.