Skip to content
nonconvexcard

Forgetting and Regularisation

Where the quadratic penalty in elastic weight consolidation comes from, why the Fisher information is the right curvature, and what the derivation assumes that deep networks violate.

Fine-TuningGraduate⏱ 1 hour11 min readcatastrophic forgettingewcfisher informationlaplace approximationregularisation
3 problems →

Fisher information is curvature

TheoremInformation matrix equality

Let {pθ}\lbrace p_\theta \rbrace be a family of densities, smooth in θ\theta, with support not depending on θ\theta and with differentiation under the integral sign permitted twice. Define the Fisher information

F(θ)=Ex∼pθ ⁣[∇θlog⁡pθ(x) ∇θlog⁡pθ(x)⊤].F(\theta) = \E_{x\sim p_\theta}\!\left[\nabla_\theta \log p_\theta(x)\,\nabla_\theta\log p_\theta(x)^\top\right].

Then

F(θ)=− Ex∼pθ ⁣[∇θ2log⁡pθ(x)].F(\theta) = -\,\E_{x \sim p_\theta}\!\left[\nabla^2_\theta \log p_\theta(x)\right].

Assumptions

The regularity conditions are doing real work: fixed support, and the exchange of ∇\nabla with ∫\int. Note also that both expectations are under the model pθp_\theta, not under the data distribution. When the model is misspecified the two sides differ, and the discrepancy is exactly what the sandwich (robust) covariance corrects for.

Key idea

The Fisher is the expected curvature of the negative log-likelihood. So FiiF_{ii} large means the old task's loss rises steeply when weight ii moves — the weight is load-bearing. Fii≈0F_{ii}\approx 0 means the loss is flat in that direction and the weight can be repurposed at no cost. It is also positive semidefinite by construction, being an expectation of outer products, which is what makes the penalty below a sensible convex pull.

From Bayes to a quadratic penalty

PropositionThe elastic-weight-consolidation objective

Let θA⋆\theta^\star_A be a mode of the posterior p(θ∣DA)p(\theta \mid \mathcal D_A). Approximating that posterior by a Gaussian via a second-order expansion at θA⋆\theta^\star_A, the maximum a posteriori objective for the combined data DA∪DB\mathcal D_A \cup \mathcal D_B becomes, up to additive constants,

min⁡θ  LB(θ)  +  λ2(θ−θA⋆)⊤F(θ−θA⋆),\min_{\theta}\; \mathcal L_B(\theta) \;+\; \frac{\lambda}{2}\big(\theta-\theta^\star_A\big)^\top F\big(\theta-\theta^\star_A\big),

where LB\mathcal L_B is the negative log-likelihood of DB\mathcal D_B and FF the Fisher information at θA⋆\theta^\star_A.

Derivation

  1. log⁡p(θ∣DA,DB)=log⁡p(DB∣θ)+log⁡p(θ∣DA)+const.\log p(\theta \mid \mathcal D_A, \mathcal D_B) = \log p(\mathcal D_B\mid\theta) + \log p(\theta\mid\mathcal D_A) + \text{const}.

    Conditional independence of the two datasets given the parameters.

  2. log⁡p(θ∣DA)≈log⁡p(θA⋆∣DA)−12(θ−θA⋆)⊤HA(θ−θA⋆),\log p(\theta\mid\mathcal D_A) \approx \log p(\theta^\star_A\mid\mathcal D_A) - \tfrac12(\theta-\theta^\star_A)^\top H_A (\theta-\theta^\star_A),

    with HA=−∇2log⁡p(θ∣DA)∣θA⋆⪰0H_A = -\nabla^2 \log p(\theta\mid\mathcal D_A)\big|_{\theta^\star_A} \succeq 0.

    Second-order Taylor expansion of the old-task log posterior at its mode; the linear term vanishes there.

  3. For a flat prior and nAn_A observations, HA≈nAF(θA⋆)H_A \approx n_A F(\theta^\star_A) by the theorem above. Absorbing nAn_A and the prior strength into a single hyperparameter λ\lambda gives HA=λFH_A = \lambda F.

    Identify the curvature with the Fisher using the information matrix equality.

  4. min⁡θ LB(θ)+λ2(θ−θA⋆)⊤F(θ−θA⋆).■\min_\theta\ \mathcal L_B(\theta) + \frac{\lambda}{2}(\theta-\theta^\star_A)^\top F (\theta-\theta^\star_A). \qquad\blacksquare

    Negate to turn maximisation into minimisation.

In practice FF is replaced by its diagonal, giving the familiar per-weight form

LB(θ)+λ2∑iFii(θi−θA,i⋆)2.\mathcal L_B(\theta) + \frac{\lambda}{2}\sum_i F_{ii}\big(\theta_i - \theta^\star_{A,i}\big)^2 .

What low rank buys

PropositionLow rank bounds how far the function can move

Let a layer compute x↦W0xx \mapsto W_0 x and be adapted to x↦(W0+αrBA)xx\mapsto (W_0 + \tfrac\alpha r BA)x. Then for every input xx,

∥(W0+αrBA)x−W0x∥2 ≤ αr ∥B∥2 ∥A∥2 ∥x∥2,\big\|(W_0 + \tfrac{\alpha}{r}BA)x - W_0x\big\|_2 \ \le\ \frac{\alpha}{r}\,\|B\|_2\,\|A\|_2\,\|x\|_2 ,

so weight decay on AA and BB directly limits the layer's deviation from the pretrained function.

Empirical observationNarrow fine-tuning degrades unrelated capability

Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.

Fine-tuning a general model on a narrow distribution reliably reduces measured performance on capabilities the base model previously had, with degradation increasing in the number of steps and the learning rate, and decreasing when a fraction of general data is mixed into the fine-tuning set.

Open problem

Open problem — no proof and no counterexample is known to the author of this page.

There is no quantitative theory predicting how much a given fine-tuning run will forget. Inputs to such a theory would include the divergence between the fine-tuning and pretraining distributions, the optimisation trajectory, and the geometry of the pretrained solution — and no current account combines them into a prediction that can be checked before training. Practitioners run the evaluation suite before and after, which is the honest method available.

References

  • PaperJ. Kirkpatrick et al. (2017). Overcoming Catastrophic Forgetting in Neural Networks
  • ChapterM. McCloskey, N. Cohen (1989). Catastrophic Interference in Connectionist Networks: The Sequential Learning ProblemThe original identification of the phenomenon, three decades before it mattered commercially.

These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.

Results stated on this page

  • TheoremInformation matrix equalityproof includedUnder regularity, the Fisher information equals the expected Hessian of the negative log-likelihood, so the Fisher is curvature.
  • PropositionThe elastic-weight-consolidation objectiveproof includedA Laplace approximation to the posterior from the first task turns sequential learning into the new task's loss plus a Fisher-weighted quadratic pull toward the old weights.
  • PropositionLow rank bounds how far the function can moveproof includedA rank-r adapter changes any layer's output by at most the adapter's spectral norm times the input norm, giving an explicit and controllable deviation budget.
  • Empirical observationNarrow fine-tuning degrades unrelated capabilityFine-tuning on a narrow distribution measurably reduces performance on tasks the base model previously handled, with the loss growing with steps and learning rate.

Problems (3)

All problems