Why Grid Resolution Matters
A continuous hyperparameter, such as a regularization strength, can range over every value in an interval. In practice, tuning often evaluates only finitely many values. This creates a specific approximation question: how much risk can be lost because the best value in the interval is not on the grid? The answer depends not only on how closely the grid points are spaced, but also on how rapidly risk can change with the hyperparameter.
We study the risk function itself, separate from the randomness in estimating it. For a fixed training sample, regard the learning procedure at each tuning value as fixed and let \(R(\lambda)\) be its target risk. The same arguments apply to a risk already averaged over training randomness, provided the stated regularity condition holds for that risk. Grid resolution controls the approximation of the continuous risk minimum; it does not, by itself, control validation estimation error.
When the grid includes both endpoints and has constant spacing \(\Delta\), its fill distance is \(\Delta/2\): the most distant values lie halfway between adjacent grid points. For an irregular grid, the fill distance is half the length of its largest gap, provided the endpoints are included. If an endpoint is omitted, its distance to the closest grid point must also be considered. Thus, spacing and fill distance are related but not interchangeable in every grid design.
Risk Regularity Gives a Discretization Bound
The basic principle is direct: choose a grid point near a risk minimizer, then use regularity to bound how much its risk differs from the minimum. The first version requires a global Lipschitz condition.
Proof. By the definition of fill distance, there is a grid point \(g^*\in G\) nearest to \(\lambda^*\), with \(|g^*-\lambda^*|\leq h(G,\Lambda)\). The grid minimum cannot be below the minimum over the full interval, so its regret is nonnegative. Also, it cannot exceed the risk at \(g^*\). The Lipschitz condition therefore gives
This proves the claim. \(\square\)
Lipschitz continuity is one useful form of regularity, not a necessary condition. For example, a function may change more sharply near its minimum than a Lipschitz bound permits, while still obeying a known Hölder bound.
Worked Example: A Uniform Grid With a Lipschitz Risk
Suppose \(\Lambda=[0,1]\) and \(R(\lambda)=|\lambda-0.37|\). This risk is \(1\)-Lipschitz: the reverse triangle inequality gives \[ \big||\lambda-0.37|-|\lambda'-0.37|\big|\leq|\lambda-\lambda'|. \] Use the grid \(G=\{0,0.2,0.4,0.6,0.8,1\}\).
The grid spacing is \(0.2\), and the endpoints are included, so \(h(G,\Lambda)=0.1\). The continuous minimum is \(R(0.37)=0\). The nearest grid point is \(0.4\), where \(R(0.4)=|0.03|=0.03\). Direct calculation gives grid regret \(0.03-0=0.03\), while the theorem guarantees it is at most \(Lh=1(0.1)=0.1\). The bound is valid but conservative: it uses a worst-case slope bound over the full interval.
When Curvature Improves the Bound
Near a smooth interior minimum, the first derivative vanishes. This can make the risk increase quadratically, rather than linearly, with distance from the optimum. A second-order bound then shows how grid resolution can be especially effective for a locally smooth risk curve.
Proof. Choose a nearest grid point \(g^*\), so \(|g^*-\lambda^*|\leq h(G,\Lambda)\). Taylor's theorem with remainder gives a point \(\xi\) between \(g^*\) and \(\lambda^*\) such that $$ R(g^*)=R(\lambda^*)+R'(\lambda^*)(g^*-\lambda^*)+\frac{1}{2}R''(\xi)(g^*-\lambda^*)^2. $$ Since \(R'(\lambda^*)=0\), the absolute value of the risk difference is at most \(\frac{M}{2}|g^*-\lambda^*|^2\), which is at most \(\frac{M}{2}h(G,\Lambda)^2\). The grid minimum is no larger than \(R(g^*)\), and no smaller than \(R(\lambda^*)\). These facts give the stated inequality. \(\square\)
The interior condition matters: at a boundary minimum, the derivative need not be zero, so the quadratic argument does not follow as stated. The Lipschitz or Hölder bound remains applicable at a boundary if its own assumptions hold.
Worked Example: Checking the Quadratic Bound
Let \(\Lambda=[0,1]\), \(R(\lambda)=(\lambda-0.37)^2\), and use the grid with spacing \(0.2\) from the previous example. The continuous minimizer is \(\lambda^*=0.37\), an interior point. Differentiating gives \(R'(\lambda)=2(\lambda-0.37)\), so \(R'(0.37)=0\), and \(R''(\lambda)=2\) everywhere. Thus \(M=2\), and the fill distance is \(h=0.1\).
The quadratic theorem bounds the grid regret by \[ \frac{M}{2}h^2=\frac{2}{2}(0.1)^2=0.01. \] The nearest grid point is \(0.4\), whose risk is \((0.4-0.37)^2=0.03^2=0.0009\). The continuous minimum is zero, so the actual grid regret is \(0.0009\), which is indeed no greater than \(0.01\). In contrast, the global derivative bound \(|R'(\lambda)|\leq 1.26\) on this interval would give the looser Lipschitz guarantee \(1.26(0.1)=0.126\).
Adding Validation Estimation Error
In practice, tuning selects a grid point by minimizing a validation estimate \(\hat R(g)\), not the unknown risk \(R(g)\). Grid resolution and validation accuracy contribute separate terms. The following deterministic inequality makes that separation explicit.
Proof. Let \(g^*\) be a grid point nearest to \(\lambda^*\). By the uniform error assumption, selection by \(\hat R\), and that same error assumption again,
Subtract \(R(\lambda^*)\). The Lipschitz grid approximation bound gives \(R(g^*)-R(\lambda^*)\leq Lh(G,\Lambda)\), proving the result. Replacing that bound by the quadratic approximation bound proves the curvature version. \(\square\)
If validation estimates are random, the inequality holds on any event where the stated uniform error bound holds. Thus, a probability statement about \(\varepsilon\) can be combined with the deterministic result without treating the discretization term as validation noise. The uniform error condition is only over the finite grid because only grid points are compared by the selection rule.
Worked Example: Allocating Error Between Grid and Validation
Suppose \(R(\lambda)=(\lambda-0.43)^2\) on \([0,1]\), and a uniform grid includes both endpoints with spacing \(0.05\). The grid has fill distance \(h=0.025\). As before, \(R''(\lambda)=2\), so the grid approximation regret is at most \[ \frac{2}{2}(0.025)^2=0.000625. \] Suppose the observed validation estimates satisfy \(\sup_{g\in G}|\hat R(g)-R(g)|\leq0.01\), and \(\hat\lambda\) minimizes those estimates over the grid. The selection theorem gives \[ R(\hat\lambda)-R(0.43)\leq0.000625+2(0.01)=0.020625. \]
For a check on the grid term, the nearest point is \(0.45\), and its actual risk is \((0.45-0.43)^2=0.0004\), below the bound \(0.000625\). The total guarantee is much larger because it also allows validation error on both the selected point and the nearest grid competitor. Refining the grid reduces the first term, but it does not reduce the \(2\varepsilon\) term unless validation accuracy also improves.
Choosing and Interpreting Grid Resolution
A useful resolution is one for which the approximation term is small relative to the accuracy needed for the tuning decision. Under a Lipschitz bound, halving the fill distance halves the guarantee \(Lh\). Under bounded curvature at an interior optimum, halving the fill distance quarters the guarantee \(\frac{M}{2}h^2\). These are bounds, not promises that every refinement produces a corresponding reduction in observed risk.
The scale on which the hyperparameter is measured matters. A grid uniform in \(\lambda\) and a grid uniform in \(\log(\lambda)\) have different fill distances in the original parameter. If risk changes at a roughly constant rate per multiplicative change in a positive parameter, regularity in \(\log(\lambda)\) may better describe the problem. In that case, state the regularity and fill distance on the transformed scale; do not apply a bound in one scale while silently measuring spacing in another.
A small grid approximation bound requires a credible regularity constant. If no bound on the rate of change is known, a fine grid alone cannot guarantee that it has found a near-optimal value. A continuous risk function can still have a narrow, deep valley between grid points. Regularity is what rules out arbitrarily sharp changes at the resolution of interest.
Common Pitfall
Wrong reasoning: “The grid spacing is small, so the selected value must be nearly optimal.” Spacing alone says only how far a tuning value can be from a grid point. It says nothing about how much risk changes over that distance.
Correction: pair the grid's fill distance with a valid regularity condition and its constant. For example, if risk is \(L\)-Lipschitz, the approximation guarantee is \(Lh\), not simply \(h\). If \(L\) is large, even a small \(h\) may give a weak bound. Also account separately for validation estimation error when the grid point is selected using estimated risk. Finally, do not mistake the gap between adjacent points for fill distance: for an endpoint-including uniform grid, the fill distance is half the gap, while an irregular grid is governed by its largest gap and endpoint coverage.
Check Your Understanding
Answer each question using the definitions and bounds above.
- An endpoint-including uniform grid on an interval has spacing \(0.08\). What is its fill distance, and what Lipschitz approximation bound follows if \(L=5\)?
- Why does a bound on adjacent grid spacing alone not guarantee small grid regret?
- For an interior minimizer with \(|R''(\lambda)|\leq 6\) and fill distance \(h=0.02\), calculate the bounded-curvature regret guarantee.
- If uniform validation error on a grid is at most \(\varepsilon\), why does the selection inequality contain \(2\varepsilon\) rather than \(\varepsilon\)?
- What condition used in the quadratic bound may fail when the risk minimum is at an endpoint?