proxies for generalization: what survives in 1d when generalization gap is explicit?

April 13, 2026

TL;DR. This post closes the first group of posts built around the same 1d classification example. In that example, post 1 showed that useful explanations of generalization cannot ignore the data, and post 2 showed that at interpolation the relevant target is Bayes error plus a disagreement term with the Bayes rule. Here we compare common proxies such as margins, slopes and sharpness against that target. The main point is geometric: most of these quantities measure sensitivity or oscillation of the learned rule, not the mass of the region where its decision disagrees with Bayes. In this toy setting, among networks fitted to the same training data, only the disagreement mass ranks their generalization gaps reliably: the decision-flip count is fixed by the training labels, and slope, margin and sharpness proxies show weak associations at best. This points out a common failure mode of popular proxies: they only track one aspect of the learned rule, and that aspect can be irrelevant to the geometry of generalization in many problems.

This post closes the first group of posts built around the same 1d classification example. In that example, post 1 showed that useful explanations of generalization cannot ignore the data, and post 2 identified the exact quantity that remains at interpolation: Bayes error plus a disagreement term with the Bayes classifier.

That raises a natural question:

do popular complexity measures for generalization say something about the mass of the region where the classifier has the wrong sign, or are they really measuring something else?

All the complexity measures we look at do depend on the learned decision rule, so they are eligible candidates to explain generalization in this setup. In particular, they do not fall in the “data-agnostic” category of post 1. But being an eligible candidate is not the same as tracking the right object.

We stay in the same setup as before:

We train a 1-hidden-layer ReLU net for binary classification. Write its 2d output as $f(x)=(f_1(x),f_2(x))$. Define the logit gap

$$ \Delta(x)=f_2(x)-f_1(x), $$

with predicted label

$$ \hat y(x) = \operatorname{sign}(\Delta(x)). $$

The population error is (proved in the previous post):

$$ \boxed{ \text{population error}(p) = p/2 + (1-p)\,\mathrm{Leb\_wrong}/2 } $$

with the Lebesgue measure of the disagreement set: $\mathrm{Leb\_wrong} = \mathrm{Leb}\{x\in[-1,1]: \operatorname{sign}(\Delta(x))\neq \operatorname{sign}(x)\}$.

This formula is the takeaway of post 2. Once training error is zero, the classifier-dependent part of generalization is controlled by the disagreement region: how much of the interval is predicted with the wrong sign. That is the quantity the proxies should somehow capture.

In more general classification settings, there is no similar easy formula since the Bayes classifier is not tractable. Instead, one falls back on proxies computed from the learned parameters: margins, counts of decision changes, slopes, sharpness, and related quantities.

But in our 1d example, these indirect explanations can be compared directly to the exact Bayes-disagreement formula above.

what do these proxies actually measure, compared with the quantity that really determines generalization here?


usual proxies and their computation

Since we consider a one-hidden-layer ReLU net, many complexity measures are easy to compute. Indeed, each ReLU hidden unit $x\mapsto \max(0,w x+b)$ is piecewise affine with a single breakpoint at

$$ x=-b/w. $$

If we sort these breakpoints, we get a partition of the domain into intervals on which $\Delta$ is affine:

$$ \Delta(x)=m x + c. $$

Computing all these intervals and the corresponding slopes $m$ and intercepts $c$ is easy, and allows to compute many proxies exactly, such as:


two families of proxies

In this setup, most of the proxies we look at fall into one of two broad families.

family A: decision-geometry proxies (about correctness of the decision)

These try to say something meaningful about the geometry of the disagreement set $\{x\in[-1,1]: \operatorname{sign}(\Delta(x))\neq \operatorname{sign}(x)\}$.

family B: scale / landscape proxies (about sensitivity of the decision, not correctness)

These are about “how wild” $\Delta$ is, or how sensitive the parameters are.


which proxies are closest to the right geometry?

A complexity measure should help choose among models trained on the same data: given one training set, which of the networks that fit it will generalize better? So we fix the corruption level at $p=0.4$, fix a training set, train several networks on it, and ask whether a proxy orders them like their generalization gaps.

For networks that interpolate the training set, the formula above becomes

$$ \mathrm{gap}=0.2+0.3\,\mathrm{Leb\_wrong}, $$

so $\mathrm{Leb\_wrong}$ orders them perfectly and serves as a reference.

Before looking at the numbers, we can already expect a rough hierarchy in this 1d setup:


results

We draw 20 training sets of 32 points at $p=0.4$. On each, we train 16 one-hidden-layer ReLU networks with Adam: widths 256 and 1024, initialization scales 0.5 and 2 (multiplying the default initialization), learning rates 0.003 and 0.01, and two random initializations. Training stops at zero training error and cross-entropy at most 0.02, within 200,000 steps.

232 of the 320 networks fit every training label. We keep the training sets with at least 8 such networks: 15 sets, 206 networks. For each training set, we compute the Spearman rank correlation between a proxy and the generalization gap, then average over the 15 training sets. The intervals are 95% bootstrap intervals over training sets.

The proxies, in the notation of the code:

Proxies are sorted by the absolute value of their mean correlation:

proxy mean rank correlation with the gap 95% interval
Leb_wrong (reference) +1.00  
band_mass_γ, all four $\gamma\in\{0.1,0.2,0.5,1\}$ −0.37 to −0.38 [−0.52, −0.22]
Lavg_flip +0.24 [+0.06, +0.42]
normalized band_mass_0.1 −0.19 [−0.40, +0.03]
normalized band_mass_0.2 −0.18 [−0.37, +0.02]
normalized Lavg +0.18 [−0.01, +0.36]
flat_rel −0.14 [−0.35, +0.08]
normalized band_mass_0.5 −0.13 [−0.35, +0.10]
hess_top +0.09 [−0.07, +0.26]
Lavg +0.07 [−0.18, +0.31]
Lmax +0.07 [−0.17, +0.28]
normalized Lmax +0.03 [−0.15, +0.19]
normalized band_mass_1.0 +0.02 [−0.17, +0.21]
normalized margin, 10th percentile +0.02 [−0.23, +0.26]
nb_regions −0.02 [−0.16, +0.12]
normalized margin, minimum +0.01 [−0.22, +0.25]
sam_sharp −0.01 [−0.14, +0.13]
nb_flips constant in 13 of the 15 training sets  

The decision-flip count cannot order the networks. All but two of the 232 interpolating networks change sign exactly once between consecutive training inputs with different labels, and nowhere else. The count is then a property of the training set, identical for all networks fitted to it.

The next picture shows what it misses. Both networks fit the same 32 points with 11 decision boundaries, yet their gaps are 35.3% and 39.7%: the boundaries sit at different places between training points, so the wrong-sign intervals (shaded) have different lengths.

Two networks fitted to the same 32 labeled points, both with 11 decision boundaries, but different lengths of wrong-sign intervals.

The pair with the largest gap difference among networks with the same flip count on the same training set, selected for contrast. Each curve is divided by its own root-mean-square, which changes its vertical scale but not its boundaries.

Raw margin-band mass and the slope at the decision boundaries show modest associations, but they measure different things. The band mass is the length of input where the logit difference is small, in units of the logits. Its association is negative: more input with a small logit difference goes with a smaller gap. It weakens once the logits are divided by their root-mean-square. The slope on the pieces where $\Delta$ crosses zero measures how steeply the decision changes, and its association is positive. Neither says where the boundaries are placed relative to the clean rule, which is what determines the gap. With correlations below 0.4 in absolute value over 15 training sets, neither ranks the networks reliably.

Sharpness, global slopes and the number of pieces show no clear association: their intervals contain zero.

The experiment covers one architecture, one noise level and a small set of hyperparameters, and only the networks that fit every training label. Wider networks and larger initializations reached zero training error more often.

Experiment script · all 320 runs · summary

takeaway

This closes the first group of posts built around understanding generalization in the same 1d classification example.

In that example, we now know the target exactly: at interpolation, the generalization gap equals the population error, namely Bayes error plus a term controlled by the mass of the region where the learned classifier disagrees with the Bayes rule. Most common proxies do not measure that quantity. Slopes measure sensitivity to inputs, margin bands to changes in scores, and sharpness to changes in parameters. The sign-flip count measures how often the prediction changes.

The experiment illustrates that. Among networks fitted to the same training set, only the exact geometric target orders them reliably. The decision-flip count is fixed by the training labels. The more generic proxies show weak associations at best: margin bands and slopes capture different geometric properties of the learned rule, but none of them is the geometry that determines generalization here, namely where the boundaries sit relative to the clean rule.

This is not specific to this 1d example: a fixed proxy only measures one aspect of the learned rule, and that aspect can be irrelevant to many Bayes-disagreement geometries that can arise in more general classification problems.

references

For large-scale studies of how generalization measures correlate with the gap of trained networks:

In this post, several hyperparameters vary at once within each training set, and the Spearman correlations are averaged over the 15 retained training sets, drawn independently from the same distribution. Above all, the gap is known in closed form, so a measure can be compared not only with the gap but with the geometry that determines it.

For the proxies themselves:


cite this post as:

@misc{gonon2026proxies1d,
  title  = {Proxies for Generalization: What Survives in 1d When Generalization Gap Is Explicit?},
  author = {Antoine Gonon},
  year   = {2026},
  url    = {https://dimension-one.github.io/blog/2026-04-13-proxies-generalization-1d/}
}