advanced29 min studyLesson 754 in Mathematics

Rademacher complexity and contraction

Measure a class’s ability to align with random signs and transfer that control through Lipschitz losses.

On this page

What you’ll understand

  • Distinguish empirical sign averages from their expectation over training inputs.
  • Compute a two-point empirical Rademacher complexity exactly.
  • Apply contraction with explicit Lipschitz scope and normalization conventions.

A class can be large yet unable to fit arbitrary fluctuations on the inputs actually observed. Rademacher complexity probes that ability by attaching independent random signs and asking how strongly the class can correlate with them. It is an average supremum, with a normalization that must be stated. Confusing the sign randomness with new training data, or changing an absolute-value convention without changing constants, leads to misleading bounds.

Separate the sample and the auxiliary signs

Fix a sample of inputs and attach independent signs taking values plus and minus one with equal probabilities. The empirical Rademacher complexity averages, over those signs, the largest normalized signed sum obtainable by a function in the class. The sample is held fixed in this definition. Its population counterpart then averages over the random training inputs. We use the supremum without an absolute value; introducing an absolute value instead corresponds to symmetrizing the class and can change constants or finite-class counts.

For finite or countable classes, assume measurable evaluations; for more general classes explicitly assume the relevant suprema are measurable. Bounded losses make the expectations needed for elementary symmetrization finite. A ghost-sample argument bounds the expected one-sided uniform population-to-empirical deviation of a bounded loss class by twice its population Rademacher complexity. This is an expectation statement. A high-probability certificate needs an additional concentration step and its confidence penalty, rather than reinterpreting an average as an event that always occurs.

R^S(F)=Eσsup⁡f∈F1n∑i=1nσif(xi),Rn(F)=ESR^S(F)\widehat{\mathfrak R}_S(F)=\mathbb E_\sigma\sup_{f\in F}\frac1n\sum_{i=1}^{n}\sigma_i f(x_i),\qquad \mathfrak R_n(F)=\mathbb E_S\widehat{\mathfrak R}_S(F)
The signs are independent of the fixed input sample; this convention places no absolute value inside the supremum.↔ Scroll wide equations horizontally.

Norm control can replace a raw parameter count

For linear scores with a Euclidean weight norm at most B, the supremum becomes B times the norm of the signed sum of inputs, divided by n. Jensen and cancellation of cross terms bound its expectation by B times the square root of the sum of squared input norms, divided by n. If each input norm is at most R, this is at most BR divided by the square root of n. The bound does not explicitly depend on ambient dimension, but the norm constraints are substantive assumptions.

A larger dimension can still worsen these radius quantities, or permit a different class if the norm budget changes. Thus a dimension-free-looking expression is not a universal promise that more features are harmless. The two-point calculation below keeps the feature vectors and the weight interval explicit. Its exact value can be smaller than the Jensen upper bound because the norm of the random sum fluctuates. That gap is a cost of the inequality, not an inconsistency in the complexity definition.

R^S(FB)=BnEσ∥∑iσixi∥2≤Bn∑i∥xi∥22,FB={x↦⟨w,x⟩:∥w∥2≤B}\widehat{\mathfrak R}_S(F_B)=\frac Bn\mathbb E_\sigma\left\|\sum_i\sigma_i x_i\right\|_2\le\frac Bn\sqrt{\sum_i\|x_i\|_2^2},\qquad F_B=\{x\mapsto\langle w,x\rangle:\|w\|_2\le B\}
This empirical linear-class estimate assumes finite-dimensional Euclidean inputs; bounded input norms give the further BR/sqrt(n) bound.↔ Scroll wide equations horizontally.

Lipschitz composition transfers complexity, not calibration

For coordinatewise L-Lipschitz maps that vanish at zero, the scalar contraction principle bounds the Rademacher complexity of the transformed vectors by L times that of the original class, in the no-absolute-value convention used here. For a nonlinear loss, verify the Lipschitz constant on every score value the class can attain; a local derivative estimate at one fitted point is insufficient. Squared loss is not globally Lipschitz on unrestricted scores, though it is Lipschitz on a specified bounded score-and-label range.

Contraction controls fluctuation size, but it does not say a surrogate loss targets the desired decision problem. A constant loss has zero complexity and teaches no classifier. Calibration, approximation error and optimization error require separate arguments. When the loss also depends on fixed sample labels, one may apply coordinate maps to the margin scores with those labels held fixed, provided their Lipschitz requirements hold. This is how a useful score-class bound can become a loss-class bound without pretending that all losses have the same geometry.

Four sign assignments give an exact answer

For x₁=1,x₂=2 and F={x↦wx:−1≤w≤1}, compute empirical Rademacher complexity. Then compose every score with phi(t)=t/2.

  1. For fixed signs the supremum is ∣σ1+2σ2∣/2|\sigma_1+2\sigma_2|/2, because w can choose the sign of the sum and has magnitude at most one.

  2. The four sign pairs give absolute sums 3,1,1,3. Their average is 2, and dividing by sample size two gives empirical complexity 1.

  3. Scaling by 1/2 gives complexity 1/2 exactly. The original linear-class Jensen bound is 12+22/2=5/2≈1.11803\sqrt{1^2+2^2}/2=\sqrt5/2\approx1.11803, above the exact value one.

The result

The exact empirical complexities are 1 and 0.5; the norm bound is valid but not exact in this sample.

Explore the model

Interactive lab

Interactive lab · network

A Lipschitz transformation has a gain budget

Pause and Reset, then set input x = 0.50 and weight w = 1. The displayed sigmoid has logit 0 and output 0.5; as a function of x its global derivative magnitude is at most|w|/4=0.25. Reset and set both x = 0.25 and w = 2: logit and output remain 0 and 0.5, but the global gain bound becomes 0.5. This instrument is one fixed sigmoid computation, not a Rademacher-complexity estimator or a trained model.

A Lipschitz transformation has a gain budgetOne inspectable sigmoid unit, σ(wx − 0.5). Playback traces the computation graph. There is no training, attention mechanism or hidden deep network. Current readings: Product · wx: 1.2; Logit · wx − 0.5: 0.7; Sigmoid output: 0.6682. All parameters are adjustable with the labeled controls below.One input. One weight. One sigmoid.x1.20× w1.20+ b0.70σ0.668output0.668w = 1.00b = −0.50σ(z) = 1 / (1 + exp(−z))
Computation graphSignal trace
Product · wx
1.2
Logit · wx − 0.5
0.7
Sigmoid output
0.6682
t = 0 s

One inspectable sigmoid unit, σ(wx − 0.5). Playback traces the computation graph. There is no training, attention mechanism or hidden deep network. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA transformation’s global Lipschitz budget can change while its output at one chosen input stays the same.

Check your understanding

A zero-anchored scalar map is 0.25-Lipschitz on the entire score range. What does contraction certify under the stated convention?

Try it yourself

For x₁=x₂=1 and weights in[−2,2], compute the exact empirical Rademacher complexity. Compare with the linear norm bound.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

The signed sum takes values 2,0,0,−2. Optimize the weight separately for each sign realization, then average.

Compare with the solution

For each sign pair the supremum is 2∣σ1+σ2∣/2=∣σ1+σ2∣2|\sigma_1+\sigma_2|/2=|\sigma_1+\sigma_2|. The four values are 2,0,0,2, whose mean is one. The norm upper bound is 212+12/2=2≈1.414212\sqrt{1^2+1^2}/2=\sqrt2\approx1.41421. The exact complexity is therefore one, below the bound. Keeping the weight radius two is important: replacing it by one would halve both quantities. The calculation conditions on these two inputs and averages only over auxiliary signs, not over a distribution of possible training samples.

Take it with you

  • Empirical complexity conditions on inputs and averages over independent signs.
  • Linear-class norm budgets can control complexity without counting parameters.
  • Contraction needs a valid Lipschitz range and does not replace surrogate calibration.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.