Search

Search papers and lessons

Compound Scaling

Level 4 · 11 min read

Compound scaling grows a convolutional network's depth, width and input resolution together by fixed powers of one number, so a single knob sets the whole model size and cost.

On this page

  • Colour = topic mix
  • Calculus
  • Discrete math
  • Linear algebra
  • Neural network basics
  • Architectures
  • Probability
  • ReadReady to readNot yet

TL;DR

Compound scaling is a rule for making a convolutional network bigger or smaller. It has three dials: depth (how many layers), width (how many channels each layer has) and input resolution (how many pixels wide and tall the image is). Instead of turning one dial at a time, it turns all three together, each by a fixed power of a single number ϕ\phi, so one setting of ϕ\phi gives a whole family of models with a predictable cost. It solves the problem that scaling one dial alone stops paying off quickly.

Builds on: convolutional networks, exponential growth · Leads to: EfficientNet, architecture search for the baseline

Where it's used

Image classifiers for phones and servers. The EfficientNet family, built with compound scaling, covers a range of sizes from a small mobile model to a very large one. The largest model, EfficientNet-B7, reached 84.3 percent top-1 accuracy on ImageNet with 66 million parameters. GPipe, the earlier system with the same accuracy, used 557 million parameters, which is 8.4 times as many.

Choosing a model for a fixed compute budget. A team with a set amount of inference compute can use the scaling rule to pick the largest member of a family that fits. Because the cost of each member is predictable, the team does not have to train many models by trial and error to find one that is just under the limit.

Transferring to other tasks. The paper reports that EfficientNet models also do well when fine-tuned on standard image datasets, reaching 91.7 percent on CIFAR-100 and 98.8 percent on Flowers, which is useful when a team has a small labelled dataset and a fixed budget.

How it works

We will trace one tiny instance: a baseline network with depth 1, width 1 and resolution 1 (these are multipliers, so 1 means "as the baseline"). The scaling rule uses three constants, which the paper found to be α=1.2\alpha = 1.2 for depth, β=1.1\beta = 1.1 for width and γ=1.15\gamma = 1.15 for resolution. We will scale by ϕ=1\phi = 1, then ϕ=2\phi = 2.

  1. Pick the compound coefficient ϕ=1\phi = 1. This is the user's choice of how much more compute to spend. Check: ϕ\phi is a single whole number, not three separate numbers.
  2. Compute the three multipliers. Depth becomes αϕ=1.21=1.2\alpha^\phi = 1.2^1 = 1.2, width becomes βϕ=1.1\beta^\phi = 1.1, and resolution becomes γϕ=1.15\gamma^\phi = 1.15. Check: each is the base constant raised to the same power.
  3. Apply them. The scaled network has 1.2 times as many layers, 1.1 times as many channels in each layer, and inputs that are 1.15 times as wide and tall. Check: nothing else in the architecture changes.
  4. Work out the cost. The cost of a convolution goes up with depth in direct proportion, but with width squared and resolution squared, because the width and resolution each enter twice. The total multiplier is 1.2×1.12×1.152=1.2×1.21×1.3225≈1.921.2 \times 1.1^2 \times 1.15^2 = 1.2 \times 1.21 \times 1.3225 \approx 1.92. Check: this is close to 2, which is why the rule is built around that product.
  5. Repeat with ϕ=2\phi = 2. The multipliers are 1.22=1.441.2^2 = 1.44, 1.12=1.211.1^2 = 1.21 and 1.152=1.32251.15^2 = 1.3225. The cost multiplier is 1.922≈3.71.92^2 \approx 3.7. Check: doubling ϕ\phi roughly squares the cost multiplier, and each extra unit of ϕ\phi roughly doubles the cost.
  6. Read the result. Going from ϕ=1\phi = 1 to ϕ=2\phi = 2 multiplies the cost by about 2, and going to ϕ=2\phi = 2 from the baseline multiplies it by about 3.7. One number now controls the size of the whole model.
flowchart LR
  A[Compute budget] --> B[Choose phi]
  B --> C[Depth x alpha^phi]
  B --> D[Width x beta^phi]
  B --> E[Resolution x gamma^phi]
  C --> F[Scaled network]
  D --> F
  E --> F
00.511.522.5302468phimultiplier
  • depth: 1.2^phi
  • width: 1.1^phi
  • resolution: 1.15^phi
  • cost: about 2^phi
Each dial grows geometrically in phi. The dashed cost curve grows fastest because width and resolution each enter the cost squared. The points mark phi = 1 and phi = 2.

The math

Definition

Definition: Compound scaling

Given a baseline network and constants α≥1\alpha \ge 1, β≥1\beta \ge 1, γ≥1\gamma \ge 1 with

α⋅β2⋅γ2≈2,\alpha \cdot \beta^2 \cdot \gamma^2 \approx 2,

the compound-scaled network with coefficient ϕ≥0\phi \ge 0 uses depth multiplier d=αϕd = \alpha^{\phi}, width multiplier w=βϕw = \beta^{\phi} and resolution multiplier r=γϕr = \gamma^{\phi}. Here dd scales the number of layers, ww scales the number of channels in each layer, and rr scales the height and width of the input image.

Read the definition in words. Each dial is a constant raised to the power ϕ\phi, so all three grow at the same exponential rate in ϕ\phi. The constraint αβ2γ2≈2\alpha \beta^2 \gamma^2 \approx 2 ties the constants together so that each step of ϕ\phi roughly doubles the cost.

Step 2 in symbols: the three multipliers

With ϕ=1\phi = 1 and the paper's constants, d=1.2d = 1.2, w=1.1w = 1.1 and r=1.15r = 1.15. The constants are the base of each power, so the question "how much does depth grow?" has the answer α\alpha per unit of ϕ\phi.

Step 4 in symbols: why width and resolution cost more

The paper gives the cost reason directly: the FLOPS of a regular convolution are proportional to dd, w2w^2 and r2r^2. Doubling depth doubles the cost, while doubling width or resolution quadruples it. Multiplying those factors for a model scaled with coefficient ϕ\phi gives an approximate total FLOPS multiplier of

(α⋅β2⋅γ2)ϕ.\left(\alpha \cdot \beta^2 \cdot \gamma^2\right)^{\phi}.

Setting αβ2γ2≈2\alpha \beta^2 \gamma^2 \approx 2 makes this about 2ϕ2^{\phi}. The paper uses that choice so the cost of each unit of ϕ\phi is a clean factor of two.

Step 5 in symbols: a check on the numbers

Let c=αβ2γ2c = \alpha \beta^2 \gamma^2. With the paper's constants, c=1.2×1.12×1.152≈1.92c = 1.2 \times 1.1^2 \times 1.15^2 \approx 1.92. Then the cost multiplier for ϕ\phi is cϕc^{\phi}, so for ϕ=2\phi = 2 it is 1.922≈3.691.92^2 \approx 3.69, and for ϕ=3\phi = 3 it is 1.923≈7.081.92^3 \approx 7.08. The constraint is approximate, so cc need not equal 2 exactly.

How the constants are found

The paper searches for α\alpha, β\beta and γ\gamma with a small grid search, but only once, at ϕ=1\phi = 1, on the small baseline network. The same three constants are then reused for every larger model. The authors note that searching directly around a large model can give better results, but the search cost becomes prohibitively expensive on larger models.

Worked examples

Example
Tiny: the depth multiplier at phi = 3

Use depth constant α=1.2\alpha = 1.2 and ϕ=3\phi = 3.

  1. The depth multiplier is αϕ=1.23\alpha^{\phi} = 1.2^3.
  2. Compute 1.2×1.2=1.441.2 \times 1.2 = 1.44.
  3. Then 1.44×1.2=1.7281.44 \times 1.2 = 1.728.
  4. Check: a baseline with 10 layers becomes 10×1.728=17.2810 \times 1.728 = 17.28, so about 17 layers.

Answer: the depth multiplier is 1.728, and a 10-layer baseline becomes about 17 layers.

Example
Standard: the cost multiplier for a scaled network

Use α=1.2\alpha = 1.2, β=1.1\beta = 1.1, γ=1.15\gamma = 1.15, and ϕ=2\phi = 2.

  1. Compute the depth factor α2=1.44\alpha^2 = 1.44.
  2. Compute the width factor β2=1.21\beta^2 = 1.21. Its effect on cost is squared, so use β4=1.4641\beta^4 = 1.4641 in the cost.
  3. Compute the resolution factor γ2=1.3225\gamma^2 = 1.3225. Its effect on cost is squared too, so use γ4=1.7490\gamma^4 = 1.7490.
  4. Multiply the cost factors: 1.44×1.4641×1.7490≈3.691.44 \times 1.4641 \times 1.7490 \approx 3.69.
  5. Check with the shortcut: (αβ2γ2)2=1.922≈3.69(\alpha \beta^2 \gamma^2)^2 = 1.92^2 \approx 3.69. The two methods agree.

Answer: a network scaled with ϕ=2\phi = 2 costs about 3.7 times the baseline.

Example
Realistic: choosing a family member for a fixed budget

A team runs an image classifier on a phone and has a compute target that is 8 times the baseline's cost. They want the deepest model that fits.

  1. The cost multiplier is cϕ=1.92ϕc^{\phi} = 1.92^{\phi}, where c≈1.92c \approx 1.92 for the paper's constants.
  2. Solve 1.92ϕ≤81.92^{\phi} \le 8 for ϕ\phi. Take logarithms: ϕ≤ln⁡8/ln⁡1.92\phi \le \ln 8 / \ln 1.92.
  3. Compute ln⁡8≈2.079\ln 8 \approx 2.079 and ln⁡1.92≈0.652\ln 1.92 \approx 0.652, so ϕ≤3.19\phi \le 3.19.
  4. Take the largest whole number, ϕ=3\phi = 3, which costs about 7.087.08 times the baseline, under the target of 8.
  5. The scaled model has depth 1.23=1.7281.2^3 = 1.728, width 1.13=1.3311.1^3 = 1.331 and resolution 1.153≈1.5211.15^3 \approx 1.521 times the baseline.

Try it: the team wants a cost multiplier of at most 4. What is the largest whole ϕ\phi? Answer: 1.922≈3.69≤41.92^2 \approx 3.69 \le 4 and 1.923≈7.08>41.92^3 \approx 7.08 \gt 4, so ϕ=2\phi = 2.

Common mistakes and tradeoffs

Mistake: "Making any one dimension bigger is just as good." It is tempting to think that more layers alone will keep improving accuracy. In fact the paper shows that scaling only width saturates quickly: with depth and resolution held fixed, accuracy levels off as width grows. Balancing the three dials is what keeps the gains coming.

Mistake: "The constants are universal." It is tempting to copy 1.21.2, 1.11.1 and 1.151.15 for any network. In fact they were found on one baseline, and the paper notes that the effectiveness of scaling depends heavily on the baseline. A new architecture may need its own small search at ϕ=1\phi = 1.

Mistake: "Compound scaling chooses the architecture." It is tempting to think the rule designs the network. In fact it only changes the size of an existing baseline. The EfficientNet baseline was found by a separate neural architecture search, and the scaling rule then grows it.

Mistake: "Bigger is always more accurate in production." More accuracy costs more latency and memory. The paper reports speed on a CPU for a few models, but a single FLOPS number does not capture every hardware cost, so a team should measure latency on its own device.

When to use it. Use compound scaling when you have a good baseline and need a range of sizes under different compute budgets. When not to use it. Skip it when one fixed model is enough, or when your architecture has no obvious depth, width and resolution to scale. Alternatives. Scaling one dimension is simpler and works for a fixed target; a fresh architecture search for each budget is far more expensive but can find better models than any scaled family.

History

Before 2019, the common way to get a more accurate convolutional network was to add layers. The paper cites ResNet, which can be scaled from ResNet-18 to ResNet-200 by adding layers, and GPipe, which reached 84.3 percent top-1 on ImageNet by scaling a baseline about four times larger.

Other work scaled width, as in wide residual networks and MobileNets, and resolution, by feeding larger images. Each dial helped, but the gains flattened when used alone. The EfficientNet paper by Mingxing Tan and Quoc Le in 2019 asked whether there was a principled way to grow all three together, and proposed compound scaling as the answer.

The idea caught on because it made model families easy to build. A single coefficient and a tuned baseline produce a range of models with known costs, which practitioners could pick from for a given device.

Recap

  • A convolutional network has three dials: depth, width and input resolution.
  • Compound scaling sets each dial to a constant raised to the power ϕ\phi: d=αϕd = \alpha^{\phi}, w=βϕw = \beta^{\phi}, r=γϕr = \gamma^{\phi}.
  • The constants satisfy αβ2γ2≈2\alpha \beta^2 \gamma^2 \approx 2, so each unit of ϕ\phi roughly doubles the cost.
  • The constants come from one small search on a baseline, then they are reused for all sizes.
  • Read next: the EfficientNet paper, which applies the rule to a searched baseline, and neural architecture search, which found that baseline.

Check yourself

QuestionA baseline network has 20 layers. With α=1.2\alpha = 1.2 and ϕ=2\phi = 2, how many layers does the scaled network have, to the nearest whole number?Show answer

Answer: 29. The depth multiplier is 1.22=1.441.2^2 = 1.44, and 20×1.44=28.820 \times 1.44 = 28.8, which rounds to 29.

QuestionUsing α=1.2\alpha = 1.2, β=1.1\beta = 1.1 and γ=1.15\gamma = 1.15, compute the approximate cost multiplier for ϕ=1\phi = 1.Show answer

Answer: about 1.92. The product is αβ2γ2=1.2×1.21×1.3225≈1.92\alpha \beta^2 \gamma^2 = 1.2 \times 1.21 \times 1.3225 \approx 1.92.

QuestionWhy does the paper make width and resolution enter the cost squared, but depth enter it only once?Show answer

Answer: A convolution's cost is proportional to the number of layers, and each layer's cost depends on the number of channels and on the spatial size of its input. Width multiplies the channels in both the input and output of a convolution, so it enters as w2w^2. Resolution sets the height and width of the feature map, so it enters as r2r^2. Depth only adds layers, so it enters linearly as dd.

QuestionA team uses compound scaling and a cost multiplier must stay under 10. Which whole ϕ\phi can they use with c≈1.92c \approx 1.92?Show answer

Answer: ϕ=3\phi = 3. Compute 1.922≈3.691.92^2 \approx 3.69, which is under 10, and 1.923≈7.081.92^3 \approx 7.08, which is also under 10. 1.924≈13.61.92^4 \approx 13.6 is over 10, so the largest whole value is 3.

QuestionA colleague says that to get a bigger model it is enough to add layers and never change width or resolution. What is wrong with this?Show answer

Answer: The paper finds that scaling a single dimension saturates: accuracy gains flatten as only one dial grows. Growing one dimension alone saturates, so balancing depth, width and resolution gives better accuracy at the same FLOPS.

Sources