LeetLLM
My PlanLearnGlossaryTracksPracticeBlog
LeetLLM

Your go-to resource for mastering AI & LLM systems.

Product

  • Learn
  • Glossary
  • Tracks
  • Practice
  • Blog
  • RSS

Legal

  • Terms of Service
  • Privacy Policy

© 2026 LeetLLM. All rights reserved.

All Topics
Your Progress
0%

0 of 196 articles completed

🛠️Computing Foundations0/9
Git, Shell, Linux for AIDocker for Reproducible AIPython for AI EngineeringNumPy and Tensor ShapesCUDA for ML TrainingMPS & Metal for ML on MacData Structures for AISQL and Data ModelingAlgorithms for ML Engineers
📊Math & Statistics0/9
Gradients and BackpropVectors, Matrices & TensorsLinear Algebra for MLAdam, Momentum, SchedulersProbability for Machine LearningBayesian Inference from EvidenceStatistics and UncertaintyDistributions and SamplingHypothesis Tests, Intervals, and pass@k
📚Preparation & Prerequisites0/13
Neural Networks from ScratchCNNs from ScratchTraining & BackpropagationSoftmax, Cross-Entropy & OptimizationRNNs, LSTMs, GRUs, and Sequence ModelingAutoencoders and VAEsThe Transformer Architecture End-to-EndLanguage Modeling & Next TokensFrom GPT to Modern LLMsPrompt Engineering FundamentalsCalling LLM APIs in ProductionFirst AI App End-to-EndThe LLM Lifecycle
🧮ML Algorithms & Evaluation0/15
Linear Regression from ScratchLogistic Regression and MetricsDecision Trees, Forests, and BoostingReinforcement Learning BasicsValidation and LeakageStatistical Learning and GeneralizationConformal Prediction and UncertaintyClustering and PCAProbabilistic Generative ModelsCore Retrieval AlgorithmsDecoding AlgorithmsExperiment Design and A/B TestingCausal Inference and CounterfactualsPyTorch Training LoopsDataset Pipelines and Data Quality
📦Production ML Systems0/6
Feature Engineering for Production MLBatch and Streaming Feature PipelinesGradient Boosted Trees in ProductionRanking and Recommendation SystemsForecasting and Anomaly DetectionMonitoring Predictive Models
🧪Core LLM Foundations0/8
The Bitter Lesson & ComputeBPE, WordPiece, and SentencePieceStatic to Contextual EmbeddingsPerplexity & Model EvaluationFile Ingestion for AIChunking StrategiesLLM Benchmarks & LimitationsInstruction Tuning & Chat Templates
🧰Applied LLM Engineering0/25
Dimensionality Reduction for EmbeddingsCoT, ToT & Self-Consistency PromptingFunction Calling & Tool UseMCP & Tool Protocol StandardsContext EngineeringPrompt Injection DefenseResponsible AI GovernancePrivacy-Preserving Machine LearningData Labeling and Human FeedbackEvaluating AI AgentsProduction RAG PipelinesHybrid Search: Dense + SparseReranking and Cross-Encoders for RAGRAG Evaluation for Reliable AnswersLLM-as-a-Judge EvaluationBias & Fairness in LLMsHallucination Detection & MitigationLLM Observability & MonitoringExperiment Tracking with MLflow and W&BPrompt Optimization with DSPyModel Versioning & DeploymentSemantic Caching & Cost OptimizationLLM Cost Engineering & Token EconomicsModel Gateways, Routing, and FallbacksDesign an Automated Support Agent
🎓Portfolio Capstones0/9
Capstone: Delivery ETA PredictionCapstone: Product RankingCapstone: Demand ForecastingCapstone: Image Damage ClassifierCapstone: Production ML PipelineCapstone: Document QACapstone: Eval DashboardCapstone: Fine-Tuned ClassifierCapstone: Reproducible ML Study
🧠Transformer Deep Dives0/8
Sentence Embeddings & Contrastive LossEmbedding Similarity & QuantizationScaled Dot-Product AttentionVision Transformers and Image EncodersPositional Encoding: RoPE & ALiBiLayer Normalization: Pre-LN vs Post-LNMechanistic InterpretabilityDecoding Strategies: Greedy to Nucleus
🧬Advanced Training & Adaptation0/17
Scaling Laws & Compute-Optimal TrainingPre-training Data at ScaleBuild GPT from Scratch LabJAX for PyTorch ResearchersContinued Pretraining for Domain ShiftSynthetic Data PipelinesSupervised Fine-Tuning PipelineMixed Precision TrainingDistributed Training: FSDP & ZeROLoRA & Parameter-Efficient TuningTraining Run OperationsReward Modeling from Preference DataRLHF & DPO AlignmentConstitutional AI & Red TeamingRLVR & Verifiable RewardsKnowledge Distillation for LLMsModel Merging and Weight Interpolation
🤖Advanced Agents & Retrieval0/16
Vector DB Internals: HNSW & IVFAdvanced RAG: HyDE & Self-RAGGraphRAG & Knowledge GraphsRAG Security & Access ControlStructured Output GenerationReAct & Plan-and-ExecuteGuardrails & Safety FiltersCode Generation & SandboxingComputer-Use / GUI / Browser AgentsHuman-in-the-Loop Agent ArchitectureAI Coding Workflow with AgentsAgent Memory & PersistenceAgent Failure & RecoveryRecursive Language Models (RLM)Multi-Agent OrchestrationCapstone: Production Agent
⚡Inference & Production Scale0/31
Inference: TTFT, TPS & KV CacheMulti-Query & Grouped-Query AttentionKV Cache & PagedAttentionPrefix Caching and Prompt CachingFlashAttention & Memory EfficiencyContinuous Batching & SchedulingScaling LLM InferenceModel Parallelism for LLM InferenceAccelerator Architecture Field GuideCorrect GPU Profiling and BenchmarkingGPU Kernel Performance Engineering LabGPU Parallel Primitives LabGPU Compilers and Kernel LanguagesGEMM From Naive CUDA to Tensor CoresLow-Precision GPU ProgrammingGPU Runtime Execution LabAI-Generated Kernel EngineeringModel Quantization: GPTQ, AWQ & GGUFLocal LLM DeploymentSLM Specialization & Edge DeploymentSpeculative DecodingLong Context Window ManagementMixture of Experts ArchitectureMamba & State Space ModelsReasoning & Test-Time ComputeAdvanced MLOps & DevOps for AIGPU Serving & AutoscalingGPU Failure OperationsDistributed Inference Data PlaneServing Benchmark EngineeringA/B Testing for LLMs
🏗️System Design Capstones0/9
Content Moderation SystemCode Completion SystemMulti-Tenant LLM PlatformLLM-Powered Search EngineVision-Language Models & CLIPMultimodal LLM ArchitectureDiffusion Models: Images & TextReal-Time Voice AI AgentReasoning Agent System Design
🎤AI Lab Interviewing0/4
AI Lab Coding Interview: Python SystemsAI Lab System Design InterviewAI Lab Behavioral InterviewAI Lab Technical Presentation
🔬Project Deep Dives0/17
Deep Dive - vLLMDeep Dive - SkyRLDeep Dive - FlashAttentionDeep Dive - FlashInferDeep Dive - DeepGEMMDeep Dive - NCCLDeep Dive - MegatronDeep Dive - DeepSpeedDeep Dive - RayDeep Dive - MLflowDeep Dive - PyTorchDeep Dive - TransformersDeep Dive - SGLangDeep Dive - slimeDeep Dive - DeepEPDeep Dive - TinkerDeep Dive - Light-PEFT
Back to Topics
LearnAdvanced Training & AdaptationScaling Laws & Compute-Optimal Training
⚡HardFine-Tuning & Training

Scaling Laws & Compute-Optimal Training

Learn how Kaplan, Chinchilla, and inference-aware fits split a training budget across parameters and tokens, and when a smaller over-trained model wins on lifetime cost.

37 min read
Learning path
Step 103 of 196 in the full curriculum
Decoding Strategies: Greedy to NucleusPre-training Data at Scale

Personalize this lesson

Adapt explanations and teaching visuals to your background and preferred voice.

The last chapter asked how a trained model spends compute while emitting tokens: greedy, beam, or sampling. Before serving, someone has to make a different allocation: with a fixed training-FLOP budget, how many parameters and training tokens should the run use?

For a code assistant, choose between two runs. One candidate spends the budget on a huge model trained on a modest corpus of source code, issues, and documentation. Another uses a smaller model and feeds it far more data. Predict which one wins before seeing a curve: too little capacity leaves patterns unrepresented, while too little data leaves capacity underused. Either mistake can turn a large training bill into a weaker assistant.

Scaling laws turn that choice into an empirical forecast. In pre-training studies, the usual quality metric is cross-entropy loss, or how surprised the model is by the next token.

Kaplan et al. at OpenAI [1]Reference 1Scaling Laws for Neural Language Modelshttps://arxiv.org/abs/2001.08361 measured influential transformer curves. Hoffmann et al. at DeepMind later found a more balanced split of model size and data for compute-optimal dense training, often called Chinchilla scaling.[2]Reference 2Training Compute-Optimal Large Language Models.https://arxiv.org/abs/2203.15556

Neither fit travels unchanged across objectives, data, architectures, or measurement choices.

Three symbols keep the budget legible:

  • Parameters (NNN) are learnable weights. They give a model room to store and compose patterns. Papers count NNN differently, so check whether embeddings and the final unembedding head are included before comparing ratios.
  • Training tokens (DDD) are the subword pieces shown during training. They are opportunities to update those weights, not a direct measure of unique knowledge.
  • Compute (CCC) is training work measured in floating-point operations (FLOPs). For a dense transformer, a first planning estimate is C≈6NDC \approx 6NDC≈6ND: about 2N2N2N FLOPs per token for a forward pass and 4N4N4N for backpropagation. Kaplan used this accounting, while later work counted layer and output costs more carefully.[1]Reference 1Scaling Laws for Neural Language Modelshttps://arxiv.org/abs/2001.08361[2]Reference 2Training Compute-Optimal Large Language Models.https://arxiv.org/abs/2203.15556 Use it for sizing, then profile the actual architecture.

Check units before trusting any ratio. A 1B-parameter dense model trained on 20B tokens gives approximately 6 × 10^9 × 20 × 10^9 = 1.2 × 10^20 training FLOPs. Doubling both quantities makes that estimate four times larger, even though each one only doubled.

Double parameters, double data, or both

Start with four runs on the same held-out set. A 1-billion-parameter model sees 10 billion tokens, then three follow-up runs change one resource at a time or both together. Before reading the losses, predict which single-axis change will help more, and whether changing both can beat either change alone.

ExperimentParametersTokensWhat changedApproximate loss
Baseline1B10BNothing2.80
Double model size2B10B2x parameters2.60
Double data1B20B2x tokens2.55
Double both2B20B2x each2.35

These rows are a synthetic fixture, not a measurement or the later fitting law. They make the bottlenecks visible: either resource helps, but both together lower loss more than either single change. The gains still taper. A 10x increase in parameters doesn't cut loss by 10x; it multiplies the relevant loss term by a smaller, repeatable factor.

That repeatable factor is the useful part of a power law. On a log-log plot, an idealized power-law term becomes a straight line, so a handful of measured runs can estimate how loss changes with parameters, data, or compute. The forecast answers a planning question such as, "If compute grows 10x, what scale should we try?" It doesn't replace a target-scale run, and later we add a loss floor and let parameters and data interact.

Two exact charts for the synthetic compute law L of C equals 2 plus C to the negative 0.05. Across equal 3.16-fold compute steps from 1 to 100, loss falls from 3.000 to 2.794 while each absolute drop shrinks from 0.056 to 0.047.
For the displayed law, every 3.16x compute step multiplies the power-law term by the same factor, but the absolute loss reduction shrinks from 0.056 to 0.047. One hundred times more compute reduces the scaling term by about 20.6%, not by 100x.

Use the fitted parameter exponent to inspect those diminishing returns. This script changes only the parameter-limited term, so its percentages stop short of total loss.

power-law-diminishing-returns.py
1alpha_n = 0.076 2 3for parameter_multiplier in [2, 10, 100]: 4 scaled_term = parameter_multiplier ** (-alpha_n) 5 reduction = 1 - scaled_term 6 print( 7 f"{parameter_multiplier:>3}x parameters -> " 8 f"{scaled_term:.3f}x parameter-limited loss term " 9 f"({reduction:.1%} reduction)" 10 )
Output
12x parameters -> 0.949x parameter-limited loss term (5.1% reduction) 2 10x parameters -> 0.839x parameter-limited loss term (16.1% reduction) 3100x parameters -> 0.705x parameter-limited loss term (29.5% reduction)

Your team can either double parameters from 1B to 2B while keeping data at 10B tokens, or keep 1B parameters and double data to 20B tokens. Which option gives lower loss in the table?

Answer

Doubling data gives lower loss in this synthetic table: 2.55 instead of 2.60. Data doesn't always win; parameters and tokens are separate bottlenecks, and scaling studies tell you which one is binding for a budget.

Kaplan scaling laws (2020)

The synthetic runs show why one resource can't stand in for the other. Kaplan's 2020 study [1]Reference 1Scaling Laws for Neural Language Modelshttps://arxiv.org/abs/2001.08361 measured each bottleneck separately for transformer language models. Read the three fits as conditional statements: hold the other resources far enough away, then ask how loss LLL changes.

The three power laws

1. Scaling with parameters (model size NNN)

Suppose data is plentiful and the model is the limiting resource. If you double NNN, should the parameter-limited part of loss fall by half, stay fixed, or move by a smaller factor? The fitted curve answers that question:

L(N)∝N−αNL(N) \propto N^{-\alpha_N}L(N)∝N−αN​

Here the parameter-limited term shrinks by a fixed multiplier when NNN is multiplied. With αN≈0.076\alpha_N \approx 0.076αN​≈0.076, multiplying parameters by 10 reduces that term by about 16%, not total loss by 16%. Total loss can still be held up by a data term or a floor, which is why this single-variable fit isn't a complete training plan.

2. Scaling with data (dataset size DDD in tokens)

Now reverse the bottleneck. If the model is already large enough, should another 10x tokens reduce the data-limited term by 10x or by a smaller factor?

L(D)∝D−αDL(D) \propto D^{-\alpha_D}L(D)∝D−αD​

Hold model size large enough that data is the bottleneck. More training tokens then lower loss along a predictable curve with αD≈0.095\alpha_D \approx 0.095αD​≈0.095. The exponent describes the slope of this regime, not a promise that any new token source has the same value.

3. Scaling with compute-optimal training compute (Cmin⁡C_{\min}Cmin​)

Finally, allocate both resources together. If compute is spent efficiently, how should the best achievable loss change as the budget grows?

L(Cmin⁡)∝Cmin⁡−αCL(C_{\min}) \propto C_{\min}^{-\alpha_C}L(Cmin​)∝Cmin−αC​​

This third curve uses Cmin⁡C_{\min}Cmin​, the estimated minimum compute needed to reach a loss when compute is allocated efficiently. It isn't the curve for an arbitrary run with a poor model/data split. Kaplan's fitted exponent is αC≈0.050\alpha_C \approx 0.050αC​≈0.050 under the dense-transformer accounting. Actual work also includes attention kernels, optimizer overhead, activation recomputation, sequence length, and architecture choices such as MoE sparsity.

The three slopes don't tell you to compare αN\alpha_NαN​ and αD\alpha_DαD​ and pick the larger one. They describe different controlled regimes. To choose NNN and DDD together, put them on one fixed-compute frontier. Kaplan's frontier favored much larger models and relatively little data.

Kaplan's compute-optimal frontier favored larger models

Under Kaplan's fitted regime, extra compute went mostly into model size, with a smaller share going to new data. That recommendation came from the joint frontier, where a relative increase in parameters moved the best achievable loss more than the same relative increase in data.

GPT-3 made that strategy visible: 175B trainable parameters and 300B training tokens, or about 1.7 tokens per parameter.[3]Reference 3Language Models are Few-Shot Learners.https://arxiv.org/abs/2005.14165 The ratio describes what GPT-3 used; it doesn't prove that the ratio was optimal for another corpus or objective.

The compute-optimal frontier

Now hold total compute fixed and move along the choices that spend it efficiently. Kaplan reported:

Nopt∝C0.73,Dopt∝C0.27N_{\text{opt}} \propto C^{0.73}, \quad D_{\text{opt}} \propto C^{0.27}Nopt​∝C0.73,Dopt​∝C0.27

The question to test is simple: with 10x more compute, does the fitted plan grow NNN and DDD at the same rate? The answer is no. These exponents come from loss as a function of model size and training steps, not from comparing αN\alpha_NαN​ and αD\alpha_DαD​ as standalone power laws. Kaplan also fit a joint early-stopped loss surface:

L(N,D)=[(NcN)αN/αD+DcD]αDL(N, D) = \left[\left(\frac{N_c}{N}\right)^{\alpha_N / \alpha_D} + \frac{D_c}{D}\right]^{\alpha_D}L(N,D)=[(NNc​​)αN​/αD​+DDc​​]αD​

That L(N,D)L(N,D)L(N,D) form describes overfitting when data is scarce. It isn't the derivation of the 0.730.730.73/0.270.270.27 allocation. In that frontier, 10x more compute means about 5.4x more parameters but only 1.9x more tokens. Chinchilla later re-fit the allocation and found a much more balanced 0.500.500.50/0.500.500.50 result.

The small script turns those exponents into multipliers. It evaluates the fitted arithmetic only, so its output isn't a hardware benchmark or a claim about wall-clock speed.

allocation-exponents.py
1frontiers = { 2 "Kaplan": (0.73, 0.27), 3 "Chinchilla": (0.50, 0.50), 4} 5 6for compute_multiplier in [10, 100]: 7 print(f"{compute_multiplier}x training compute") 8 for name, (parameter_exp, token_exp) in frontiers.items(): 9 parameters = compute_multiplier ** parameter_exp 10 tokens = compute_multiplier ** token_exp 11 print(f" {name:<10} N={parameters:5.2f}x, D={tokens:5.2f}x")
Output
110x training compute 2 Kaplan N= 5.37x, D= 1.86x 3 Chinchilla N= 3.16x, D= 3.16x 4100x training compute 5 Kaplan N=28.84x, D= 3.47x 6 Chinchilla N=10.00x, D=10.00x
Log-log plot of a 100-fold dense-training compute increase. The curve N times D equals 100 holds training FLOPs fixed. Kaplan sits at 28.84-fold parameters and 3.47-fold tokens. Chinchilla sits at 10-fold parameters and 10-fold tokens.
At 100x dense training compute, every point on the curve spends the same FLOPs. Kaplan's fitted split sits high and left (much larger $N$, modest $D$). Chinchilla's equal-split point sits on $N=D=10\times$. The next sections explain why those two points exist, then add a lifetime-cost objective that can move the preferred point again.

Why did Kaplan-era scaling produce parameter-heavy models?

Answer

Kaplan's fitted compute-optimal frontier said that, for a fixed training compute budget, loss improved most by growing parameters much faster than tokens. That didn't come from comparing the single-variable exponents αN\alpha_NαN​ and αD\alpha_DαD​ directly. It came from Kaplan's compute-efficient fits of loss versus model size and training steps, reported as Nopt∝C0.73N_{\rm opt}\propto C^{0.73}Nopt​∝C0.73 and Dopt∝C0.27D_{\rm opt}\propto C^{0.27}Dopt​∝C0.27.

Use the dense 6ND6ND6ND proxy to compare two published parameter-token configurations. The values expose the accounting; rounded counts and architecture-aware FLOPs still differ.

the-compute-optimal-frontier.py
1def dense_training_flops(parameters, tokens): 2 return 6 * parameters * tokens 3 4gpt3_style = dense_training_flops(175e9, 300e9) 5small_data_rich = dense_training_flops(70e9, 1.4e12) 6 7print(f"GPT-3-style training FLOPs: {gpt3_style:.2e}") 8print(f"70B / 1.4T-token training FLOPs: {small_data_rich:.2e}")
Output
1GPT-3-style training FLOPs: 3.15e+23 270B / 1.4T-token training FLOPs: 5.88e+23

The Chinchilla reallocation (2022)

Kaplan's frontier made a sharp prediction: with one fixed compute budget, a large model trained briefly should beat a smaller model trained longer. Chinchilla asked whether that prediction survived when data and model size were varied together. Before reading the result, choose the likely winner for a code assistant whose corpus still contains useful, unseen examples.

Hoffmann et al. at DeepMind [2]Reference 2Training Compute-Optimal Large Language Models.https://arxiv.org/abs/2203.15556 trained over 400 models, from 70M to more than 16B parameters and from 5B to 500B tokens. Across three fitting approaches, they found that Kaplan's allocation had undervalued data.

Their predicted 70B Chinchilla run used the same reported training compute as 280B Gopher while seeing four times as many tokens.

The disagreement wasn't evidence for two incompatible kinds of transformer. Porian et al. [4]Reference 4Resolving Discrepancies in Compute-Optimal Scaling of Language Modelshttps://arxiv.org/abs/2406.19146 reproduced Kaplan-style experiments and isolated three setup differences: Kaplan omitted the final decoding-layer computation, used a fixed warmup that was too long for small models, and didn't tune optimizer settings as scale changed.

After those corrections, their fitted frontier moved close to Chinchilla's. They also found that careful learning-rate decay wasn't the central explanation Hoffmann et al. had proposed. Compute accounting and fitting choices can move an exponent before any architecture changes.

Chinchilla-optimal training

Hoffmann et al. report three fitting approaches, not one magic exponent. Each route asks where loss is lowest while keeping training FLOPs fixed:

ApproachWhat they fitNopt∝CaN_{\rm opt}\propto C^{a}Nopt​∝CaDopt∝CbD_{\rm opt}\propto C^{b}Dopt​∝Cb
1. Envelope of training curvesLowest loss along interpolated runs0.500.500.500.500.500.50
2. IsoFLOP profilesValley of final loss at fixed FLOPs0.490.490.490.510.510.51
3. Parametric loss E+AN−α+BD−βE + A N^{-\alpha} + B D^{-\beta}E+AN−α+BD−βClosed-form frontier from that surface0.460.460.460.540.540.54

The ~20 tokens-per-parameter rule tracks Approaches 1 and 2, and it's the ratio used for the 70B Chinchilla run on 1.4T tokens. The 0.460.460.46 number belongs to Approach 3's parametric frontier, not to a separate 20:1 recipe. Keeping those outputs distinct prevents a fitting detail from turning into a false constant.

For planning, the common result is easier to remember: under this fixed training-compute objective, grow model size and data at roughly equal rates. Double compute, then start near 2×\sqrt{2}\times2​× the parameters and 2×\sqrt{2}\times2​× the tokens, before checking your own data and stack.

For Chinchilla-style compute-optimal training, how many tokens does a 70B dense model need?

Answer

Use approximately 20 tokens per parameter: 70B×20=1.4T70B \times 20 = 1.4T70B×20=1.4T tokens. This is a fitted rule of thumb for the dense-transformer setup Hoffmann et al. studied, not a universal constant.

Treat 20:1 as a candidate starting point, not a constant.[2]Reference 2Training Compute-Optimal Large Language Models.https://arxiv.org/abs/2203.15556 Proxy runs on your corpus tell you whether data or capacity is binding before you commit to a larger run.

The next function does that first-pass arithmetic. It takes a dense training-FLOP budget, substitutes D=20ND=20ND=20N into C≈6NDC\approx6NDC≈6ND, and returns a starting value for NNN and DDD.

compute-budget-to-chinchilla-size.py
1def chinchilla_style_size(training_flops, tokens_per_parameter=20): 2 parameters = (training_flops / (6 * tokens_per_parameter)) ** 0.5 3 tokens = tokens_per_parameter * parameters 4 return parameters, tokens 5 6parameters, tokens = chinchilla_style_size(1e24) 7print(f"Parameters at 1e24 FLOPs: {parameters / 1e9:.1f}B") 8print(f"Tokens at 20:1: {tokens / 1e12:.2f}T")
Output
1Parameters at 1e24 FLOPs: 91.3B 2Tokens at 20:1: 1.83T
Frontier chart comparing Kaplan and Chinchilla allocation from 1-fold to 100-fold compute. At 100-fold compute, Kaplan reaches 28.84-fold parameters and 3.47-fold tokens, while Chinchilla reaches 10-fold parameters and 10-fold tokens. A companion bar chart shows reported or fitted token-to-parameter ratios of 1.7 for GPT-3, 20 for Chinchilla, and 38.5 for Llama 3 405B.
At 100x compute, Kaplan's fitted frontier allocates 28.84x to parameters and 3.47x to tokens; Chinchilla allocates 10x to each. The ratio bars provide context only: released-model ratios don't reveal the objective that selected them.

Chinchilla vs. Gopher: a concrete example

The Gopher comparison makes the reallocation concrete. Both rows below use the paper's reported training budget, but they spend it in opposite ways:

ModelParametersTraining TokensRatio (D/N)Compute (FLOPs)
Gopher280B300B1.07:15.76 × 10²³
Chinchilla~70B1.4T20:15.76 × 10²³

The FLOP column is the matched budget reported by Hoffmann et al. It won't equal 6ND6ND6ND exactly when you multiply the rounded counts: 6ND6ND6ND is a planning approximation, while the paper uses architecture-aware accounting.[2]Reference 2Training Compute-Optimal Large Language Models.https://arxiv.org/abs/2203.15556

On the paper's reported downstream evaluations, Chinchilla beat Gopher despite using one quarter as many parameters and about 4.7x as many tokens. The source also reports lower inference cost and memory for the smaller model.[2]Reference 2Training Compute-Optimal Large Language Models.https://arxiv.org/abs/2203.15556 That comparison is bounded by its setup: the models were trained with the paper's TPUv3/TPUv4 and JAX/Haiku stack, and quality came from stated benchmark protocols. It isn't a measured serving-throughput or dollar comparison for your hardware.

Why was Chinchilla also a serving-cost breakthrough?

Answer

Chinchilla matched Gopher's reported training compute with a much smaller model trained on more tokens. It scored better on the reported evaluations, and its lower parameter count implies lower dense FLOPs per inference token under the same proxy. The paper's result isn't a promise about latency, utilization, or dollars on a different serving stack.

Later dense-model token ratios

Published model reports show token-to-parameter ratios, but a ratio alone can't tell you which objective selected it.

Meta reports 15.6T pre-training tokens for the Llama 3 flagship.[5]Reference 5The Llama 3 Herd of Models.https://arxiv.org/abs/2407.21783 For 405B, that's about 15.6T/405B≈38.515.6T / 405B \approx 38.515.6T/405B≈38.5 tokens per parameter, above Chinchilla's roughly 20:1 fit.

Meta's own IsoFLOP fit, using its data and a 3.8×10253.8 \times 10^{25}3.8×1025 FLOP budget, suggested a 402B model on 16.55T tokens. The 405B / 15.6T run landed close to that forecast.[5]Reference 5The Llama 3 Herd of Models.https://arxiv.org/abs/2407.21783 Those facts support a model-size choice under Meta's fitted training objective; they don't show that lifetime inference cost selected the flagship ratio.

The smaller Llama 3 models show overtraining more clearly. If each sees the same reported 15.6T-token corpus, 8B works out to about 1,9501{,}9501,950 tokens per parameter and 70B to about 223223223. Meta reports that its smaller models were trained much longer than compute-optimal and performed better than compute-optimal models at the same inference budget.[5]Reference 5The Llama 3 Herd of Models.https://arxiv.org/abs/2407.21783 Treat the ratios as published configurations, then ask whether extra training pays back under your demand forecast. Don't assume every size should sit at 20:1.

You want to train a 10B-parameter model at Chinchilla-style ratios. About how many tokens and FLOPs do you need?

Answer

Tokens: D≈20×10B=200BD \approx 20 \times 10B = 200BD≈20×10B=200B. Training compute: C≈6ND=6×1010×2×1011=1.2×1022C \approx 6ND = 6 \times 10^{10} \times 2 \times 10^{11} = 1.2 \times 10^{22}C≈6ND=6×1010×2×1011=1.2×1022 FLOPs. An estimate in that range captures the planning rule, not a measured cluster bill.

chinchilla-style-budget.py
1def chinchilla_tokens(parameters, tokens_per_parameter=20): 2 return parameters * tokens_per_parameter 3 4def dense_training_flops(parameters, tokens): 5 return 6 * parameters * tokens 6 7parameters = 10e9 8tokens = chinchilla_tokens(parameters) 9flops = dense_training_flops(parameters, tokens) 10 11print(f"Chinchilla-style tokens for 10B parameters: {tokens:.2e}") 12print(f"Dense training FLOPs: {flops:.2e}")
Output
1Chinchilla-style tokens for 10B parameters: 2.00e+11 2Dense training FLOPs: 1.20e+22

Beyond Chinchilla: inference-aware scaling

Chinchilla picks the lowest pre-training loss for a fixed training-compute budget. Deployment adds another bill. If two candidates reach the same quality bar, the smaller one requires fewer dense FLOPs per request under the same proxy, even if it consumed more training FLOPs before launch. Whether that saves money depends on serving stack and demand.

That changes the question from “How should one training budget be split?” to “Which model reaches this quality target at the lowest lifetime cost for this demand?” An inference-aware objective counts both the original training run and all future tokens processed while the model serves users.

The inference cost problem

A model that serves enough traffic can accumulate inference FLOPs that rival or exceed its original training run. Sardana et al. [6]Reference 6Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Lawshttps://arxiv.org/abs/2401.00448 extend a Chinchilla-style loss fit with that deployment demand.

Under their modeled demand of roughly 1B requests, the fitted objective favors smaller models trained longer. They also train 47 models, ranging from 150M to 6B parameters, at token-to-parameter ratios up to 10,000. Quality kept improving in that tested range, although the sweep wasn't complete for every size.[6]Reference 6Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Lawshttps://arxiv.org/abs/2401.00448

This is evidence about their architecture, data, and loss proxy, not a universal serving rule.

min⁡N,D  Ctrain(N,D)+Cinference(N,Tserved)subject to L(N,D)≤ℓ\min_{N, D} \; C_{\text{train}}(N, D) + C_{\text{inference}}(N, T_{\text{served}}) \quad \text{subject to } \quad L(N, D) \le \ellN,Dmin​Ctrain​(N,D)+Cinference​(N,Tserved​)subject to L(N,D)≤ℓ

Read the objective from left to right. Training costs scale with model size times data (6ND6ND6ND FLOPs). Inference costs scale with model size times all served tokens (2N⋅Tserved2N \cdot T_{\text{served}}2N⋅Tserved​) for a dense decoder-only model. Once TservedT_{\text{served}}Tserved​ is large enough, extra training for a smaller model can be repaid by cheaper requests. Here:

Ctrain≈6ND,Cinference≈2N⋅TservedC_{\text{train}} \approx 6ND, \quad C_{\text{inference}} \approx 2N \cdot T_{\text{served}}Ctrain​≈6ND,Cinference​≈2N⋅Tserved​

Here TservedT_{\text{served}}Tserved​ means total input plus output tokens across the model's deployment lifetime. This is a FLOP proxy. It doesn't specify an accelerator, software stack, batch or sequence distribution, precision, kernel baseline, or correctness test, so it can't establish wall-clock latency, throughput, utilization, or dollars. Those need measurements from the serving stack.

What question does inference-aware scaling ask that Chinchilla doesn't?

Answer

Chinchilla asks how to minimize pre-training loss under a fixed training-compute budget. Inference-aware scaling asks which model minimizes total lifetime cost at a target quality, including both training FLOPs and all future served-token FLOPs.

Concrete break-even example

Suppose two candidates can reach the same pre-training loss ℓ\ellℓ. Predict before calculating: which candidate should win at low demand, and which one should win after enough requests? The numbers below are an arithmetic illustration, not two measured models from Sardana et al. A real comparison first has to show that both candidates hit the quality target.

  • Model A (Chinchilla-style): 70B parameters trained on 1.4T tokens. Training cost ≈ 6×70B×1.4T≈5.88×10236 \times 70\text{B} \times 1.4\text{T} \approx 5.88 \times 10^{23}6×70B×1.4T≈5.88×1023 FLOPs. Inference cost per token ≈ 2×70B=1402 \times 70\text{B} = 1402×70B=140B FLOPs/token.
  • Model B (inference-aware, smaller + over-trained): 30B parameters trained on ~4T tokens (heavier over-training to match quality). Training cost ≈ 6×30B×4T≈7.2×10236 \times 30\text{B} \times 4\text{T} \approx 7.2 \times 10^{23}6×30B×4T≈7.2×1023 FLOPs (slightly higher upfront). Inference cost per token ≈ 2×30B=602 \times 30\text{B} = 602×30B=60B FLOPs/token, less than half of Model A.

The break-even point is where Model B's extra training work has been repaid by its cheaper requests. Under the equal-quality assumption, Model A is cheaper below about 1.65T served tokens; Model B wins above it. This fixture has no hardware, framework, precision, batching, kernel baseline, or correctness measurement, so it demonstrates the accounting trade-off rather than a deployment speedup or dollar saving.

Assumed equal-quality lifetime-FLOP comparison between a 70B model trained on 1.4 trillion tokens and a 30B model trained on 4 trillion tokens. Their cost lines cross at 1.65 trillion served tokens. At that point both total 8.19 times 10 to the 23 FLOPs: the 70B model splits into 5.88 training plus 2.31 inference, while the 30B model splits into 7.20 training plus 0.99 inference.
At the 1.65T-token break-even, both candidates total 8.19 × 10²³ FLOPs under the proxy. Their cost composition differs: the 70B model pays less to train and more to serve; the 30B model pays more to train and less to serve.

The script below computes the break-even point from the stated FLOP proxy. It measures arithmetic only, with neither model measurement nor equal-quality evidence.

concrete-break-even-example.py
1def train_flops(parameters, tokens): 2 return 6 * parameters * tokens 3 4def inference_flops(parameters, served_tokens): 5 return 2 * parameters * served_tokens 6 7model_a_train = train_flops(70e9, 1.4e12) 8model_b_train = train_flops(30e9, 4e12) 9extra_train = model_b_train - model_a_train 10savings_per_token = 2 * (70e9 - 30e9) 11break_even_tokens = extra_train / savings_per_token 12 13print(f"Model A training FLOPs: {model_a_train:.2e}") 14print(f"Model B training FLOPs: {model_b_train:.2e}") 15print(f"Break-even served tokens: {break_even_tokens:.2e}")
Output
1Model A training FLOPs: 5.88e+23 2Model B training FLOPs: 7.20e+23 3Break-even served tokens: 1.65e+12

The first script finds the crossing algebraically. Now test both sides of that crossing with the same proxy: at 1T served tokens, training cost still dominates; at 3T, repeated serving makes the smaller model cheaper.

lifetime-cost-above-and-below-break-even.py
1def total_flops(parameters, training_tokens, served_tokens): 2 return 6 * parameters * training_tokens + 2 * parameters * served_tokens 3 4models = { 5 "70B / 1.4T": (70e9, 1.4e12), 6 "30B / 4.0T": (30e9, 4.0e12), 7} 8 9for demand in [1e12, 3e12]: 10 costs = { 11 name: total_flops(parameters, tokens, demand) 12 for name, (parameters, tokens) in models.items() 13 } 14 cheaper = min(costs, key=costs.get) 15 print(f"{demand / 1e12:.0f}T served tokens -> cheaper candidate: {cheaper}")
Output
11T served tokens -> cheaper candidate: 70B / 1.4T 23T served tokens -> cheaper candidate: 30B / 4.0T

What the inference-aware objective predicts

The arithmetic example gives one crossover. Sardana et al.'s fitted objective generalizes the direction: as expected demand rises, the best point shifts toward fewer parameters and more pre-training tokens at a fixed modeled loss target. That's a prediction under an explicit loss model and demand estimate, not evidence that a particular released model used that objective.

For each candidate, state the quality target and the evidence you can actually measure:

Planning inputWhat to evaluate
Training loss is the objective and deployment demand is excludedUse a Chinchilla-style baseline fitted to your data and architecture.
Large forecasted lifetime demandBenchmark a smaller, longer-trained candidate against the quality target and lifetime serving cost.
Candidate ratios far outside fitted dataCollect proxy evidence in that regime instead of extrapolating the original fit without checks.

The exact optimum depends on the loss target, architecture, data distribution, inference forecast, and serving stack. Don't infer a training objective from a released model's token-to-parameter ratio alone.

Public-text supply as a planning constraint

More tokens help only while useful tokens are available. Chinchilla and inference-aware fits both assume a data supply that can grow with the planned run. Public human-generated text is finite, and the size of that stock is uncertain.

Villalobos et al. [7]Reference 7Will We Run Out of Data? Limits of LLM Scaling Based on Human-Generated Datahttps://arxiv.org/abs/2211.04325 estimate an effective public-human-text stock of roughly 4×10144\times 10^{14}4×1014 tokens after quality filtering and multi-epoch adjustments. Under their assumed dataset-growth trends, full utilization falls between 2026 and 2032, with a median projection of 2028.

Their assumed 5x over-training policy moves the intersection earlier. Those are scenario forecasts, not observations about the current stock, and the paper's estimate depends on how quality and repeated passes are counted.

Once the data regime changes, B/DβB/D^\betaB/Dβ is no longer a safe extrapolation. A team may filter and deduplicate harder, reuse data across controlled epochs, transfer from another domain, or add synthetic data. Each choice can add signal, but each also changes what the fitted DDD term means.

The next calculation compares one reported dataset with the projected stock. It measures dataset size only, not unique-text consumption or model quality.

projected-public-text-context.py
1effective_stock = 4e14 # Villalobos et al.: ~400T effective stock at utilization 2llama3_405b_tokens = 15.6e12 3chinchilla_style_tokens = 20 * 405e9 4 5print(f"Llama 3 405B reported tokens: {llama3_405b_tokens / 1e12:.1f}T") 6print(f"Chinchilla-style 405B tokens: {chinchilla_style_tokens / 1e12:.1f}T") 7print( 8 "Reported Llama 3 dataset / projected effective stock: " 9 f"{llama3_405b_tokens / effective_stock:.1%}" 10) 11print("Comparison is dataset size, not unique-text consumption.")
Output
1Llama 3 405B reported tokens: 15.6T 2Chinchilla-style 405B tokens: 8.1T 3Reported Llama 3 dataset / projected effective stock: 3.9% 4Comparison is dataset size, not unique-text consumption.

In the Villalobos et al. forecast, why does assumed over-training move full utilization earlier?

Answer

A longer-trained model uses a larger token budget per parameter than a Chinchilla-style baseline. Under a fixed effective-stock estimate and continued growth assumptions, larger dataset requirements intersect the projected stock earlier. This is a property of the scenario, not proof that an exhaustion date has occurred.

A new scaling axis: test-time compute

Training scale fixes the weights. Serving still gives you a per-query knob: how much work should the model spend before returning one answer?

A system can generate a longer trace, sample several candidates, or search with a verifier. Snell et al. [8]Reference 8Scaling LLM Test-Time Compute Optimally Can Be More Effective Than Scaling Model Parameters.https://arxiv.org/abs/2408.03314 study those revision and verifier-search strategies in a FLOP-matched evaluation on MATH.

When a smaller base model already solves some items, adaptively allocated test-time compute can beat a roughly 14x larger pretrained model on easier and intermediate items. Harder items favor more pre-training in their comparison. Read that finding as task- and method-specific quality evidence under a stated FLOP budget, not as latency or throughput on a production engine.

DeepSeek-R1 is a related post-training example, not a replacement for pre-training scale. R1-Zero uses reinforcement learning without supervised fine-tuning first; the final R1 pipeline adds cold-start data, supervised fine-tuning, and further RL stages.[9]Reference 9DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learninghttps://arxiv.org/abs/2501.12948 Post-training can change how many tokens a deployed model spends per query. It doesn't mean pre-training data or compute stopped mattering.

For sizing, this adds a second trade-off. At one quality target, you might choose a larger or longer-trained model that answers in one pass, or a smaller model that spends more compute on hard queries. More candidates and longer responses also multiply TservedT_{\text{served}}Tserved​, so they feed back into the lifetime-cost objective.

The small calculation below isolates generated-token cost for sampled candidates. It has no accelerator, batching, precision, kernel baseline, or verifier, so its output shows linear FLOP accounting rather than a production performance result. A real request also includes prompt tokens and any verifier work.

sampled-candidates-raise-generation-cost.py
1def generation_flops(parameters, output_tokens_per_candidate, candidates): 2 return 2 * parameters * output_tokens_per_candidate * candidates 3 4parameters = 8e9 5output_tokens_per_candidate = 512 6for candidates in [1, 4, 16]: 7 flops = generation_flops(parameters, output_tokens_per_candidate, candidates) 8 print(f"{candidates:>2} candidate(s): {flops:.2e} generation FLOPs per request")
Output
11 candidate(s): 8.19e+12 generation FLOPs per request 2 4 candidate(s): 3.28e+13 generation FLOPs per request 316 candidate(s): 1.31e+14 generation FLOPs per request

Why is test-time compute a separate scaling axis rather than just a larger fixed model?

Answer

Parameters and pre-training tokens are fixed once the model is trained. Test-time compute is chosen per query: the same deployed model can spend more generation or multiple sampled attempts on harder inputs. That creates an additional serving-cost trade-off, while the attainable quality gain still depends on the trained model and task.

When the shortcut breaks

Scaling laws become useful when you know what each shortcut leaves out. Five failure patterns are worth recognizing because each one points to a different experiment.

A ratio isn't a constant

Suppose a 1B model trained on 20B tokens performs poorly on a messy internal-code corpus. The tempting response is to memorize the ratio more firmly and scale the model, but 20:1 was fitted for a particular dense-transformer and general-web-text regime. Data quality, tokenizer design, optimizer settings, repetition, and architecture can move the useful ratio.

Start with 20:1 as a baseline, then run 100M to 1B proxy models on the actual corpus. Fit the trend you observe. That small experiment tells you whether data or capacity is binding before you scale either one by orders of magnitude.

FLOP estimates aren't cluster bills

If a spreadsheet gives two runs the same C≈6NDC \approx 6NDC≈6ND but the cluster bills differ, the estimate did its job as a first check and then reached its limit. The dense rule leaves out attention-kernel details, optimizer state, activation checkpointing, sequence length, utilization, distributed communication, data-pipeline stalls, and sparse routing.

Replace the proxy with measurements from your stack before committing budget: accelerator model and count, framework and kernel versions, token and sequence shapes, batch and concurrency, precision, exact baseline implementation, and a correctness check. Then report wall-clock throughput or dollars per token with those conditions attached. A bare “2x faster” is not evidence another team can reproduce.

Low loss isn't deployed capability

An excellent cross-entropy forecast can still lead to a coding assistant that hallucinates APIs, ignores instructions, or fails safety checks. The curve predicts next-token compression on a training distribution. It doesn't directly measure factuality, downstream tasks, instruction following, alignment, or reasoning.

Reserve budget for instruction tuning, evaluation, and alignment. Instruction tuning and RLHF [10]Reference 10Training Language Models to Follow Instructions with Human Feedback (InstructGPT).https://arxiv.org/abs/2203.02155 can change behaviors that the pre-training loss curve never observes. Keep those checks in the plan even when the loss forecast looks smooth.

Training-optimal isn't lifetime-optimal

A 70B Chinchilla-style model can be the right answer for a training-loss objective and the wrong answer for a heavily used service. Chinchilla spends less upfront compute than a longer-trained small model, while the small model spends fewer FLOPs on every request under the dense proxy.

Estimate served-token demand before choosing a size. Compare 6ND+2N⋅Tserved6ND + 2N \cdot T_{\text{served}}6ND+2N⋅Tserved​ across candidates that meet a measured quality target, then validate the crossover on the actual serving stack. The formula predicts a direction; it doesn't supply a latency, utilization, or dollar number by itself.

Extrapolation needs a middle rung

A clean line through 100M to 1B proxy runs can still miss badly at 100B. Outside the measured range, optimizer instability, numerical precision, data exhaustion, or distributed communication can introduce a new bottleneck.

Run at least one mid-scale validation before booking the full target. For a 100M to 1B proxy range and a 100B target, a 10B run is a useful check. Treat the extrapolation as a hypothesis, and refit when measured loss leaves its forecast band.

Scaling law breakdowns and limitations

The curve can be smooth while its assumptions change underneath. Scaling laws are empirical fits, not physical laws: architecture, data quality, tokenizer, and optimizer regime can all move the exponents. Carry the measured range and objective with every forecast.

Emergent abilities

Wei et al. [11]Reference 11Emergent Abilities of Large Language Models.https://arxiv.org/abs/2206.07682 highlighted tasks where measured performance stayed near zero and then jumped at larger scales, which looked like a phase transition. Schaeffer et al. [12]Reference 12Are Emergent Abilities of Large Language Models a Mirage?https://arxiv.org/abs/2304.15004 argued that many jumps came from the metric: replacing exact-match thresholds with continuous scores often made the same progress look smoother.

When a benchmark suddenly turns upward, inspect the scoring rule before inventing a new scaling law. Keep the thresholded task result if it matters to users, but pair it with a continuous metric that shows whether the underlying behavior changed gradually.

Task-specific ceilings

Downstream tasks introduce their own ceilings. When pre-training loss keeps falling but factuality, instruction-following, or safety metrics plateau, more pre-training alone isn't a fix. A coding assistant still needs data-quality checks, post-training, evaluation, and alignment after the pre-training budget is chosen. Instruction tuning and RLHF [10]Reference 10Training Language Models to Follow Instructions with Human Feedback (InstructGPT).https://arxiv.org/abs/2203.02155 belong in that later budget; they aren't a free byproduct of a lower L(N,D)L(N,D)L(N,D).

Why can a scaling study predict great loss but still produce a bad coding assistant?

Answer

Scaling laws predict pre-training loss, not factual accuracy, instruction following, domain reliability, or safety behavior. A coding assistant still needs data-quality checks, post-training, evaluation, and alignment work after the pre-training budget is chosen.

Architecture sensitivity

Before applying a dense fit to another architecture, ask what NNN means for both capacity and per-token work. That shortcut breaks for:

  • Mixture-of-Experts (MoE) (lesson): MoE models activate only some parameters for each input, separating total parameter count from per-token compute. A dense fit can't tell you how those two quantities should scale together.
  • State Space Models (SSMs): SSMs process sequences recurrently rather than with quadratic attention. Their exponents need independent measurements.
  • Hybrid architectures: A model combining attention with SSMs or another mechanism needs a fresh fit for its combined capacity and compute paths.

Dense-transformer curves remain useful context, but they can't choose the allocation for these systems. Measure total and active parameters, data, compute, and quality on the architecture you plan to train.

Why can't you blindly apply dense-transformer scaling laws to MoE models?

Answer

Dense scaling laws treat parameter count as the main size variable. MoE models split total parameters from active parameters per token. Total parameters affect memory and routing; active parameters affect compute. That means you need a separate empirical scaling fit.

From theory to practice: running a scaling study

At this point, the question is operational: how do you turn a curve into a safe decision? A scaling study uses small, controlled proxy runs to forecast a larger run before anyone commits its full budget. The forecast earns trust in stages. If a mid-scale check leaves the forecast band, stop and refit instead of spending through the mismatch.

Diagram showing 1. Proxy runs, 2. Fit L(N, D), 3. Extrapolate, and 4. Mid-scale in band?.
1. Proxy runs, 2. Fit L(N, D), 3. Extrapolate, and 4. Mid-scale in band?.

A complementary tool is µ-Transfer (Tensor Programs V) [13]Reference 13Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transferhttps://arxiv.org/abs/2203.03466. Under Maximal Update Parametrization (µP), many optimal hyperparameters stay stable as width changes, so a small proxy can tune settings for a larger target. Yang et al. test this on Transformer and ResNet experiments, transferring from 13M parameters to BERT-large and from 40M parameters to a 6.7B GPT-3 model while cutting tuning cost.

Those are results for the tested setups, not a reason to skip mid-scale validation. Hyperparameter transfer, the loss fit, the data mix, and the hardware stack can fail independently.

Fitting the parametric loss function

To see what a scaling study actually fits, use Chinchilla Approach 3 as a small worked surface:[2]Reference 2Training Compute-Optimal Large Language Models.https://arxiv.org/abs/2203.15556

If both model capacity and data are finite, which penalties should remain in the measured loss?

L(N,D)=E+ANα+BDβL(N, D) = E + \frac{A}{N^{\alpha}} + \frac{B}{D^{\beta}}L(N,D)=E+NαA​+DβB​

As NNN and DDD grow, the two penalties shrink and the fitted floor EEE is what remains in this measured regime. A/NαA/N^\alphaA/Nα is the penalty for finite parameters, and B/DβB/D^\betaB/Dβ is the penalty for finite training data. EEE is an extrapolated fit parameter, not a measurement of language's irreducible entropy.

Before fitting noisy runs, practice reading a known surface. The table below is synthetic and was generated from

L(N,D)=1.10+2.80N0.070+7.80D0.098L(N, D) = 1.10 + \frac{2.80}{N^{0.070}} + \frac{7.80}{D^{0.098}}L(N,D)=1.10+N0.0702.80​+D0.0987.80​

then rounded to three decimals. A real study would estimate all constants from noisy runs. Starting from a known law keeps this arithmetic inspectable.

Parameters (N)Tokens (D)Observed loss
100M1B2.895
100M5B2.745
100M20B2.634
500M1B2.813
500M5B2.663
500M20B2.552
1B5B2.631
1B20B2.520
1B100B2.408

Read across a row and down a column. More tokens lower loss when NNN stays fixed; more parameters lower loss when DDD stays fixed. The three-term formula captures both penalties at once, so a forecast must say which resource changed.

Scaling study visual pairing nine synthetic proxy-run measurements with the loss surface L equals 1.10 plus 2.80 over N to the 0.070 plus 7.80 over D to the 0.098. The heatmap evaluates that law across a wider grid and marks the 70 billion parameter, 1.4 trillion token cell as a 2.091 forecast.
The scatter plot shows the nine synthetic measurements. The heatmap evaluates the same law on a wider grid; the starred 70B / 1.4T cell is a 2.091 forecast, not a measurement, so a mid-scale validation check still matters.

Now test whether a fit can recover its own generating law. The script holds out the 1B / 100B run, searches a coarse grid for α\alphaα and β\betaβ using the other eight points, and forecasts 70B / 1.4T. EEE, AAA, and BBB stay fixed so the search fits on one screen. A real fit would estimate all five constants, report uncertainty, and still require a mid-scale check.

fit-exponents-and-forecast.py
1def scaling_loss(n, d, e, a, alpha, b, beta): 2 return e + a / (n ** alpha) + b / (d ** beta) 3 4E, A, B = 1.10, 2.80, 7.80 5experiments = [ 6 (1e8, 1e9, 2.895), 7 (1e8, 5e9, 2.745), 8 (1e8, 2e10, 2.634), 9 (5e8, 1e9, 2.813), 10 (5e8, 5e9, 2.663), 11 (5e8, 2e10, 2.552), 12 (1e9, 5e9, 2.631), 13 (1e9, 2e10, 2.520), 14 (1e9, 1e11, 2.408), 15] 16train, held = experiments[:-1], experiments[-1] 17 18def sum_squared_error(alpha, beta): 19 total = 0.0 20 for n, d, loss in train: 21 pred = scaling_loss(n, d, E, A, alpha, B, beta) 22 total += (pred - loss) ** 2 23 return total 24 25best_error = float("inf") 26best = (0.0, 0.0) 27for alpha_i in range(40, 121, 2): 28 for beta_i in range(40, 121, 2): 29 alpha = alpha_i / 1000 30 beta = beta_i / 1000 31 error = sum_squared_error(alpha, beta) 32 if error < best_error: 33 best_error = error 34 best = (alpha, beta) 35 36alpha_fit, beta_fit = best 37n_held, d_held, loss_held = held 38hold_pred = scaling_loss(n_held, d_held, E, A, alpha_fit, B, beta_fit) 39target = scaling_loss(70e9, 1.4e12, E, A, alpha_fit, B, beta_fit) 40 41print(f"Recovered alpha={alpha_fit:.3f}, beta={beta_fit:.3f}") 42print( 43 f"Hold-out 1B / 100B: pred={hold_pred:.3f}, " 44 f"observed={loss_held:.3f}, residual={hold_pred - loss_held:+.4f}" 45) 46print(f"Forecast 70B / 1.4T tokens: {target:.3f}")
Output
1Recovered alpha=0.070, beta=0.098 2Hold-out 1B / 100B: pred=2.408, observed=2.408, residual=+0.0002 3Forecast 70B / 1.4T tokens: 2.091

The hold-out residual is tiny because the table came from the same law. Real runs add noise and setup drift. Compare the 70B forecast with a mid-scale run using the planned tokenizer, data mix, sequence length, and training stack; stop or refit when measured loss leaves the forecast band. A smooth extrapolation still has to earn the budget.

You fit a loss surface on 100M to 1B proxy runs and forecast 2.091 at 70B / 1.4T. What should you do before booking that run?

Answer

Keep a hold-out residual, then run a mid-scale check on the real tokenizer, mix, and stack. If measured loss leaves the forecast band, refit. Don't treat the 70B number as measured.

Complete the lesson

Mastery Check

Answer every question, then check your score. Score 75% or higher to mark this lesson complete.

1.A 1B model trained on 10B tokens has loss 2.80. Doubling parameters gives 2.60, doubling tokens gives 2.55, and doubling both gives 2.35. What conclusion does this support?

Correct answer: Parameters and tokens are separate bottlenecks; increasing both can reduce loss more than changing either alone.

The table shows that model size and data volume each reduce loss, but neither is the only bottleneck. The larger gain from increasing both matches the lesson's power-law intuition: improvement is predictable and sublinear, not a linear payoff from one resource alone.

2.Kaplan's compute-optimal rule scaled parameters as N_opt proportional to C^0.73 and tokens as D_opt proportional to C^0.27. Why did this produce parameter-heavy training plans?

Correct answer: Those exponents came from compute-efficient fits of loss versus model size and training steps, so a 10x compute increase grew N about 5.4x and D about 1.9x.

Kaplan reported N_opt proportional to C^0.73 and D_opt proportional to C^0.27 from compute-efficient training (loss versus size and steps). The joint L(N, D) form describes early-stopped overfitting; it isn't the derivation of those allocation exponents. Comparing alpha_N and alpha_D as standalone power laws also doesn't produce the 0.73/0.27 split.

3.You have 10^24 training FLOPs and use a Chinchilla-style dense rule D approx 20N with C approx 6ND. What starting scale does this imply?

Correct answer: About 91B parameters and 1.8T tokens.

Substitute D = 20N into C approx 6ND to get C approx 120N^2. With C = 10^24, N is about sqrt(10^24 / 120), or 91B parameters, and D is about 20N, or 1.8T tokens.

4.A team uses the dense Chinchilla rule for a 1B model on a messy internal-code corpus, trains on 20B tokens, and gets worse loss than expected. Which response follows from the rule's limits?

Correct answer: Treat 20:1 as a baseline, then fit proxy runs on that corpus because optimal ratios shift with data and architecture.

The 20:1 ratio is a fitted result for a particular dense-transformer setup and data regime. Messier, cleaner, more repetitive, or more diverse data can shift the optimum, so the correct response is to run proxy experiments on the actual corpus instead of treating the ratio as a constant.

5.Dense-transformer rules such as C approx 6ND and Chinchilla-style token ratios assume parameter count is a proxy for both capacity and per-token compute. Why can't those rules be applied to a Mixture-of-Experts language model by plugging in its total parameter count?

Correct answer: MoE separates total parameters from active parameters per token, so compute and capacity need separate empirical scaling fits.

Dense scaling rules use parameter count as a rough proxy for both capacity and compute. Mixture-of-Experts models break that shortcut: total parameters affect capacity, memory, and routing, while active parameters more directly affect per-token compute. A separate empirical fit must track those quantities rather than substituting either count into every dense-model term.

6.Two equal-quality candidates are available. Model A is 70B parameters trained on 1.4T tokens; Model B is 30B parameters trained on 4T tokens. Using 6ND for training and 2N times served tokens for inference, which candidate is cheaper after 3T served tokens?

Correct answer: Model B, because its extra training cost is repaid above the roughly 1.65T served-token break-even.

Model A trains for about 5.88e23 FLOPs; Model B trains for about 7.20e23 FLOPs. Model B saves 2 x (70B - 30B) = 80B FLOPs per served token, so its extra 1.32e23 training FLOPs are recovered after about 1.65T served tokens. At 3T served tokens, Model B is cheaper under the equal-quality assumption.

7.An 8B dense model generates 512 output tokens per sampled candidate. Ignoring prompt and verifier work, what happens to generation FLOPs if you sample 16 candidates instead of 1?

Correct answer: They rise 16x, from about 8.2 x 10^12 to 1.3 x 10^14 FLOPs per request.

For the simplified generation proxy, FLOPs equal 2 x parameters x output tokens x candidates. Holding the model and output length fixed means sampling 16 candidates multiplies the generated-token cost by 16, making test-time compute a separate per-query scaling knob.

8.A scaling study predicts excellent pre-training cross-entropy, but a coding assistant built from the model hallucinates APIs and ignores instructions. Which planning mistake matches this failure?

Correct answer: The team confused lower pre-training loss with factuality and instruction following, so it under-budgeted post-training and evaluation.

Scaling laws forecast pre-training loss, which measures next-token prediction on the training distribution. They don't guarantee factual accuracy, instruction following, safety, or domain reliability, so production planning still needs post-training, evaluation, and alignment work.

9.Villalobos et al. estimate an effective public-human-text stock on the order of 4e14 tokens (about 400T) and project full utilization between 2026 and 2032 under stated growth assumptions. How should a team use that forecast when applying data-scaling laws?

Correct answer: Treat it as a scenario-dependent planning constraint, and seek new evidence if data quality, reuse, or source mix leaves the fitted regime.

The lesson presents the ~400T effective-stock figure and 2026-2032 utilization window as scenario-dependent forecasts, not proof of current exhaustion. The practical implication is that data-scaling extrapolations become less trustworthy when fresh high-quality text, reuse, filtering, domain transfer, or synthetic data changes the regime behind the original fit.

10.A team uses muP/mu-Transfer to tune learning rate and schedule on small proxy models, then fits a loss curve for a much larger dense run. What should it do before spending the full budget?

Correct answer: Use transfer to cut tuning cost, then run medium-scale validation because the fit, data mix, and hardware can still fail.

mu-Transfer can reduce tuning cost for selected hyperparameters in tested setups, but it doesn't prove that every setting or fitted loss curve will transfer. A medium-scale validation still checks separate failure modes: hyperparameter transferability, the loss fit, data mixture, and hardware behavior.

10 questions remaining.

Next Step
Continue to Pre-training Data at Scale

Scaling laws turn a FLOP budget into a token target such as 20 tokens per parameter. The next chapter is the pipeline that has to actually produce those tokens: extract, filter, deduplicate, mix, and pack them so the budget buys signal instead of duplicates and junk.

PreviousDecoding Strategies: Greedy to Nucleus
Share this article
XFacebookLinkedInBlueskyRedditHacker NewsEmail
References

Scaling Laws for Neural Language Models

Kaplan et al. · 2020

https://arxiv.org/abs/2001.08361

Training Compute-Optimal Large Language Models.

Hoffmann, J., et al. · 2022 · NeurIPS 2022

https://arxiv.org/abs/2203.15556

Language Models are Few-Shot Learners.

Brown, T., et al. · 2020 · NeurIPS 2020

https://arxiv.org/abs/2005.14165

Resolving Discrepancies in Compute-Optimal Scaling of Language Models

Porian, T., Wortsman, M., Jitsev, J., Schmidt, L., & Carmon, Y. · 2024

https://arxiv.org/abs/2406.19146

The Llama 3 Herd of Models.

Dubey, A., et al. · 2024 · arXiv preprint

https://arxiv.org/abs/2407.21783

Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Laws

Sardana & Frankle · 2024

https://arxiv.org/abs/2401.00448

Will We Run Out of Data? Limits of LLM Scaling Based on Human-Generated Data

Villalobos, P., et al. (Epoch AI) · 2022 · arXiv preprint

https://arxiv.org/abs/2211.04325

Scaling LLM Test-Time Compute Optimally Can Be More Effective Than Scaling Model Parameters.

Snell, C., et al. · 2024 · arXiv preprint

https://arxiv.org/abs/2408.03314

DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning

DeepSeek-AI · 2025

https://arxiv.org/abs/2501.12948

Training Language Models to Follow Instructions with Human Feedback (InstructGPT).

Ouyang, L., et al. · 2022 · NeurIPS 2022

https://arxiv.org/abs/2203.02155

Emergent Abilities of Large Language Models.

Wei, J., et al. · 2022 · TMLR

https://arxiv.org/abs/2206.07682

Are Emergent Abilities of Large Language Models a Mirage?

Schaeffer, R., et al. · 2023 · NeurIPS 2023

https://arxiv.org/abs/2304.15004

Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer

Yang, G., et al. · 2022 · NeurIPS 2022

https://arxiv.org/abs/2203.03466

Discussion

Questions and insights from fellow learners.

Discussion loads when you reach this section.