Rademacher complexity and contraction
Measure a class’s ability to align with random signs and transfer that control through Lipschitz losses.
On this page
The question for today
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.
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.
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.
Work it through
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.
For fixed signs the supremum is , because w can choose the sign of the sum and has magnitude at most one.
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.
Scaling by 1/2 gives complexity 1/2 exactly. The original linear-class Jensen bound is , above the exact value one.
The exact empirical complexities are 1 and 0.5; the norm bound is valid but not exact in this sample.
The living notebook
Explore the model
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.
- Product · wx
- 1.2
- Logit · wx − 0.5
- 0.7
- Sigmoid output
- 0.6682
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.
Pause & reason
Check your understanding
Your turn
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 . The four values are 2,0,0,2, whose mean is one. The norm upper bound is . 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.
Keep the idea
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.