Vision & VLM Scaling Laws

Error falls as a power law in model size, data and compute, then flattens at a floor. For one fixed budget, the best split puts about 20 training tokens behind every parameter.

Pick a budget and drag the model size. A giant model starves for data; a small one runs out of room. Then we build, piece by piece, the power law, the floor, the FLOP count, the best split and an honest forecast.

You need what a logarithm does (it turns multiplying into adding) and a little Python. We build the rest from zero.

Built on Zhai et al., Scaling Vision Transformers (2021); Hoffmann et al., Chinchilla (2022); Cherti et al., Reproducible Scaling Laws for CLIP (2022); and Muennighoff et al., Scaling Data-Constrained Language Models (2023). Re-taught in our own words and devices.

Split one budget

158 B

The curve is a fitted law for language models: Besiroglu et al. (2024) re-fit Chinchilla's runs as loss = 1.82 + 482 / N0.348 + 2085 / D0.366. Vision has no public fit this clean, so treat the numbers as the shape, not as a ViT forecast. Data D = budget / (6 × N).

Chapter 0

Forecast a Run You Cannot Afford

Guess the error of a big model from three small ones, and see why plain axes hide the answer

Your team has money for one big training run. Before you spend it, you train three small image models: 1 million, 10 million and 100 million parameters. Their test errors are 0.41, 0.30 and 0.22. The big run would have 10 billion parameters. What error will it reach?

The big model is 100 times the size of the largest pilot. You get one shot. So the question is a forecast: from cheap points, predict an expensive one. Try it below before you read on.

Guess the big run

Pink dots are the pilots. The dashed line is the 10 B model. Set your guess, press Reveal, then switch the axes.

0.05

Illustrative pilots made from error = 0.41 × (N / 1 M)−0.133, the shape real vision runs show. Real pilots also carry noise; Chapter 8 adds it.

On plain axes the three pilots sit in a heap at the left edge. Any curve fits them. On log-log axes they fall on a straight line, and a ruler gives the answer: 0.12. That straight line is a scaling law: a rule that says how error falls as you add a resource.

The failure here is a guess by eye. The symptom is a big run that misses its forecast by a wide margin. To catch it, plot every pilot on log-log axes before you guess. If the points do not line up, you are not ready to forecast. The fix is more pilots, or a law with a floor (Chapter 2).

  1. Power laws: why the line is straight on log-log paper.
  2. The floor: why the ViT-G curve bends and stops.
  3. Counting compute: 6 × N × D, and patches per image.
  4. The best split: the hero's valley, solved.
  5. Data that counts: repeats and duplicates.
  6. Transfer: zero-shot and linear probes scale smoothly.
  7. Headroom: label noise and what money cannot buy.
  8. The lab: fit noisy pilots and forecast with error bars.
  9. Field guide: numbers, the decision table, code and links.
You have three cheap pilot runs and want to forecast a run 100× bigger. What should you do first?

Chapter 1

Power Laws: Straight Lines in Disguise

Turn a curve that flattens into a line, and read its slope as the price of accuracy

Why did the pilots line up? Because error follows a power law: a constant times the resource raised to a fixed power. Call the amount of the resource N (parameters here; images or compute work the same way). Call the test error E. Call a scale constant A, and call the speed of the fall α, the scaling exponent.

Say it aloud

E equals A times N to the minus alpha.

E
E the test error, a share from 0 to 1.
A
A the scale constant: the error a model of size 1 would have.
N
N the resource: parameters, images or FLOPs.
−α
to the minus alpha divide by N raised to alpha. Vision runs show alpha from about 0.1 to 0.4.
In plain words

Raise the resource N to the power alpha. Divide the constant A by it. Each time N grows 10×, the error E shrinks by the same factor, 10 to the minus alpha.

With numbers

With made-up numbers: at N = 1 M the error is 0.40; at N = 100 M it is 0.20. Error halved over two decades, so alpha = log(2) / 2 = 0.301 / 2 = 0.15.

Take the log of both sides. The log of a product is a sum, and the log of a power brings the power down in front:

log E = log A − α · log N

That is a straight line. Its height at the start is log A and its slope is minus alpha. So on log-log axes a power law is a ruler line, and you read alpha as the slope.

Turn the exponent

Left: plain axes, a curve that flattens. Right: the same law on log-log axes, a line. Drag alpha and watch the slope.

0.15

Illustrative law with A = 1. The plain panel shows N from 1 to 1,000; the log panel runs on to 108.

The failure is to fit the line on plain numbers. A straight-line fit to raw N and E gives nonsense, because the big runs dominate. Fit log E against log N instead. The code lab below does exactly that.

A log-log plot of error against parameters has slope −0.2. Parameters grow 1000× (three decades). By about what factor does the error shrink?

Chapter 2

The ViT-G Curve Bends at a Floor

Add a floor to the power law and find where more compute stops paying

In 2021 Zhai, Kolesnikov, Houlsby and Beyer trained Vision Transformers across a wide range of sizes, data and compute. A Vision Transformer (ViT) cuts an image into square patches and treats each patch like a word. Their largest, ViT-G/14, has 1,843 million parameters, trained on the 3-billion-image JFT-3B set, and reached 90.45% top-1 accuracy on ImageNet.

Their plot of error against compute was a line in the middle and flat at the top. A pure power law cannot flatten, so add a constant. Call the error E, the compute C, and the error no amount of compute removes E∞, the irreducible error or floor.

Say it aloud

E equals E-infinity plus A times C to the minus alpha.

E
E the test error.
E∞
E-infinity the floor: the error left with unlimited compute.
A
A the size of the part you can buy down.
C
C training compute, in any fixed unit.
−α
to the minus alpha how fast the buyable part shrinks.
In plain words

The error E has two parts. The power-law part A times C to the minus alpha shrinks as compute C grows. The floor E-infinity never moves.

With numbers

With made-up numbers E-infinity = 0.09, A = 0.5, alpha = 0.15: at C = 1 the error is 0.59; at C = 100 it is 0.341; at C = 10,000 it is 0.216.

Ride the curve to the floor

Purple is the law with a floor; the dashed purple line has no floor. Yellow is the floor. Slide compute and read the gain from the next 10×.

10^3

Illustrative law E = 0.09 + 0.5 × C−0.15, compute in relative units. The bend is the shape of Zhai et al.'s plots; the numbers are not theirs.

The gain from each 10× falls from 0.146 at the start to 0.037 at C = 10,000. Near the floor the curve gives almost nothing. The paper also found that big models are more sample efficient: a larger ViT reaches the same error after seeing fewer images.

The failure is to keep scaling in the flat part. The symptom: each new run costs 10× more and moves accuracy by a fraction of a point. Measure the gain per decade over your last three runs. If it keeps falling, you are near the floor; better labels or a new task pay more than compute.

A scaling curve on log-log axes is straight in the middle and flat at high compute. What makes it flat?

Chapter 3

Counting Compute: Patches, Tokens and FLOPs

Turn a model, an image size and a dataset into a FLOP count and a GPU bill

"Compute" on the x axis is a count of arithmetic. A FLOP is one floating-point add or multiply. To use a scaling law you must count FLOPs for your own run. For an image model, start with how many tokens one image becomes.

Call the image side length in pixels R and the patch side p. A ViT cuts the image into a grid of R / p patches on each side. Call the number of tokens per image T.

Say it aloud

T equals R over p, squared.

T
T tokens per image: one per patch.
R
R the image side in pixels, such as 224.
p
p the patch side in pixels: 16 for ViT-B/16, 14 for ViT-G/14.
2
squared the grid has as many rows as columns.
In plain words

Divide the side R by the patch side p to get patches per row. Square it. That is T.

With numbers

ViT-G/14 at 224 px: 224 / 14 = 16 per row, so T = 256. At 336 px, T = 24 × 24 = 576, which is 2.25× the tokens for 1.5× the side.

Now the cost of training. Call the parameter count N, the total training tokens D (images seen times T) and the training FLOPs C. A forward pass does one multiply and one add per parameter per token. The backward pass costs about twice the forward.

Say it aloud

C is about six times N times D.

C
C training FLOPs for the whole run.
6
six 2 FLOPs forward (multiply, add) plus 4 backward, per parameter per token.
N
N the parameter count.
D
D training tokens: images seen times T.
In plain words

Multiply the parameters N by the tokens D. Multiply by six. That is the FLOP bill C.

With numbers

ViT-G/14: 6 × 1.843 B × 256 = 2.83 × 1012 FLOPs per image. One pass over 3 B images: C = 8.5 × 1021 FLOPs.

Price a training run

The grid is one image cut into patches. The blue bar is the run's FLOPs on a log scale. Pick a model, then drag the image size and the images seen.

224 px
3.0 B

Parameter counts and widths from Zhai et al. (2021). GPU days assume 125 TFLOP/s of useful work per GPU (40% of an A100's 312 peak), an illustrative figure.

Vision-language models pay the same way. A LLaVA-1.5-style model feeds 576 image tokens (a 336 px image, patch 14) into its language model. With 100 text tokens, image tokens are 85% of the training FLOPs.

The failure: 6ND ignores attention. Attention scores cost about T / (6d) on top, where d is the model width. For ViT-B/16 that is 4%; for ViT-L/14 at 336 px it is 9%, and it grows with every pixel. Count it once your images get large.

A ViT with patch 16 goes from 224 px to 448 px images. Roughly how do the training FLOPs per image change?

Chapter 4

The Compute-Optimal Split

Solve the hero's valley: grow model and data together as the budget grows

Back to the hero. The budget C is fixed, and C = 6ND, so a bigger model means fewer tokens. Error now has a part for each resource. Call the floor E, the model-size part A / Nα and the data part B / Dβ. Call the loss L.

Say it aloud

L of N and D equals E, plus A over N to the alpha, plus B over D to the beta.

L(N, D)
L of N and D the loss of a model with N parameters trained on D tokens.
E
E the floor. In the fit we use, 1.82.
A / Nα
A over N to the alpha the loss from too few parameters. Here A = 482, alpha = 0.348.
B / Dβ
B over D to the beta the loss from too little data. Here B = 2085, beta = 0.366.
In plain words

Start at the floor E. Add a penalty that shrinks as the model N grows. Add a second penalty that shrinks as the data D grows. At a fixed budget, growing one penalty's resource grows the other penalty.

With numbers

Chinchilla, N = 70 B and D = 1.4 T: A / Nα = 0.081 and B / Dβ = 0.075. The two penalties are about equal, so L = 1.82 + 0.081 + 0.075 = 1.97.

Set the slope of L to zero along the budget line and the best model size follows a power of the budget. Call the best size Nopt and its exponent a.

Say it aloud

N-opt grows like C to the a, where a equals beta over alpha plus beta.

Nopt
N-opt the model size with the lowest loss for budget C.
∝
grows like equal up to a constant factor.
C
C the budget in FLOPs.
a
to the a the share of each budget increase that goes to parameters.
a = β / (α + β)
a equals beta over alpha plus beta data gets the rest, 1 minus a.
In plain words

Add the two exponents alpha and beta. Divide beta by the sum. That fraction a says how fast the best model N-opt grows with the budget C.

With numbers

a = 0.366 / (0.348 + 0.366) = 0.51. Double the budget: N-opt grows 20.51 = 1.43× and data grows 20.49 = 1.40×.

Follow the best split up the budget

Each blue diagonal is one budget. Green is the best split; grey dashes are an older rule that grew models faster. Drag the budget.

10^22

Green uses the Besiroglu et al. (2024) re-fit of Chinchilla's runs. Grey dashes use Kaplan et al.'s exponent a = 0.73, as listed in Hoffmann et al. Table 2. Gopher: 280 B parameters, 300 B tokens.

At Gopher's budget of 5.76 × 1023 FLOPs the fit puts the best model at 72 B parameters on 1.33 T tokens. Chinchilla used 70 B on 1.4 T, about 20 tokens per parameter, and beat the 280 B Gopher on the same compute. The Chinchilla paper puts it plainly: double the model, double the tokens.

The failure is to put a budget windfall into parameters. The symptom is a big model whose loss still falls fast when training stops. Measure tokens per parameter; far under 20 means a starved model. For vision, Zhai et al. reached the same verdict from the other side: big models need big data.

Your training budget grows 8×. With a = 0.5, how should model size and data change?

Chapter 5

Data That Counts: Repeats, Duplicates and Noise

Measure data in what it teaches, not in rows downloaded

CLIP learned from 400 million image-caption pairs scraped from the web. LAION scaled the scrape to billions. A scrape repeats itself: the same photo appears thousands of times. So D in the law is not the row count. What is a repeated sample worth?

Muennighoff et al. (2023) measured this for language models. Call the unique tokens U, the number of extra passes over them R (epochs minus one), a fitted constant R*, and the effective data D′: the fresh data the run is worth.

Say it aloud

D-prime equals U, plus U times R-star times one minus e to the minus R over R-star.

D′
D-prime effective data: how much fresh data the run is worth.
U
U unique data: the first pass counts in full.
U ·
U times the repeats add value in units of the unique set.
R*
R-star a fitted constant, 15.4: the cap on what repeats can add.
e−R / R*
e to the minus R over R-star shrinks from 1 toward 0 as the repeats R grow.
In plain words

Count the unique data U once in full. Each repeat adds less than the one before. All repeats together can add at most R-star times U.

With numbers

4 epochs, so R = 3: D′ = U × (1 + 15.4 × (1 − e−0.195)) = 3.73 U. Four passes are worth 93% of fresh data. 40 passes are worth only 15.2 U.

Repeat the data and count its worth

Warm dashes are samples trained on. The purple curve is what they are worth. Drag the epochs.

4.0

Formula and R* = 15.4 from Muennighoff et al. (2023), fitted on language models with 100 M unique pairs as an illustrative set size. Image-text data may differ.

Web duplicates are repeats you did not choose, and they are uneven: one meme can appear 10,000 times while most images appear once. A sample copied 10,000 times is worth at most about 16 fresh samples. So deduplication, removing exact and near copies, costs little accuracy and saves compute. DataComp-1B shows how much the choice of data matters: the same CLIP ViT-L/14 training reached 79.2% zero-shot ImageNet, 3.7 points above OpenAI's CLIP, at equal compute.

The failure is noise. A caption that names the wrong object teaches a false link. The symptom: accuracy stalls as the scrape grows. Score a sample of pairs by hand, or with a CLIP similarity filter, before you scale the set.

You train 4 epochs over a unique set U. About how much fresh data is the run worth?

Chapter 6

Transfer Scales Smoothly

Forecast zero-shot and linear-probe accuracy, and spot a jump made by the metric

You rarely care about pre-training loss. You care how the model does on your task. Two tests measure that without full training. A linear probe freezes the model and trains one linear layer on its features. Zero-shot classification trains nothing: CLIP embeds the image and the text "a photo of a dog" for each class, then picks the closest text.

Cherti et al. (2022) trained OpenCLIP models on LAION up to 2 billion pairs. Zero-shot classification, retrieval, linear probing and fine-tuning all followed power laws in compute. The training data changed the exponents, so a law fitted on one dataset does not carry over to another.

So you can forecast transfer. Say four model scales give zero-shot accuracies of 35%, 52%, 64% and 72% (made-up numbers), one decade of compute apart. The errors are 0.65, 0.48, 0.36 and 0.28. Each decade multiplies error by about 0.75. One more decade gives 0.21 error, so about 79% accuracy.

Change the metric, not the model

One model family, one smooth skill. Purple scores each step. Pink scores a 10-step task as all or nothing. Drag the scale.

10^2

Illustrative: per-step error = 0.5 × scale−0.25; exact match = per-step accuracy to the 10th power. The idea is from Schaeffer et al. (2023).

Per-step accuracy rises from 50% to 95% in a smooth curve. Exact match over 10 steps stays near zero for a whole decade of scale, then climbs fast. Nothing sudden happened inside the model. The metric multiplies ten chances to fail, so it hides progress and then shows it all at once. Schaeffer et al. (2023) showed that many "emergent" jumps in language models shrink this way under a smooth metric.

The failure is to wait for a jump. The symptom is a team that skips a scale because "the skill has not appeared yet". Measure the same runs with a smooth metric, such as per-step accuracy or the probability of the right answer, and fit that.

An all-or-nothing benchmark score stays flat, then leaps between two model sizes. What should you check first?

Chapter 7

Headroom: What Money Cannot Buy

Split error into a part scale can remove and a floor it cannot, then price the rest

Part of every error rate is the answer key's fault. Northcutt et al. (2021) estimated that at least 6% of ImageNet validation labels are wrong. Beyer et al. (2020) re-labelled the set because many images hold several objects or sit between two classes. A perfect model still loses those points.

So the floor E∞ holds label errors, images no one can classify and true overlap between classes. Scale only removes the rest, the reducible error. Call your error now E0, the share of reducible error each 10× of compute removes f, and the error after k decades Ek.

Say it aloud

E-k equals E-infinity, plus E-zero minus E-infinity, times one minus f to the k.

Ek
E-k the error after k more decades of compute.
E∞
E-infinity the floor.
E0
E-zero your error today.
E0 − E∞
E-zero minus E-infinity the reducible error: all that scale can ever win.
(1 − f)k
one minus f to the k the share of reducible error left after k decades.
In plain words

Subtract the floor E-infinity from today's error E-zero. Shrink that gap by one minus f for each decade k. Add the floor back.

With numbers

With made-up numbers E-zero = 0.14, E-infinity = 0.08, f = 0.25: after 1, 2, 3 decades the error is 0.125, 0.114, 0.105. That is 87.5%, 88.6%, 89.5% accuracy.

Price the headroom

Yellow is the floor. Purple is the reducible error. Each bar is one more 10× of compute. Drag the floor and the gain per decade.

0.080
25%

Illustrative: today's error is fixed at 14%. Real floors come from label audits, not from this slider.

A thousand times the compute bought 3.5 points, and the model is still 2.5 points short of a ceiling it never reaches. Estimate E∞ before you plan a scaling campaign. The reducible gap is your real budget, not the gap to 100%.

The failure: a model that scores above the label ceiling. The symptom is 95% on a benchmark whose labels are 92% right. That model learned the wrong labels. Check it on a re-labelled set such as ImageNet ReaL. Cleaning labels lowers the floor itself, often for less than one more decade of compute.

You are at 87% accuracy. The floor is 9% error. Each 10× of compute removes 30% of the reducible error. What does 100× more compute buy?

Chapter 8

The Lab: Fit, Forecast, Quote the Error Bars

Fit noisy pilots, extrapolate to the big run, and see when the forecast stops being one

Now do what a team does before a big run. Real pilots are noisy: the same model with a different seed lands a little higher or lower. Fit a line to log error against log size. Then ask two questions: what does the line say at the target, and how sure is it?

The band around the line is a prediction interval: where a new run would land about 95% of the time if the law holds. It widens with noise, narrows with more pilots and fans out the farther you go past your data.

Forecast the big run

Pink dots are pilots. Purple is the fit with its band. The grey curve is the truth, hidden from the fit. Drag the target past the data.

4%
6
100 B

Illustrative truth: E = 0.06 + 2 × N−0.15, pilots from 1 M to 1 B parameters with log-normal noise. The band is a least-squares prediction interval in log space, ±2 standard errors.

Three lessons sit in the lab. Near the data the band is tight, so a forecast 3× past your biggest pilot is safe. Far out it fans, and a forecast 1000× past the data is a hope. And the band only covers noise: with the wrong law it can be tight and wrong.

That last case is the dangerous failure. Fit a pure power law to data that bends toward a floor. At 1 T parameters it promises an error near 0.07; the truth is 0.09. The band does not warn you. To catch it, hold out your biggest pilot, fit the rest and check whether the held-out point falls inside the band. If it does not, fit with a floor.

Your fit has a tight band, but the biggest pilot, held out, falls above it. What is the most likely cause?

Chapter 9

Field Guide

Keep the numbers, the moves and the code in one place

Error falls as a power law in parameters, data and compute, a straight line on log-log paper. It bends toward a floor set by label noise and ambiguity. Fit the line from cheap pilots, count FLOPs with 6ND, grow model and data together, count data by what it teaches, and stop scaling when the gain per decade dies.

Terms and numbers

TermMeaningNumber to keep
Power lawE = A · N−α; a line of slope −α on log-log axesalpha about 0.1 to 0.4 in vision
Floor E∞Error no compute removesat least 6% of ImageNet validation labels are wrong
ViT-G/14Largest model in Zhai et al. (2021)1,843 M params, JFT-3B, 90.45% ImageNet
ViT-22BDehghani et al. (2023), dense ViT at 22 B22 B params
Tokens per imageT = (R / p)2256 at 224 px / patch 14; 576 at 336 px
Training FLOPsC ≈ 6 · N · Dattention adds about T / (6d)
Compute-optimalNopt ∝ Ca, a = β / (α + β)a about 0.5; about 20 tokens per parameter
ChinchillaHoffmann et al. (2022)70 B params, 1.4 T tokens, 5.9 × 1023 FLOPs
Repeated dataD′ = U + U R* (1 − e−R/R*)R* = 15.4; 4 epochs worth 3.73 U
DataComp-1BFiltered data at equal compute79.2% zero-shot, +3.7 over OpenAI CLIP ViT-L/14

Which move

SituationMoveWhy
Far from the floor, gain per decade healthyScale model and data togetherYou are on the straight part of the curve
Near the floorClean labels or change the taskCompute buys almost nothing there
Strong frozen model, few labelsZero-shot to scope, then a linear probeFew trained weights, little overfitting, cheap
Many in-domain labels, last points matterFull fine-tuneEnough labels to move all the weights
Big model too costly to serveDistill into a small studentKeeps much of the accuracy at a fraction of the serving cost

Before a big run

The core, in code

pythonimport numpy as np

def fit_power_law(N, err, floor=0.0):          # N, err: arrays of pilot runs
    x, y = np.log(N), np.log(err - floor)
    slope, icpt = np.polyfit(x, y, 1)
    resid = y - (icpt + slope * x)
    s = np.sqrt((resid ** 2).sum() / (len(x) - 2))      # scatter in log space
    def forecast(n):
        x0 = np.log(n)
        se = s * np.sqrt(1 + 1/len(x) + (x0 - x.mean())**2 / ((x - x.mean())**2).sum())
        mid = icpt + slope * x0
        return [floor + np.exp(mid + k * 2 * se) for k in (-1, 0, 1)]   # low, mid, high
    return -slope, forecast                             # alpha, forecaster

def train_flops(n_params, images, side=224, patch=14):
    tokens = (side // patch) ** 2                         # T = (R/p)^2
    return 6 * n_params * images * tokens                  # C = 6 N D

def effective_data(unique, epochs, r_star=15.4):
    R = epochs - 1
    return unique + unique * r_star * (1 - np.exp(-R / r_star))

print(train_flops(1.843e9, 3e9))      # 8.5e21 FLOPs: ViT-G/14, one pass over 3 B images
print(effective_data(1.0, 4))       # 3.73: four epochs are worth 3.73 unique passes

Keep going

Sources: Zhai et al., Scaling Vision Transformers; Dehghani et al., ViT-22B; Hoffmann et al., Chinchilla; Besiroglu et al., Chinchilla Scaling: A Replication Attempt; Cherti et al., Reproducible Scaling Laws for CLIP; Muennighoff et al., Data-Constrained Language Models; Gadre et al., DataComp; Northcutt et al., Pervasive Label Errors; Schaeffer et al., Are Emergent Abilities a Mirage?

The takeaway. Scaling is an allocation problem with a known shape. Fit the line, find the floor, split the budget, and quote the band.

Now press Present or Teach. Explain from memory: the power law and its slope, the floor, 6ND with patches, the best split and why repeats fade. Then go back to the hero, pick 1023 FLOPs, and find the best model size before the readout tells you.

Vision & VLM Scaling Laws: How Accuracy Buys Parameters, Data and Compute
Back to Gleams