22  Predicting the Kibble Budget

The Scaling Hypothesis and FLOPs

⏳ 2026 Edition: Last verified: 2026-02-24

Prerequisites: Chapter 1-21

Technical Keywords: The Scaling Hypothesis, Kaplan vs. Chinchilla Scaling Laws, FLOPs Estimation (The 6ND Rule), Data-Constrained Scaling, Compute-Optimal Training


🧭 Advanced Track Navigation Core Track completion is defined by Checkpoints 1-4. This chapter belongs to the Advanced Track. Safe to skim on first pass; not required for checkpoints.

Before you start training a massive AI, you have to answer the CEO’s most terrifying question: “How much is this going to cost?”

You can’t just plug in 10,000 GPUs, press train.py, and hope for the best. If you train the model for too long, you waste $20 million in electricity. If you don’t train it long enough, you get a dumb model.

We need to predict exactly how smart the kitten will get based on exactly how much “kibble” (Compute and Data) we feed it.


22.1 The Scaling Hypothesis: Bigger is Smarter

For decades, AI researchers tried to invent clever new algorithms to make AI smarter. But in 2020, OpenAI published a paper that changed everything: Scaling Laws (Kaplan et al., 2020).

They discovered that the Loss (disappointment) of a neural network predictably drops following a smooth mathematical curve based on only three variables: 1. N (Parameters): The number of parameters (weights and biases) in the model (Brain Size). 2. D (Data): The number of tokens/words it reads (Books Read). 3. C (Compute): The total math operations performed (Energy Spent).

Here, “tokens” are the exact tokenizer units from Chapter 10 (e.g., BPE/SentencePiece pieces), not raw words.

The Scaling Hypothesis emphasizes that scaling compute, data, and parameters has often delivered reliable gains. In practice, both scaling and algorithmic improvements matter.


22.2 Compute-Optimal Training: The Chinchilla Law

If you have a strict budget of $10 Million (a fixed amount of Compute), should you: A) Build a massive 100-billion parameter brain, but only afford to let it read 10 books? B) Build a tiny 1-billion parameter brain, and let it read 1,000 books?

In 2022, DeepMind published the Chinchilla Scaling Laws, which gave us a strong empirical heuristic for compute-optimal training (Hoffmann et al., 2022): A strong empirical guideline from that study’s regime is that compute-optimal training often occurs at roughly ~20 tokens of data for every 1 parameter (order-of-magnitude), though this ratio varies based on data quality, architecture, and training objectives.

If you build a 70-Billion parameter model (like Llama 3), a commonly cited compute-optimal target is on the order of 1.4 Trillion tokens of text. If you train on far less, the model may be under-trained for its size. If you train on far more, you can hit diminishing returns (though deliberate overtraining is now common for models meant to be run cheaply on edge devices).

Analogy

If you buy a massive, expensive scratching post (Parameters), but only give the kitten 5 minutes to play with it (Data), you wasted your money. The Chinchilla ratio ensures the size of the toy perfectly matches the kitten’s playtime.

Chart showing optimal relationship between model parameters and training tokens

The Chinchilla Kibble Budget — balancing model size with data.

22.3 The 6ND Rule: Counting the Math

How do we actually calculate the Compute (C) required? We count the FLOPs (Floating Point Operations—essentially, every time the GPU does an addition or multiplication).

During the Forward Pass (Chapter 8), passing 1 token through 1 parameter takes about 2 FLOPs (one multiply, one add). During Backpropagation, calculating the gradient and updating the weight takes about 4 FLOPs.

Total = 6 FLOPs per parameter, per token. (This is the widely accepted industry-standard approximation for mixed-precision training). This gives us the famous 6ND Rule for estimating training compute: C \approx 6 \times N \times D

(Where N is Parameters, and D is Tokens). If N = 100 \text{ Billion} and D = 2 \text{ Trillion}, C = 1.2 \times 10^{24} FLOPs. Divide that by an NVIDIA H100’s peak FLOP/s (and factor in real-world hardware utilization, often ~30–50% MFU), and you get a rough compute-time estimate—not exact wall-clock days—to give the CEO!


22.4 The Data Wall: Running Out of Books

We have a massive problem on the horizon. If we want to train GPT-6, and we make the brain 10 times bigger (N), this scaling heuristic suggests we often need roughly 10 times more data (D).

But we may already have fed frontier models a large fraction of readily accessible high-quality web and book text.

We are hitting the Data Wall. High-quality human text may become a bottleneck. To keep scaling, frontier labs are now using Synthetic Data—having older AIs write billions of new textbooks to train the younger AIs. A major warning from recent work is Model Collapse: repeated training on model-generated data can progressively degrade distributional fidelity and tail knowledge (Shumailov et al., 2023).

Rosetta Stone

Kitten World Math/Concept Formula / Rule
“The Size of the Brain” Parameters (N) e.g., 70,000,000,000 (70B)
“The Amount of Books” Tokens (D) e.g., 1,400,000,000,000 (1.4T)
“The Golden Ratio” Chinchilla-style heuristic D \approx 20 \times N (regime-dependent)
“The Total Kibble Cost” Training Compute (C) C \approx 6 N D FLOPs

22.5 The Small Model Renaissance: When Less Is More (2026)

For years we taught that bigger brains win. The Scaling Hypothesis and Chinchilla laws showed that more parameters (N) plus more data (D) equals better performance. But in 2025–2026 something surprising happened: the rise of hyper-efficient edge models.

Models like Qwen3.5 Small and DeepMind’s Gemma 4 proved that a tiny kitten can sometimes outsmart a giant lion.

  • Gemma 4’s 31B and 26B MoE variants routinely outscored previous 100B+ models on complex math (AIME) and coding benchmarks.
  • The entire series runs natively on laptops, with smaller 2B/4B variants running on smartphones.
  • Crucially, Gemma 4 utilized a permissive Apache 2.0 license, accelerating the open-source ecosystem.

How is this possible?

  1. Compute-Optimal Training & Distillation
    These models were trained much closer to (or well beyond) the Chinchilla ideal. They also inherited reasoning skills from massive frontier models through careful data distillation (having a 1T-parameter model generate synthetic logic datasets for the 8B model to learn from).

  2. Mixture of Experts (MoE) on the Edge
    Gemma 4 26B uses MoE routing to only activate ~4 Billion parameters during any single forward pass. It achieves the intelligence of a 26B model at the inference speed and power draw of a 4B model.

  3. KV Cache Compression (TurboQuant)
    To achieve massive 256K+ context windows on consumer hardware, researchers introduced techniques like TurboQuant, which aggressively quantizes the KV Cache (the saved “scents” from Chapter 12) down to 3 or 4 bits. This unblocks the memory bottleneck, allowing laptops to read entire codebases locally without crashing.

Pixel Analogy

A tiny, perfectly trained kitten with endless high-quality playtime and smart coaching can learn tricks faster than a massive, under-fed lion. Size is no longer everything; training quality and efficiency now matter more.

Luna’s Safety Note

Smaller models running on edge devices are safer in one way (no cloud dependency) but riskier in another: they can be fine-tuned or jailbroken locally with almost no resources. We must design safety into the model itself, not rely on server-side guardrails.

This “small model renaissance” is one of the biggest shifts in 2026. It means powerful AI no longer requires a data-center — just a laptop or even a phone.

22.6 Removing the Training Wheels

The Real Engineering

We discussed the kibble budget and Chinchilla laws. The Scaling Hypothesis demonstrates that cross-entropy loss scales predictably as a power-law with Compute, Data, and Parameters. The Chinchilla heuristic proves that many previous models were wildly over-parameterized and under-trained; to be compute-optimal, you generally need to scale tokens and parameters equally. The ‘6ND’ rule is the exact FLOP calculation for a forward-backward pass per token, dictating the multi-million dollar GPU budget required for the run.

22.7 Paws and Reflect: Chapter 22 Quiz

1. You have enough budget to do 6 \times 10^{22} FLOPs. Using the Chinchilla ratio (D=20N) and the 6ND rule (C=6ND), roughly how large of a model (N) can you train? Substitute D with 20N in the formula: C = 6 \times N \times (20N) = 120 N^2. So 120 N^2 = 6 \times 10^{22}. Solve for N: you get roughly a 22-Billion parameter model!
2. Why did the AI community stop trying to build 1-Trillion parameter models that were only trained on 300 Billion tokens? Because of the Chinchilla Scaling Laws. A 1-Trillion parameter model often needs on the order of 20 Trillion tokens to be near compute-optimal in that regime. Training it on 300B tokens can severely under-train such a large model.
3. True or False: If you double the compute budget, the model’s loss will drop to zero. False. Scaling laws are typically modeled with power-law behavior (not a logarithmic law). Doubling compute yields diminishing returns; linear loss reductions would require super-linear compute growth.

22.8 Chapter 22 Summary

You’ve learned the macro-economics of AI training:

  • Scaling Laws: AI performance predictably improves as you increase Compute, Data, and Parameters.
  • Compute-Optimal (Chinchilla): A strong empirical trend near ~20 tokens of data per parameter in one key regime, not a universal constant.
  • The 6ND Rule: The formula to calculate exactly how many FLOPs a training run will cost (6 \times \text{Params} \times \text{Tokens}).
  • The Data Wall: The impending crisis where we run out of high-quality human text, forcing a shift to synthetic data.

AI Safety Thread: Chapter 22

Emergent Capabilities: Scaling laws predict that the Loss often drops smoothly, but they do not fully specify which capabilities appear at each scale (Kaplan et al., 2020; Hoffmann et al., 2022). Some evaluations report sharp capability jumps, while other work argues many jumps are amplified by discontinuous evaluation metrics and look smoother under probabilistic metrics (Schaeffer et al., 2023). For safety planning, it is reasonable to treat sudden capability “turn-ons” as a plausible risk scenario, but not as a settled universal law across all tasks and metrics.


Next: Chapter 23: The Multi-Kitten Assembly Line: Distributed Training and ZeRO