AI Research Library

Regularisation and Stable Explanations

Rajesh Ranjan Mahapatra

Regularisation improves unseen performance when it suppresses variation the task declares irrelevant, steering training towards predictors that survive perturbations rather than merely fit samples.

© 2026 Rajesh Ranjan Mahapatra. 32 min read

Regularisation and Stable Explanations

Regularisation improves unseen performance when it suppresses variation the task declares irrelevant, steering training towards predictors that survive perturbations rather than merely fit samples.

TLDR

  1. Regularisation is a choice among explanations. It favours predictors whose behaviour changes little under selected perturbations, even when more fragile predictors fit the training data equally well.
  2. Weight decay, noise, augmentation and early stopping act on different objects: parameter scale, local sensitivity, input invariance and the order in which training absorbs spectral directions.
  3. The useful engineering question is not “which regulariser is standard?” It is “which variation is unsupported, and what evidence shows that suppressing it matches deployment?”
  4. The strongest boundary is a wrong invariance. A transformation, penalty or stopping rule can erase rare but valid signal, improve average error and still worsen the group or case that matters.
  5. Release decisions should use a regularisation contract: named perturbations, matched baselines, interaction ablations, subgroup checks and a negative control where the proposed stability should fail.

Twelve dots and two convincing stories

Place twelve noisy measurements on a graph. A flexible model can draw a blue curve through almost every point. A second model draws a calmer green curve that misses several observations by a small amount. Inside the measured interval, the blue account looks more faithful. Just beyond it, the blue curve swings sharply while the green curve continues the broad pattern.

Nothing in the training error alone tells us which curve is the better explanation. The data permit both. The difference appears only after we ask what should remain stable when one observation moves, when the input is perturbed slightly, or when the fitting procedure continues for another thousand steps. Generalisation begins where the training sample stops deciding.

Regularisation supplies an extra decision rule. It can prefer smaller parameters, average over noisy pathways, train on transformed examples, or interrupt optimisation before weak directions are fully fitted. These moves are often described as reducing overfitting. That phrase names the symptom, not the mechanism. Each intervention declares that some variation is less trustworthy than another.

The central claim of this paper is precise: regularisation helps when its declared stability matches the task’s true nuisance structure. It hurts when the suppressed variation contains real, consequential signal. The same technique can therefore improve mean test accuracy, damage a minority group, and still look successful if the evaluation does not expose the disagreement.

One training fit, two futures

Illustrative thought experiment
Two functions fit the same observations but differ outside the observed interval A jagged indigo curve and a smooth teal curve pass near twelve training points. In a shaded unseen region, the indigo curve becomes unstable while the teal curve continues smoothly. unseen region fragile fit stable fit observations
Figure 1. Both curves are compatible with the observed points. The unseen region exposes the extra assumption: the teal predictor changes smoothly, while the indigo predictor spends capacity following sample-specific variation. Geometry and values are illustrative.

Part I: A fit does not choose its explanation

Let a training set be S = {(xᵢ, yᵢ)}, sampled from an unknown process. Training usually minimises empirical risk, the average loss on those observed pairs. The quantity we care about is population risk, the expected loss on future pairs from the relevant operating distribution. The gap between them is not a moral defect called overfitting. It is the cost of selecting a predictor from finite evidence.

The adjacent article Optimisation, Approximation and Guarantees asks whether the trained objective bridges to the decision that matters. The narrower question here begins when that objective permits several credible fits: which explanation should the learning procedure prefer?

RS(θ) = (1/n) Σᵢ ℓ(fθ(xᵢ), yᵢ)
θ̂ = arg minθ [RS(θ) + λ Ω(θ)]
Symbols: fθ is the predictor, ℓ is the loss, Ω is a chosen penalty, and λ controls how much the penalty influences selection. Raising λ does not make a model universally simpler. It makes one declared notion of complexity more expensive.

Classical capacity stories say that a larger hypothesis class can fit more accidental patterns. That remains useful, but modern neural networks complicate it. Large networks can fit random labels, showing that architectural capacity alone does not explain why they generalise on natural labels. Interpolating models can also enter a second regime where test error falls again, and minimum-norm interpolators can achieve low risk under specific data spectra. These results do not abolish regularisation. They remove the lazy equation “zero training error equals bad explanation”.

The relevant object is the combination of model, data, optimisation and stopping rule. Gradient descent does not inspect every parameter vector equally. Augmentation changes the empirical distribution. Dropout trains a stochastic family of subnetworks. Weight decay modifies the update. Early stopping changes how far the optimiser travels. A regulariser is part of the learning algorithm, not decorative insurance attached afterwards.

Published evidence

Zhang and colleagues showed that common deep networks can fit random labels, challenging explanations based only on effective capacity. Belkin and colleagues described double descent, while Bartlett and colleagues characterised benign overfitting for minimum-norm linear regression under stated spectral conditions. These are boundaries on simple capacity rhetoric, not claims that regularisation is obsolete.

Hypothesis basins under declared constraints

Signature figure, conceptual
A landscape of equally low training loss with regularisation steering toward a stable basin Several contour basins have similar training loss. Arrows labelled decay, noise, augmentation and early stopping steer trajectories toward a teal region representing stable predictions under declared perturbations. unconstrained path weight decay noise / augmentation early stopping sample-sensitive basin stable under contract Many parameter regions can have similar training loss. The contract changes which region is reachable or preferred.
Figure 2. The signature geometry is a selection landscape, not a claim that neural-network loss surfaces literally have two basins. Regularisers alter the objective, data, stochastic path or stopping time. The teal region means stable under specified perturbations, not universally correct.

The stability contract

A useful unifying idea comes from algorithmic stability. Informally, a learning algorithm is stable when replacing or removing one training example changes its loss on another example only slightly. Bousquet and Elisseeff formalised several versions of this idea and connected them to generalisation bounds. Hardt, Recht and Singer later analysed stochastic gradient methods through the same lens, showing how fewer iterations can promote stability under their assumptions.

This does not prove that every successful deep model is stable in one universal metric. It gives a disciplined causal question: what perturbation should leave the learned function mostly unchanged? A practical answer needs four fields.

  1. Perturbation: name the change, such as one replaced sample, small input noise, a crop, a missing pathway, a parameter rescaling or additional training steps.
  2. Invariant: state what should remain the same, such as the class label, calibrated probability, ranking, or decision inside a tolerance.
  3. Scope: identify where the invariant applies. A rotation may preserve an object category while changing a digit, a road sign or a medical orientation.
  4. Consequence: set the acceptable error by subgroup, region and action cost. Average stability can hide a fragile rare case.

The stability contract is the paper’s original decision instrument. It turns “regularise more” into a falsifiable statement. The intervention should reduce sensitivity to declared nuisance variation, preserve sensitivity to valid signal, and improve the operating metric under a matched test. If it merely lowers a norm or smooths a chart, the causal burden remains unmet.

A minimal worked example: the serial number that predicts temperature

Imagine a tiny building dataset with two standardised inputs. xt is a calibrated thermometer reading. xs is a numerical encoding of the sensor’s serial batch. The target y is the independently measured room temperature. In the training building, older sensors happen to be installed in colder rooms, so xs and xt are almost the same direction.

Two linear predictors can now tell nearly indistinguishable training stories. Predictor A uses ŷ = xt. Predictor B uses ŷ = 0.5xt + 0.5xs. Because the two inputs are highly correlated in the sample, both have low empirical error. Predictor B even has the smaller Euclidean coefficient norm: about 0.71 rather than 1. A plain L2 penalty can therefore prefer the mixed explanation, despite the serial batch being a historical accident rather than a cause of room temperature.

Move the model to a second building where new and old devices are distributed across all rooms. Predictor A continues to follow temperature. Predictor B now moves when serial batch changes, even if the physical reading and true temperature do not. The failure was not visible in the original loss because the sample never varied the two candidate causes independently.

The decisive test is an intervention on one feature. Hold xt and y fixed, then permute valid serial batches across records. Predictor A is invariant. Predictor B changes by half the serial perturbation. That function-level sensitivity reveals the unsupported explanation more directly than its parameter norm. A targeted augmentation could train on these permutations, or the data collection plan could deliberately include warm rooms with old sensors and cold rooms with new ones.

Now change one fact. Suppose serial batch identifies a documented calibration offset that the raw reading has not yet corrected. Randomising the batch would erase valid information. The same permutation moves from a useful nuisance test to a wrong-invariance attack. The regulariser becomes justified only after the role of the feature is settled inside the task boundary.

This small case explains why the four levers cannot be ranked in the abstract. Weight decay sees coefficient geometry and may choose the wrong mixture. Noise on the thermometer may damage the trusted signal. Early stopping may first learn the dominant correlated direction, which also mixes both inputs. A semantically targeted augmentation can separate them, but only if the serial truly is irrelevant. Regularisation works through a declared model of variation, not through an automatic preference for simpler-looking parameters.

Stability is a selection criterion, not truth

A constant predictor is perfectly stable under sample replacement, input noise and augmentation. It is also useless whenever the target varies. A shortcut can be stable under the perturbations chosen by the team while failing under an untested change. Stability can rule out a fragile explanation; it cannot establish that the surviving explanation is correct.

A complete evaluation therefore asks three separate questions. Does the predictor achieve acceptable loss on representative operating cases? Does it remain steady under changes declared irrelevant? Does it remain appropriately sensitive, or equivariant, when a target-relevant feature changes? The last question is the natural negative image of invariance. A credit-risk score should be insensitive to document compression artefacts, yet responsive to a verified change in income or indebtedness. Passing only the first half can produce a smooth system that ignores evidence.

Calibration adds another independent burden. Two predictors can have the same classification stability while attaching different confidence to their answers. The more confident one may create larger downstream harm when both are wrong. For this reason, the consequence field in the contract names the decision metric and tolerance rather than treating unchanged class labels as sufficient.

The paper’s claim is consequently narrower than “stable models generalise”. Regularisation is useful when it helps select a predictor whose invariances and sensitivities agree with the task, and when that selection improves independent outcome evidence. Stability is the mechanism under test; correctness, calibration and consequence remain release conditions.

Four regularisers stabilise four different objects

Conceptual map
A circular map of parameter, pathway, input and training-time stability A central predictor is surrounded by four arcs. Weight decay acts on parameters, noise on pathways and local sensitivity, augmentation on input transformations, and early stopping on the training trajectory and spectral directions. learned predictor parameter scaleweight decay input orbitaugmentation training pathearly stopping pathway sensitivitynoise / dropout
Figure 3. The methods share an aim but not a mechanism. Treating them as interchangeable obscures their assumptions and interactions. Geometry is conceptual; the four axes are the stability contract proposed here.
The argument in one passChart · flow
flowchart LR
  A["Twelve dots and two convincing<br/>stories"] --> B["Part I, A fit does not choose<br/>its explanation"]
  B --> C["Part II, Four levers, four<br/>stability contracts"]
  C --> D["Part III: The regularisation<br/>lab and its negative control"]
  D -. "re-test" .-> A
  classDef first fill:#0a1424,stroke:#007D68,stroke-width:2px,color:#e6f3ff
  classDef step fill:#0a1424,stroke:#3f7da0,stroke-width:1px,color:#e6f3ff
  class A first
  class B,C,D step
A structural route through Regularisation and Stable Explanations, from Twelve dots and two convincing stories to Source ledger. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Part II: Four levers, four stability contracts

Weight decay: make unsupported directions expensive

For ordinary gradient descent, adding an L2 penalty produces an update that shrinks every parameter before following the data gradient. If η is the learning rate and λ the decay strength, the update is approximately:

θt+1 = (1 − ηλ) θt − η ∇RS(θt)
Increasing λ pulls parameters towards zero more strongly. In linear models, this suppresses weakly supported directions and can reduce variance from noisy targets. Krogh and Hertz gave an early neural-network account of these effects.

Small coefficients can be a useful proxy for a stable function when features share a meaningful scale. The proxy becomes unreliable when parameterisations have symmetries. Two ReLU networks can represent the same function while carrying very different layer norms. Dinh and colleagues showed that equivalent reparameterisations can make minima arbitrarily sharper without changing generalisation. The same caution applies to raw weight magnitude: parameter geometry is evidence about the function only after scale and symmetry are controlled.

Optimiser choice also matters. With standard stochastic gradient descent, L2 regularisation and multiplicative weight decay align closely. In adaptive optimisers, adding an L2 term to the loss is not generally the same as decaying weights directly because coordinates are rescaled by the optimiser. AdamW was introduced to decouple the two operations. A configuration record should therefore state the actual update rule, not merely “L2 used”.

A smaller parameter vector is a proxy, not the explanation

Mechanism and counterexample
Weight decay trajectory and scale-equivalent neural-network parameters On the left, a trajectory moves toward a lower-norm solution. On the right, two differently scaled parameter pairs implement the same ReLU function, showing why raw norm is not a universal function-complexity measure. Shrinkage in a scaled feature space decay favours a lower-norm region Scale symmetry in a ReLU path Path A2 3 Path B20 0.3 ReLU(2x) × 3 = ReLU(20x) × 0.3 same function, different raw layer norms
Figure 4. Weight decay can select useful low-norm solutions in a meaningful coordinate system. Deep networks also contain rescaling symmetries, so raw norm and parameter-space sharpness should not be treated as universal explanations. The numbers are illustrative.

Noise and dropout: tax local sensitivity and co-dependence

Injecting small random noise changes the objective from performance at one point to expected performance in a neighbourhood. For squared error and sufficiently small input noise, a Taylor expansion adds a term related to derivatives of the learned mapping. Bishop showed the connection to Tikhonov regularisation. The intuitive result is simple: a predictor that changes violently around each observation pays more expected loss.

Eε[ℓ(f(x + ε), y)] ≈ ℓ(f(x), y) + (σ²/2) Tr(Hxℓ)
ε is zero-mean isotropic noise with covariance σ²I; Hₓℓ is the input-space curvature of the loss. Larger noise samples a wider neighbourhood. The approximation is local and depends on smoothness and the noise model.

Dropout applies the idea to internal pathways. Each update sees a thinned network, so a useful representation cannot rely completely on one fragile coalition of units. The original dropout paper interpreted testing as an efficient approximation to averaging many thinned networks. Wager, Wang and Liang connected dropout to adaptive regularisation in generalised linear models. These accounts overlap, but they are not identical guarantees for arbitrary deep architectures.

The failure mode is equally clear. Noise is helpful only when the sampled neighbourhood mostly preserves the target. Too much input noise blurs a narrow feature. Too much activation noise can reduce capacity or destabilise optimisation. In sequential control, stochastic policies can also change the data the system encounters. Noise regularises the neighbourhood it samples, whether or not that neighbourhood is meaningful.

Noise converts a point fit into a neighbourhood test

Local mechanism
A narrow loss valley and a broad valley under random perturbations Noise samples around the current solution. Samples in a narrow valley climb high loss walls, while samples in a broad valley remain low, so expected noisy loss favours the broader local solution. high sensitivity lower local sensitivity loss parameter or input perturbation
Figure 5. Under the selected perturbation distribution, the broad local solution has lower expected loss. This is an intuition for local smoothing, not proof that visual flatness in raw parameter coordinates explains deep-network generalisation.

Data augmentation: write invariance into the training distribution

Augmentation replaces each observed example with an orbit of transformed examples. A crop, translation, colour change, paraphrase or simulated sensor perturbation says that the label should survive that transformation. The objective becomes an expectation over transformations T sampled from an augmentation policy:

Raug(θ) = (1/n) Σᵢ ET∼q(T|xᵢ) [ℓ(fθ(T(xᵢ)), yᵢ)]
q(T|x) is the transformation distribution. Its support is an encoded belief about which changes preserve the target. Broader support creates stronger invariance and a larger risk of crossing the true label boundary.

Mixup extends this idea by training on convex combinations of examples and labels. AutoAugment searches over augmentation policies. These methods can improve benchmark performance, but their success does not make augmentation semantics-free. An automated search optimises a validation objective inside a particular data regime. It cannot decide whether a rotation, crop or colour change is legally, clinically or operationally irrelevant.

Thought experiment: the mirrored hand

Train two image classifiers on photographs of gloves. The first task predicts material: leather or fabric. The second predicts handedness: left or right. Apply the same horizontal flip to both datasets. In the material task, the flip plausibly preserves the label. In the handedness task, it reverses the label. Only one causal feature changed, but the augmentation moved from useful invariance to systematic label noise.

Now make the case less obvious. Suppose a document classifier uses page orientation. Rotating a scan by two degrees may represent scanner noise; rotating it by ninety degrees may hide a layout cue that distinguishes a form from a letter. The correct policy is task-conditional and often subgroup-conditional. Augmentation is a claim about the world, not a free multiplication of data.

An augmentation orbit can cross the true boundary

Intervention and counterexample
Valid transformations stay within a label orbit while an invalid transformation crosses the boundary A central glove icon is connected to brightness, crop and small rotation variants inside a teal region. A horizontal mirror variant lies across a coral boundary for a handedness task. true label boundary original brightness small rotation crop mirror changes handedness
Figure 6. A transformation is valid only relative to the target. The same horizontal flip preserves material and reverses handedness. The diagram is illustrative; the boundary must be established from domain semantics and tested data.

Early stopping: learn strong directions before weak ones

Early stopping regularises through time. In linear least squares, gradient descent decomposes along the singular directions of the feature matrix. Directions with large singular values are learned quickly. Weak directions accumulate slowly and often contain more noise. Stopping after a finite number of steps acts like a frequency-dependent filter rather than a uniform penalty.

coefficient learned after t steps ∝ 1 − (1 − ηs²)t
s is a singular value of the design matrix. A larger s makes the factor approach one quickly; a small s remains suppressed for longer. Training time therefore becomes a regularisation parameter.

Prechelt’s empirical study made validation-based stopping systematic and exposed the trade between training time and generalisation. Stability analyses later supplied formal interpretations under smoother assumptions. Recent work on discrete gradient descent for least squares shows an equivalence between finite-time solutions and a generalised ridge problem under broad learning-rate schedules, while also identifying conditions where early stopping is not beneficial.

The caveat matters. Neural networks learn features as well as coefficients, so a fixed spectral story is incomplete. Late training can sometimes improve generalisation, as grokking illustrates. A noisy validation set can select the wrong checkpoint, and repeated tuning can overfit the validation split. Early stopping is a hypothesis about learning order, not a law that later knowledge is always worse.

Training time is a spectral gate

Formal intuition
High, medium and low singular directions are learned at different speeds Three saturation curves rise over training time. The strong direction rises quickly, the medium direction more slowly, and the weak direction remains low at an early-stopping line. early checkpoint strong direction medium direction weak direction training steps fraction learned
Figure 7. In linear least squares, early stopping filters eigendirections according to their singular values and the learning-rate schedule. The curves are illustrative. Feature-learning networks can depart from this fixed-basis account.

Interactions: regularisers are not additive checkboxes

These interventions can substitute for, amplify or obstruct one another. Strong augmentation may already control the variance that weight decay was meant to suppress. Decay can change optimisation speed, so a stopping rule tuned without it may stop at a different functional state. Dropout changes gradient noise and effective learning rate. Batch normalisation introduces scale symmetries that alter how decay acts. Golatkar, Achille and Soatto found that weight decay and augmentation can matter most during early learning, with much smaller effects when introduced near convergence.

The practical implication is methodological. Compare each intervention against a matched baseline, then run removal and timing ablations. A result from “all regularisers on” cannot identify which assumption earned the gain. It can also hide a harmful component behind a stronger helpful one.

Part III: The regularisation lab and its negative control

The executable lab makes the argument small enough to inspect. It samples eighteen noisy observations from a smooth public synthetic function and fits a degree-twelve polynomial in a Legendre basis. The unregularised model trains for 8,000 gradient steps. Four alternatives change one mechanism: stop after 300 steps, apply weight decay, jitter the inputs, or combine mild versions.

The test set is a dense grid from the known synthetic target. This is not a benchmark and does not estimate real-world performance. It is a controlled specimen: every method sees the same observations, basis and evaluation distribution. The positive case asks whether the interventions suppress high-frequency sample noise. The negative case adds a narrow but genuine bump around x = 0.25, then applies aggressive jitter while keeping labels fixed. That augmentation now encodes a false invariance.

Scenario and methodTraining MSETest MSEFocal-region MSEWeight normInterpretation
Smooth, full convergence0.03300.08330.01561.971Best training fit among the smooth cases, poor unseen curve.
Smooth, early stopping0.03940.02370.01901.529Weak directions remain partly suppressed.
Smooth, weight decay0.03540.02170.01311.642Lower-norm selection improves the matched target.
Smooth, input jitter0.03530.02330.01021.698Local smoothness matches the target.
Smooth, combined0.03640.01520.01081.610Mild, compatible biases work together here.
Rare feature, full convergence0.04200.09730.16502.307Reference for the negative control.
Rare feature, aggressive jitter0.14800.12240.19011.758Smoother and lower norm, but less faithful to real signal.
Worked example

In the smooth case, every regularised configuration has higher training error than the long unregularised run and lower test error. In the negative control, aggressive jitter reduces the weight norm but worsens both overall and focal-region error. The lab therefore blocks the false inference that smoothness or small norm is valuable by itself.

Interactive regularisation laboratory

Executable browser artefact
Interactive fit of regularised and unregularised polynomial models The chart compares the true synthetic function, an unregularised full-convergence reference, the current regularised configuration, and noisy training observations.
-current train MSE
-current test MSE
-reference test MSE
-focal-region MSE
Run the experiment to compare the declared stability with the unregularised reference.
Figure 8. Synthetic, deterministic browser experiment. The positive preset uses a smooth target and mild compatible regularisation. The negative preset adds a narrow real feature and applies aggressive jitter that falsely treats nearby inputs as label-equivalent.
Recorded Python output and assumptions

The companion script uses Python 3.10 or later and only the standard library. The target, observations, random generator, hyperparameters and assertions are all contained in the source. Expected final line: Assertions passed: useful stability helps; invalid invariance hurts.

#!/usr/bin/env python3
"""Regularisation and stable explanations: synthetic laboratory.

Python 3.10+. Standard library only.

The lab fits a degree-12 Legendre polynomial to noisy one-dimensional data.
It compares convergence without explicit regularisation, early stopping,
weight decay, input-jitter augmentation, and a combined intervention.
A second scenario is a negative control: it contains a narrow, real feature.
Aggressive input jitter violates the label-preserving assumption and must hurt.

All data, thresholds and results are synthetic teaching fixtures, not benchmarks.
"""

from __future__ import annotations

from dataclasses import dataclass
import math
from typing import Iterable


class DeterministicRNG:
    """Small deterministic generator shared with the browser artefact."""

    def __init__(self, seed: int = 7) -> None:
        self.state = seed & 0xFFFFFFFF

    def uniform(self) -> float:
        self.state = (1664525 * self.state + 1013904223) & 0xFFFFFFFF
        return self.state / 2**32

    def normal(self) -> float:
        u1 = max(self.uniform(), 1e-12)
        u2 = self.uniform()
        return math.sqrt(-2.0 * math.log(u1)) * math.cos(2.0 * math.pi * u2)


def target(x: float, scenario: str) -> float:
    """Underlying public synthetic target function."""
    y = math.sin(math.pi * x) + 0.3 * x
    if scenario == "rare_feature":
        y += 1.2 * math.exp(-((x - 0.25) / 0.055) ** 2)
    return y


def legendre_features(x: float, degree: int) -> list[float]:
    """Numerically calmer polynomial basis than raw powers of x."""
    values = [0.0] * (degree + 1)
    values[0] = 1.0
    if degree >= 1:
        values[1] = x
    for k in range(2, degree + 1):
        values[k] = (
            (2 * k - 1) * x * values[k - 1] - (k - 1) * values[k - 2]
        ) / k
    return values


def make_dataset(
    scenario: str,
    *,
    seed: int = 7,
    n: int = 18,
    observation_noise: float = 0.20,
) -> tuple[list[float], list[float]]:
    rng = DeterministicRNG(seed)
    xs = sorted(-1.0 + 2.0 * rng.uniform() for _ in range(n))
    if scenario == "rare_feature":
        # The negative control contains observed evidence for the narrow feature.
        xs = sorted(xs[:-3] + [0.20, 0.25, 0.30])
    ys = [target(x, scenario) + observation_noise * rng.normal() for x in xs]
    return xs, ys


def train(
    xs: list[float],
    ys: list[float],
    *,
    degree: int = 12,
    steps: int = 8_000,
    learning_rate: float = 0.04,
    weight_decay: float = 0.0,
    input_jitter: float = 0.0,
    seed: int = 71,
) -> list[float]:
    """Full-batch gradient descent with optional decay and jitter augmentation."""
    rng = DeterministicRNG(seed)
    weights = [0.0] * (degree + 1)
    n = len(xs)

    for _ in range(steps):
        gradient = [0.0] * (degree + 1)
        for x, y in zip(xs, ys, strict=True):
            if input_jitter:
                x_used = max(-1.0, min(1.0, x + input_jitter * rng.normal()))
            else:
                x_used = x
            features = legendre_features(x_used, degree)
            prediction = sum(w * p for w, p in zip(weights, features, strict=True))
            error = prediction - y
            for j, feature in enumerate(features):
                gradient[j] += 2.0 * error * feature / n

        for j in range(degree + 1):
            gradient[j] += 2.0 * weight_decay * weights[j]
            weights[j] -= learning_rate * gradient[j]

    return weights


@dataclass(frozen=True)
class Result:
    scenario: str
    method: str
    training_mse: float
    test_mse: float
    focal_region_mse: float
    weight_norm: float


def predict(weights: Iterable[float], x: float, degree: int = 12) -> float:
    return sum(
        w * p
        for w, p in zip(weights, legendre_features(x, degree), strict=True)
    )


def evaluate(
    scenario: str,
    method: str,
    xs: list[float],
    ys: list[float],
    weights: list[float],
    *,
    degree: int = 12,
) -> Result:
    training_mse = sum(
        (predict(weights, x, degree) - y) ** 2 for x, y in zip(xs, ys, strict=True)
    ) / len(xs)

    total_error = 0.0
    focal_error = 0.0
    focal_count = 0
    grid_size = 1001
    for i in range(grid_size):
        x = -1.0 + 2.0 * i / (grid_size - 1)
        error = (predict(weights, x, degree) - target(x, scenario)) ** 2
        total_error += error
        if 0.15 < x < 0.35:
            focal_error += error
            focal_count += 1

    return Result(
        scenario=scenario,
        method=method,
        training_mse=training_mse,
        test_mse=total_error / grid_size,
        focal_region_mse=focal_error / focal_count,
        weight_norm=math.sqrt(sum(value * value for value in weights)),
    )


def run_method(
    scenario: str,
    method: str,
    *,
    steps: int,
    weight_decay: float,
    input_jitter: float,
) -> Result:
    xs, ys = make_dataset(scenario)
    weights = train(
        xs,
        ys,
        steps=steps,
        weight_decay=weight_decay,
        input_jitter=input_jitter,
    )
    return evaluate(scenario, method, xs, ys, weights)


def main() -> None:
    smooth_configs = (
        ("full convergence", 8_000, 0.0, 0.0),
        ("early stopping", 300, 0.0, 0.0),
        ("weight decay", 8_000, 0.005, 0.0),
        ("input jitter", 8_000, 0.0, 0.04),
        ("combined", 1_000, 0.003, 0.025),
    )
    smooth_results = [
        run_method(
            "smooth",
            name,
            steps=steps,
            weight_decay=decay,
            input_jitter=jitter,
        )
        for name, steps, decay, jitter in smooth_configs
    ]

    negative_baseline = run_method(
        "rare_feature",
        "full convergence",
        steps=8_000,
        weight_decay=0.0,
        input_jitter=0.0,
    )
    negative_augmented = run_method(
        "rare_feature",
        "aggressive jitter",
        steps=8_000,
        weight_decay=0.0,
        input_jitter=0.18,
    )

    print("Synthetic smooth-target case")
    print("method             train MSE   test MSE   focal MSE   ||w||")
    for result in smooth_results:
        print(
            f"{result.method:<18} "
            f"{result.training_mse:>9.4f} "
            f"{result.test_mse:>10.4f} "
            f"{result.focal_region_mse:>11.4f} "
            f"{result.weight_norm:>7.3f}"
        )

    print("\nNegative control: narrow real feature")
    print("method             train MSE   test MSE   focal MSE   ||w||")
    for result in (negative_baseline, negative_augmented):
        print(
            f"{result.method:<18} "
            f"{result.training_mse:>9.4f} "
            f"{result.test_mse:>10.4f} "
            f"{result.focal_region_mse:>11.4f} "
            f"{result.weight_norm:>7.3f}"
        )

    baseline = smooth_results[0]
    assert all(result.test_mse < baseline.test_mse for result in smooth_results[1:])
    assert negative_augmented.test_mse > negative_baseline.test_mse
    assert negative_augmented.focal_region_mse > negative_baseline.focal_region_mse
    print("\nAssertions passed: useful stability helps; invalid invariance hurts.")


if __name__ == "__main__":
    main()

A serious negative control: interpolation can be benign

A regularisation argument is weak if its baseline is designed to fail. Modern theory supplies a stronger control: some interpolating solutions generalise well because the optimiser selects a favourable minimum-norm or spectrally aligned solution. In such regimes, explicit decay may add little, and stopping early may interrupt useful learning. The question is no longer whether the model reached zero training error. It is which interpolator was selected and how its error aligns with the data covariance.

This observation weakens any universal claim that regularisation improves generalisation by reducing capacity. It does not weaken the stability-contract claim. A benign interpolator can itself be stable under the relevant perturbations, or can allocate fitting error to low-signal directions whose population cost is small. The empirical test remains the same: perturb the data, inputs and training path, then measure function change where consequence lives.

Worked scenario: the scanner watermark

Consider a composite document-classification scenario. A model distinguishes payslips from bank statements. In the training set, most payslips came from scanner A and most statements from scanner B. A faint corner watermark therefore predicts the label. The text and layout also carry valid evidence, but they require a more complex representation.

The team adds crops, contrast jitter and weight decay. Average validation accuracy rises. On documents from a newly introduced scanner, performance improves because the watermark is no longer dependable. The intervention appears successful. A subgroup review then finds that a small payroll provider prints a compact code in the same corner. Aggressive cropping removes a valid issuer cue and worsens that provider’s error.

The correct conclusion is not that cropping failed. It is that the original augmentation policy bundled two assumptions: scanner watermarks are nuisance, and all corner content is nuisance. The first was supported; the second was false for one subgroup. A production regulariser should be evaluated as a targeted intervention on a named shortcut, not as a generic accuracy enhancer.

Average improvement can hide a subgroup reversal

Synthetic production-shaped scenario
Heatmap of document classifier error across scanner groups before and after augmentation Average error falls after regularisation, and error on a new scanner falls sharply. Error for a small payroll provider rises because cropping removes a valid corner code. BeforeAfter crop + decay Scanner A majorityScanner B majorityNew scannerSmall payroll provider 6.2% 7.1% 18.4% 5.0% 4.8% 5.2% 8.1% 12.6% valid corner code removed Weighted average error8.4%6.1%
Figure 9. Synthetic percentages for a worked scenario, not deployment results. The aggregate improves from 8.4% to 6.1%, while the small-provider error rises from 5.0% to 12.6%. The example shows why perturbation and subgroup evidence belong in the release gate.
Published boundary evidence

Sagawa and colleagues showed that overparameterisation can improve average error while hurting minority-group error under spurious correlations. Balestriero and colleagues reported class-dependent effects from regularisation and augmentation. These results support subgroup evaluation; they do not establish that any specific augmentation will repair a specific shortcut.

Part IV: Turn regularisation into an experimental contract

A production training recipe often begins as inheritance: use weight decay because the reference configuration used it, use augmentation because the benchmark did, and stop when validation loss rises. That can be a sensible starting point. It is not yet an explanation. The release decision should record why each intervention belongs to this task and what observation would remove it.

InterventionObject stabilisedRequired assumptionPositive signatureNegative controlFailure trigger
Weight decayParameter directions under a declared scalingLower norm corresponds to less sample-sensitive function behaviourLower perturbation sensitivity and test risk at matched optimisationRescale an equivalent network or standardise featuresNorm falls without functional stability, calibration or subgroup gain
Input noiseLocal input neighbourhoodNoise samples realistic nuisance variationStable predictions under measured sensor or feature noiseInsert a narrow valid featureFocal-region error rises or labels change inside the noise ball
DropoutInternal pathways and co-dependenceRedundant routes should support the taskReduced pathway-ablation sensitivity at acceptable capacityUse a task requiring a sparse, unique pathwayOptimisation destabilises or rare capability disappears
AugmentationTransformation orbit of inputsTransformations preserve target semanticsGain on held-out transformations and target shiftsChoose a transformation that should reverse the labelClass, subgroup or region reversals appear
Early stoppingTraining path and slow directionsLate-learned directions are less reliable than early onesValidation and perturbation performance peak before convergenceUse a task with delayed but valid structureLater checkpoints improve independent test evidence or grokking appears

A release protocol that can fail

  1. Name the nuisance. “Prevent overfitting” is too broad. Specify scanner noise, sample replacement, colour variation, pathway loss, weak covariance directions or another perturbation.
  2. Define the invariant and tolerance. State which output should remain stable and how much movement is acceptable for average, worst-group and high-consequence cases.
  3. Build a matched baseline. Hold architecture, data budget, optimiser family and tuning budget constant. Separate optimisation improvement from regularisation benefit.
  4. Sweep one mechanism at a time. Record learning curves, norms, perturbation sensitivity and subgroup metrics. Then add interaction ablations for combined recipes.
  5. Run the wrong-invariance control. Include a case where the transformation or smoothing should damage valid signal. A mechanism that never fails is probably not being tested.
  6. Inspect time. Apply, remove or delay the regulariser. If only early exposure matters, the mechanism differs from a final-loss explanation.
  7. Measure function change, not only proxy change. Lower norm, flatter coordinates or smoother embeddings are intermediate evidence. Evaluate predictions under declared perturbations.
  8. Release with a removal condition. State what drift, subgroup reversal or causal test would trigger retuning, narrowing or deleting the regulariser.
Practitioner synthesis

Use the weakest intervention that reliably suppresses a measured nuisance while preserving valid sensitivity. A model with slightly worse average accuracy can be preferable when it has better worst-group error, calibration and perturbation evidence. Conversely, a lower norm or earlier checkpoint should not win merely because it looks conservative.

The tuning procedure itself needs a contract. Trying fifty augmentation strengths and reporting the best validation score gives that family fifty chances to fit quirks in the validation set. A baseline granted only three trials is not a matched competitor. Equalise search budgets, preserve an untouched test or temporal holdout, and report the dispersion across seeds and selected hyperparameters. Otherwise the apparent regularisation gain may be selection overfitting performed one level above the model.

Selection evidence should also follow consequence. When the release criterion is worst-group recall, choosing the checkpoint on average loss can silently optimise the wrong objective. The monitored metric, stopping patience and tie-break rule are part of the learning algorithm. A regularised model is the output of the entire selection procedure, not merely a set of weights trained with a penalty.

What would weaken the stability account?

The proposed explanation would lose force if matched experiments repeatedly found that improved unseen performance arrived without improved stability under any task-relevant perturbation, while more unstable predictors won under independent shifts and subgroup tests. It would also weaken if a claimed regulariser helped only by fixing optimisation, such as preventing exploding activations, with no evidence of a selection effect after training quality was matched.

That possibility should remain open. Regularisation is a family name covering penalties, stochastic training, data design and stopping rules. Some methods can improve conditioning, calibration, margin, ensemble averaging or representation learning through mechanisms not captured by one stability measure. The contract is therefore an experimental frame, not a complete theory of deep-network generalisation.

Explicit failure boundary

The mechanism breaks when the declared perturbation removes information needed by the target, when the deployment distribution lies outside the tested perturbation family, or when proxy stability is measured in a coordinate system unrelated to functional behaviour. Regularisation cannot manufacture evidence for an invariant that the domain does not support.

Architecture and governance consequences

The argument changes three practical decisions. First, data augmentation policy becomes part of the task specification and data contract, not merely a training script. Domain owners should approve transformations that encode semantic invariance, especially for regulated or safety-relevant labels.

Second, training lineage should record regulariser type, strength, timing and optimiser semantics. “Weight decay 0.01” is incomplete without exclusions, schedule and update rule. “Early stopped” is incomplete without monitored metric, patience, checkpoint selection policy and the number of tuning attempts against the validation set.

Third, evaluation should preserve perturbation suites and subgroup slices as release evidence. A model update can keep headline accuracy while changing which explanation it relies on. Re-running the stability contract makes that change visible before production drift does.

How the claim changes under pressureChart · state
stateDiagram-v2
  [*] --> Claim
  state "One training fit, two futures" as Claim
  state "Hypothesis basins under<br/>declared constraints" as Test
  state "The stability contract" as Revision
  Claim --> Test: expose mechanism
  Test --> Decision: evidence survives
  Test --> Revision: rival survives
  Revision --> Claim: narrow or rebuild
  Decision --> [*]
The revision loop begins with One training fit, two futures and keeps counterexamples inside the reasoning path. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Compact glossary

Algorithmic stability
Limited change in the learned predictor or loss after a bounded change to the training sample.
Explicit regularisation
A declared penalty or training intervention, such as weight decay, dropout or augmentation.
Implicit regularisation
Selection bias introduced by architecture, initialisation, optimiser, learning rate, batch structure or stopping time without an explicit penalty term.
Invariance
A target property that should remain unchanged under a specified transformation.
Equivariance
A target property that should change in a predictable way when the input transforms.
Benign overfitting
Interpolation of the training data with low population error under particular data and algorithm conditions.
Optional derivation: why early stopping filters spectral directions

For least squares with design matrix X, write the singular-value decomposition as X = UΣVᵀ. Gradient descent updates each coordinate in the right-singular basis independently. Starting from zero with a constant learning rate, the coordinate associated with singular value sⱼ is multiplied by the filter 1 − (1 − ηsⱼ²)ᵗ after t steps. Large singular directions approach their fitted value quickly. Small directions remain shrunk. Ridge regression uses a different filter, sⱼ² / (sⱼ² + λ), but both reduce weak directions. The equivalence is exact only in restricted settings; feature learning, adaptive optimisers and non-quadratic loss complicate it.

Regularise the instability you can name

Regularisation does not rescue a model by making it modest. It chooses which variations the learner should distrust. Weight decay distrusts some parameter directions. Noise distrusts local sensitivity. Augmentation distrusts changes inside a proposed transformation orbit. Early stopping distrusts directions that require more optimisation time to acquire.

The decision is defensible only when that distrust has a domain meaning and an empirical test. Start with the nuisance, not the technique. Declare what should remain invariant, where the claim stops, and which rare signal must survive. Then compare matched learners, inject the proposed perturbation, and include a case where the same intervention ought to fail.

The changed architecture decision is straightforward: regularisation settings belong in the evidence-bearing task contract, alongside data semantics, optimiser behaviour, subgroup outcomes and release conditions. A stable explanation is not the smoothest one available. It is the one that remains steady under irrelevant change and remains responsive to the change that matters.

The evidence conversationChart · sequence
sequenceDiagram
  participant Q as Question
  participant M as Mechanism
  participant E as Evidence
  participant D as Decision
  Q->>M: Twelve dots and two convincing stories
  M->>E: One training fit, two futures
  E-->>M: compare rival explanations
  E->>D: Source ledger
  D-->>Q: revise scope or act
Question, mechanism, evidence and decision exchange the burdens developed in Regularisation and Stable Explanations. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Source ledger

  1. Primary theory: Olivier Bousquet and André Elisseeff, “Stability and Generalization”, JMLR. Defines stability notions and connects them to generalisation bounds.
  2. Primary mechanism: Anders Krogh and John Hertz, “A Simple Weight Decay Can Improve Generalization”, NeurIPS. Analyses suppression of irrelevant components and target noise in stated settings.
  3. Primary mechanism: Christopher Bishop, “Training with Noise is Equivalent to Tikhonov Regularization”, Neural Computation. Derives a local regularisation interpretation for input noise.
  4. Primary method and analysis: Nitish Srivastava and colleagues, “Dropout: A Simple Way to Prevent Neural Networks from Overfitting”, JMLR; Stefan Wager, Sida Wang and Percy Liang, “Dropout Training as Adaptive Regularization”, NeurIPS.
  5. Primary optimisation result: Moritz Hardt, Ben Recht and Yoram Singer, “Train faster, generalize better: Stability of stochastic gradient descent”, ICML.
  6. Primary stopping study: Lutz Prechelt, “Early Stopping, but when?”, Neural Networks: Tricks of the Trade.
  7. Recent primary analysis: Rishi Sonthalia and colleagues, “On Regularization via Early Stopping for Least Squares Regression”. Analyses discrete trajectories, generalised ridge equivalence and conditions for benefit or non-benefit.
  8. Primary optimiser distinction: Ilya Loshchilov and Frank Hutter, “Decoupled Weight Decay Regularization”, ICLR.
  9. Primary augmentation methods: Hongyi Zhang and colleagues, “mixup: Beyond Empirical Risk Minimization”, ICLR; Ekin Cubuk and colleagues, “AutoAugment: Learning Augmentation Strategies From Data”, CVPR.
  10. Primary timing results: Aditya Golatkar, Alessandro Achille and Stefano Soatto, “Time Matters in Regularizing Deep Networks”, NeurIPS; Alethea Power and colleagues, “Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets”.
  11. Negative result: Chiyuan Zhang and colleagues, “Understanding deep learning requires rethinking generalization”, ICLR.
  12. Negative result: Laurent Dinh and colleagues, “Sharp Minima Can Generalize For Deep Nets”, ICML.
  13. Modern interpolation results: Mikhail Belkin and colleagues, “Reconciling modern machine-learning practice and the classical bias-variance trade-off”, PNAS; Peter Bartlett and colleagues, “Benign overfitting in linear regression”, PNAS.
  14. Group-shift boundary: Shiori Sagawa and colleagues, “An Investigation of Why Overparameterization Exacerbates Spurious Correlations”, ICML.
  15. Class-dependent boundary: Randall Balestriero, Ishan Misra and Yann LeCun, “The Effects of Regularization and Data Augmentation are Class Dependent”.