Tutorials › Statistical Learning (Graduate) › Balancing Neural Width, Depth, and Estimation Error

Neural Estimation and Generalization · Tutorial 930 of 989

Balancing Neural Width, Depth, and Estimation Error

Learn how approximation exponents and norm-based estimation complexity determine the width, depth, and risk rate of a neural estimator.

Advanced 11 min read

What You'll Learn

  • Express neural approximation error as a function of width and depth.
  • State the assumptions needed for a norm-based estimation bound to hold across architectures.
  • Balance width and depth against estimation error to obtain sample-size-dependent choices.
  • Prove the resulting rate for a general separable approximation profile.
  • Check the rate and architecture calculations in symmetric, asymmetric, and finite-sample examples.
  • Recognize why equal width and depth need not be the right choice.

Why Width and Depth Must Be Balanced

A neural network can become more expressive by increasing its width, its depth, or both. Greater expressiveness can reduce approximation error, but a larger or more complex class can also make estimation from a finite sample harder. The useful architecture is therefore not necessarily the largest one that can be trained: it is a choice that makes the two errors small together.

The balance depends on two ingredients. The first is an approximation profile: a bound describing how the best risk in a width-\(W\), depth-\(D\) class improves as \(W\) and \(D\) increase. The second is an estimation bound for fitting within that class. This tutorial derives the architecture and risk rate that follow from a particular, transparent pair of bounds. The rate is conditional on those bounds; it is not a universal rate for all neural networks or data distributions.

Setup and Assumptions

Let \(R(f)\) denote the population risk of predictor \(f\), and let \(R^*=\inf_f R(f)\) be the target risk over the prediction problem under consideration. For each pair of positive integers \(W,D\), let \(\mathcal F_{W,D}\) be a neural-network class with width \(W\) and depth \(D\), using a fixed convention for counting layers. Write \(f^*_{W,D}\) for a risk minimizer in this class, when one exists. If the infimum is not attained, the same statements can be made with an arbitrarily accurate approximant.

Definition: An approximation profile is a bound on the difference between the best risk in an architecture class and the target risk. Here we assume, for constants \(A_1,A_2>0\) and exponents \(p,q>0\), that $$ R(f^*_{W,D})-R^* \leq A_1 W^{-p}+A_2 D^{-q}. $$ The exponents describe how quickly approximation error can decrease with width and depth, respectively.

We also need an estimation bound. Norm-based generalization results control the gap between the population risk and the empirical risk, or the excess risk of a fitted predictor, using a norm-dependent complexity measure. The specific norm and its proof depend on the network class and loss. For this rate calculation, assume those results give the following bound for a fitted predictor \(\hat f_{W,D}\):

$$ R(\hat f_{W,D})-R(f^*_{W,D}) \leq A_3\sqrt{\frac{WD}{n}}+\delta_n, $$

simultaneously over the candidate architectures being considered, on an event of probability at least \(1-\eta\). Here \(A_3>0\), \(n\) is sample size, and \(\delta_n\geq 0\) allows for optimization error or another stated fitting tolerance. This form corresponds, for example, to a norm-based complexity envelope that grows at most proportionally to \(\sqrt{WD}\), with other constants absorbed into \(A_3\). The bound is an assumption about the considered classes and fitting procedure, not a consequence of width and depth alone.

Adding the approximation and estimation bounds gives the architecture-specific risk guarantee

$$ R(\hat f_{W,D})-R^* \leq A_1W^{-p}+A_2D^{-q} +A_3\sqrt{\frac{WD}{n}}+\delta_n. $$

The first two terms reward increasing width and depth. The third penalizes their joint growth. The task is to choose \(W\) and \(D\) so that none of these three terms dominates unnecessarily.

Worked Examples of the Balance

Worked Example: Equal Approximation Exponents

Suppose the profile and estimation bound are \(W^{-2}+D^{-2}+\sqrt{WD/n}\), so \(p=q=2\) and all three constants equal one. To find a rate-optimal scaling, set \(W=D=n^a\). The two approximation terms are each \(n^{-2a}\), while the estimation term is $$ \sqrt{\frac{n^a n^a}{n}}=n^{a-1/2}. $$ Balancing the exponents gives \(2a=1/2-a\), hence \(a=1/6\). Thus \(W=D=n^{1/6}\) makes each term \(n^{-1/3}\), and the bound is at most \(3n^{-1/3}\), apart from \(\delta_n\).

For \(n=10^6\), this choice gives \(W=D=10\). The approximation terms are \(10^{-2}\) each, and the estimation term is \(\sqrt{100/10^6}=10^{-2}\). Their sum is \(0.03\). This verifies the claimed order and the finite-sample calculation for the stated proxy.

Worked Example: Faster Approximation With Depth

Now suppose the bound is \(W^{-1}+D^{-4}+\sqrt{WD/n}\), so \(p=1\) and \(q=4\). Let \(W=n^a\) and \(D=n^b\). The three terms have orders \(n^{-a}\), \(n^{-4b}\), and \(n^{(a+b-1)/2}\). Set the approximation exponents equal, \(a=4b=r\), and balance them with the estimation exponent: $$ r=\frac{1- (r+r/4)}{2}. $$ Therefore \(2r=1-\frac54r\), so \(\frac{13}{4}r=1\), giving \(r=4/13\). The architecture scales are $$ W=n^{4/13},\qquad D=n^{1/13}, $$ and all three terms have order \(n^{-4/13}\).

Take \(n=10^{13}\). These choices give \(W=10^4\) and \(D=10\). The approximation terms are \(1/W=10^{-4}\) and \(1/D^4=10^{-4}\). The estimation term is \(\sqrt{10^5/10^{13}}=\sqrt{10^{-8}}=10^{-4}\). The bound is therefore \(3\times10^{-4}\). In this profile, equal width and depth would ignore the faster improvement from depth and would not give the balanced scaling.

Worked Example: Integer Choices at a Finite Sample Size

For the symmetric profile in the first example, take \(n=1000\). The scaling \(n^{1/6}\) is about \(3.16\), but widths and depths must be integers. Consider \(W=D=5\). The two approximation terms sum to \(1/25+1/25=0.08\), and the estimation term is \(\sqrt{25/1000}=\sqrt{0.025}\approx0.1581\). The total proxy bound is about \(0.2381\).

For comparison, \(W=D=4\) gives \(1/16+1/16+\sqrt{16/1000}\approx0.2515\), while \(W=D=6\) gives \(1/36+1/36+\sqrt{36/1000}\approx0.2453\). Thus \(W=D=5\) is better than these two nearby symmetric choices for this proxy. This small calculation illustrates the integer and constant effects: the rate calculation predicts a scale, not an exact finite-sample optimizer.

General Balancing Result

The preceding calculations extend to any positive approximation exponents. The result below gives both a rate-achieving scaling and a matching lower bound for the three-term proxy. That lower bound concerns the proxy itself; it does not claim a minimax lower bound for the underlying statistical problem.

Theorem: Let \(p,q,A_1,A_2,A_3>0\), and define $$ \Phi_n(W,D)=A_1W^{-p}+A_2D^{-q} +A_3\sqrt{\frac{WD}{n}},\qquad W,D\geq 1. $$ Set $$ r=\frac{1}{2+1/p+1/q}. $$ There are positive constants \(c,C\), depending only on \(p,q,A_1,A_2,A_3\), such that for all sufficiently large \(n\), $$ c\,n^{-r}\leq \inf_{W,D\geq1}\Phi_n(W,D)\leq C\,n^{-r}. $$ For integer widths and depths, the upper bound is achieved in order by choices \(W\) proportional to \(n^{r/p}\) and \(D\) proportional to \(n^{r/q}\).

Proof. For the upper bound, first take the real-valued scales \(W_0=n^{r/p}\) and \(D_0=n^{r/q}\). Their approximation terms satisfy $$ W_0^{-p}=n^{-r},\qquad D_0^{-q}=n^{-r}. $$ The estimation term has order $$ \sqrt{\frac{W_0D_0}{n}} =n^{(r/p+r/q-1)/2}. $$ Since \(r(2+1/p+1/q)=1\), we have \((r/p+r/q-1)/2=-r\). Thus all three terms are constant multiples of \(n^{-r}\). Rounding \(W_0,D_0\) up to integers preserves this order: for \(x\geq1\), \(\lceil x\rceil\leq2x\), so rounding changes each term by at most a constant factor.

For the lower bound, write \(x=A_1W^{-p}\), \(y=A_2D^{-q}\), and \(z=A_3\sqrt{WD/n}\). Define weights $$ u=\frac{r}{p},\qquad v=\frac{r}{q},\qquad w=2r. $$ They are positive and sum to one, because \(r(1/p+1/q+2)=1\). The weighted arithmetic-geometric mean inequality gives \(\Phi_n(W,D)=x+y+z\geq x^u y^v z^w\). In this product, the powers of \(W\) cancel: they are \(-pu+w/2=-r+r=0\). The powers of \(D\) cancel in the same way. The remaining power of \(n\) is \(-w/2=-r\). Hence $$ \Phi_n(W,D)\geq A_1^u A_2^v A_3^w n^{-r} $$ for every \(W,D\geq1\). Taking the infimum proves the lower bound and completes the proof. \(\square\)

If the fitting bound includes \(\delta_n\), the resulting risk guarantee is of order \(n^{-r}+\delta_n\). In particular, the optimization error must be no larger than the target rate to retain an \(n^{-r}\) guarantee. If a norm-based bound instead has an additional logarithmic factor, that factor must remain in the balance; it cannot be discarded when stating a finite-sample guarantee.

How to Use the Rate Responsibly

The calculation is useful because it turns two qualitative claims—“larger networks approximate better” and “more complex classes are harder to estimate”—into a concrete sample-size-dependent architecture. Its conclusion is only as strong as its inputs. A valid use should check that the approximation profile applies at the selected width and depth, that the norm-based estimation bound applies to the fitted class, and that the guarantee holds for the architecture-selection procedure being used. A bound proved separately for one fixed architecture does not automatically hold simultaneously over many architectures.

A common mistake is to set \(W=D\) before examining the approximation profile. That can be reasonable when the two exponents and constants are comparable, but it is not generally justified. In the asymmetric example, depth has a fourth-power approximation term while width has only a first-power term; the balanced choices consequently have different powers of \(n\). The correction is to balance all three terms using the given exponents, rather than to assume a symmetric architecture.

Another pitfall is to treat the norm-based estimation term as a universal parameter-count penalty. It is not. The norm constraints, data and loss assumptions, constants, and any logarithmic or confidence terms matter. If the available bound has a different dependence on \(W\) and \(D\), use that dependence in place of \(\sqrt{WD/n}\) and redo the balance. The main lesson is the method: state the approximation and estimation bounds precisely, then choose width and depth so their contributions are of comparable order.

Check Your Understanding

Use the stated risk proxy and assumptions when answering.

  1. For \(p=2\) and \(q=2\), what are the rate exponent \(r\) and the width and depth scales?
  2. For approximation terms \(W^{-1}+D^{-2}\) and estimation term \(\sqrt{WD/n}\), solve for the powers of \(n\) in the balanced width and depth choices.
  3. Why does the theorem's lower bound apply to the three-term proxy but not automatically to the statistical problem's minimax risk?
  4. If the optimization error satisfies \(\delta_n=n^{-1/4}\) while the balanced rate is \(n^{-1/3}\), which term dominates the stated guarantee for large \(n\)?
  5. What must be checked before applying a norm-based estimation bound simultaneously to a collection of candidate architectures?
Clinical Biostats