← Latest papers
🤖 machine learning

How to Allocate Your Tokens? Scaling Laws with Training Steps and Batch Size

This paper proposes a "three-term" scaling law that explicitly separates training data into steps and batch size, enabling the robust recovery of optimal batch size scaling and the derivation of laws for suboptimal settings using significantly fewer training runs.

Original authors: Fabian Schaipp

Published 2026-07-03
📖 5 min read🧠 Deep dive

Original authors: Fabian Schaipp

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to bake the perfect loaf of bread (which, in this paper, represents a powerful AI model). To get the best result, you have three main ingredients to juggle:

  1. The Size of the Oven (Model Size): How big and complex your machine is.
  2. The Amount of Dough (Training Data): How much information you feed it.
  3. The Baking Strategy (Steps vs. Batch Size): This is the tricky part. You can either bake many small batches of dough one by one (many steps, small batch), or fewer large batches at once (fewer steps, large batch).

For a long time, scientists had a great recipe for balancing the Oven and the Dough. They knew exactly how much of each to use to get the best bread. But they were vague about the Baking Strategy. They would just say, "Use a good-sized batch," without explaining exactly how the size of that batch changes the outcome or how to find the perfect size without baking thousands of loaves to test.

This paper proposes a new, more detailed recipe called the "Three-Term Law."

The New Recipe: Counting the Steps

The authors suggest that instead of just looking at the total amount of dough, we should look at how that dough is split into Steps (how many times we put dough in the oven) and Batch Size (how much dough goes in at once).

Think of it like this:

  • Old Way: "I have 100kg of flour. I'll bake a big model."
  • New Way: "I have 100kg of flour. I can bake 100 small batches of 1kg each, or 10 large batches of 10kg each. Which mix gives me the best bread?"

The new formula (the Three-Term Law) treats the Batch Size and the Number of Steps as separate ingredients that both affect the final taste (the model's performance).

Why is this a Big Deal?

1. It Saves Massive Amounts of Time (The "Sampling" Trick)
Usually, to find the perfect batch size, you have to bake a whole range of loaves: one with a tiny batch, one with a medium one, one with a huge one, and so on. This is incredibly expensive and slow (like needing a million GPU hours).

The authors found that their new formula is so smart that it can look at just two or three different batch sizes and accurately predict the perfect one.

  • Analogy: Imagine you want to find the perfect temperature for your oven. Instead of testing 100 different temperatures, you test just three. Because you understand the physics of heat (the formula), you can mathematically calculate the exact perfect temperature without ever turning the dial to the other 97 settings.
  • Result: This cuts the number of training runs needed by about 72%. You get the same answer with a fraction of the work.

2. It Handles "Imperfect" Batches
In the real world, you might not have the hardware to use the perfect batch size. Maybe your oven is too small, or you only have time for a medium batch.
The old recipes only told you what happens if you use the perfect settings. This new recipe tells you what happens if you use a suboptimal (imperfect) batch size. It can predict exactly how much "worse" your bread will taste if you are forced to use a smaller batch, helping you make the best decision given your limitations.

3. It Solves a Mystery About "Critical Batch Size"
Scientists have noticed a phenomenon called the "Critical Batch Size." It's like a speed limit. If you make your batches too huge, you stop getting faster results; you just waste energy.

  • Old Theories: Some old theories suggested that the best batch size should be tiny (size of 1), which contradicts what we see in real life.
  • This Paper's Finding: The new formula correctly shows that the "speed limit" (critical batch size) depends on how much data you have, but surprisingly, it doesn't change much based on how big your model is. It matches what we see in real experiments.

The Catch (Limitations)

The authors are honest about where their recipe isn't perfect yet:

  • It's a bit rough at the edges: While it predicts the best batch size very well, it's not perfect at predicting the exact taste if you use a batch size that is way too small or way too large.
  • It needs a bit of help: To get the most precise details about "imperfect" batches, they had to use a two-step process (a "two-stage fit"), which is a bit more complex than just plugging numbers into one equation.
  • It's specific to the current tools: The results are based on specific types of AI training (using an optimizer called AdamW). If you change the tools (like using a different optimizer), the recipe might need tweaking.

Summary

This paper gives us a better map for navigating the complex world of AI training. It tells us that how we split our data (steps vs. batch size) is just as important as how much data we have. Most importantly, it gives us a shortcut: we no longer need to test every single possibility to find the best strategy. We can test a few, use this new math, and confidently predict the winner, saving a tremendous amount of time and computing power.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →