betaFeedback

WorksComputer Science

Does Learning Order Explain Forgetting? The Lie Bracket as an Early-Warning Signal for Catastrophic Forgetting Without Old Data

Abstract

A network trained on task A and then task B ends at different weights than one trained on B and then A. To leading order this gap is set by the Lie bracket of the two tasks' gradient fields, and Dherin (2023) conjectured that a non-vanishing bracket may be linked to catastrophic forgetting. I test this conjecture empirically. Across Split MNIST, Split Fashion-MNIST and Split CIFAR-10, the forgetting of A is almost exactly the difference in A's loss between the two training orders (Spearman rho = 0.96-1.00). I then ask whether the bracket can predict that forgetting early in training on B and without any of A's data, using only a small summary stored when A finishes: its gradient and its top 20 Hessian eigenpairs. When the old task is well learned and forgetting is slow (task-incremental), this stored bracket ranks forgetting with rho = 0.70-0.81, against 0.33-0.58 for the penalty of Elastic Weight Consolidation, and matches or exceeds re-evaluating A on its own data. When forgetting is fast (domain-incremental), the stored summary goes stale and the EWC penalty is as good or better. The bracket fails outright when the old task is only half learned; I trace this to a residual gradient on A an order of magnitude larger, which makes first-order (slope) damage matter. The bracket is therefore a useful early-warning signal for the quiet kind of forgetting, under a clear condition.

Introduction

Neural networks trained on a sequence of tasks lose performance on earlier ones, a problem known as catastrophic forgetting ([14, 10]). It matters most for models that keep learning after deployment, such as a crop-disease classifier that is taught a new disease or a clinical model updated with data from a new region. In those settings the old data is often no longer available, for reasons of privacy, data agreements or storage, so the damage cannot simply be measured by re-testing.

Forgetting comes in two practical forms. In some settings it is fast: accuracy on the old task collapses within a few update steps, and any monitor that looks at the old task catches it. In others it is slow: each update removes a little, the loss is easy to miss, and it accumulates. The slow case is where an early, data-free warning would be most useful, and it is where existing signals are weakest.

This paper studies one candidate signal. Gradient descent on two losses does not commute: training on AA then BB and training on BB then AA end at different weights. For small steps the difference is governed by the Lie bracket of the two gradient fields. Dherin [5] derived this bracket as a correction term in the modified flow of sequential training and conjectured that it may be linked to catastrophic forgetting, but did not test the link. I test it, and I ask a practical question the conjecture does not address: can the bracket be estimated without the old task’s data, and is it then a better predictor of forgetting than the penalty of Elastic Weight Consolidation (EWC), the standard data-free method?

Contributions.

  • Order explains forgetting. In two-task learning on three datasets, the forgetting of AA matches the order gap on AA’s loss almost exactly (ρ=0.96\rho= 0.96–1.001.00; § 5.1).

  • A data-free bracket. I compute the bracket from a stored summary of AA (gradient plus top-KK Hessian eigenpairs) and the current task’s data. For slow forgetting on well-learned tasks it outperforms the EWC penalty on all three datasets, by 0.23 to 0.41 in rank correlation (§ 5.2).

  • An honest boundary. For fast forgetting the result is mixed, and three attempts to repair the stored bracket did not beat EWC on CIFAR-10 features (§ 5.3).

  • A measured failure condition. The bracket fails when the old task is half learned. I show the cause is a residual gradient on AA that is an order of magnitude larger relative to BB’s, and that learning AA properly restores the bracket (§ 5.4).

I study prediction only. Using the bracket to reduce forgetting is left to future work.

Background and related work

The bracket and order. Smith et al. [21] and Dherin [5] analyse SGD by backward error analysis. For two consecutive steps on losses L1L_1 and L2L_2, Dherin [5] shows that the modified flow contains a term proportional to the Lie bracket of the two gradient fields, and conjectures a link to catastrophic forgetting. That work is theoretical and contains no experiments. The same bracket has been used to study training order: Rukhovich et al. [18] use it to analyse how the order of domains affects a target loss in multi-domain learning, and Sweeney [22] uses its projection onto a target gradient to predict which of two orders transfers better. Neither studies forgetting of an earlier task or compares against EWC. Bell and Lawrence [1] show empirically that task order changes how much is forgotten.

Second-order views of forgetting. EWC ([10]) penalises movement of weights in proportion to a diagonal Fisher estimate, and Synaptic Intelligence ([26]) accumulates a similar importance online. Yin et al. [25] show that such regularisers can be read as second-order Taylor approximations of the old loss. Mirzadeh et al. [15] use the same expansion around the old task’s minimum to relate forgetting to curvature, dropping the gradient term under the assumption that training has converged. My stored Taylor estimate baseline is this expansion with the gradient term kept; § 5.4 shows that the dropped term is exactly what matters when the old task is not well learned. Doan et al. [6] analyse forgetting through the overlap of task kernels, and Hidekel and Raviv [9] give a closed-form predictor of forgetting under a neural-tangent linearisation. Ramasesh et al. [17] study where in the network forgetting arises.

First-order methods. GEM and A-GEM ([13, 2]), OGD ([7]), GPM ([19]) and selective projection ([20]) constrain each update using stored gradients, gradient subspaces or examples. They mitigate forgetting and use first-order information. The bracket is a second-order quantity, and here it is used to predict rather than to mitigate. Chaudhry et al. [3] show that very small replay memories are surprisingly effective, which motivates my tiny-buffer variant.

Method

Setting and the order gap

Let LAL_A and LBL_B be the losses of two tasks, with gradients gA,gBg_A,g_B and Hessians HA,HBH_A,H_B. Starting from an initialisation θ0\theta_0, I train on AA to reach θA\theta_A, then on BB to reach θAB\theta_{AB}, using plain SGD with learning rate η\eta. The forgetting of AA is the rise in its test loss,

ΔLA=LAtest(θAB)−LAtest(θA).(1)\Delta L_A = L_A^{\mathrm{test}}(\theta_{AB}) - L_A^{\mathrm{test}}(\theta_A). \tag*{(1)}

Training in the opposite order gives θBA\theta_{BA}. The order gap on AA is LAtest(θAB)−LAtest(θBA)L_A^{\mathrm{test}}(\theta_{AB}) - L_A^{\mathrm{test}}(\theta_{BA}).

Proposition 1 (Order gap of one step). Let θAB\theta_{AB} be the result of one gradient step on LAL_A followed by one on LBL_B from θ\theta, and θBA\theta_{BA} the result of the opposite order. Then

θAB−θBA=η2[A,B](θ)+O(η3),[A,B](θ)=HB(θ)gA(θ)−HA(θ)gB(θ).(2)\theta_{AB}-\theta_{BA}=\eta^2[A,B](\theta)+O(\eta^3),\qquad[A,B](\theta)=H_B(\theta)g_A(\theta)-H_A(\theta)g_B(\theta). \tag*{(2)}

The proof is a first-order Taylor expansion of the second gradient in each order. [A,B][A,B] is the Lie bracket of the negative gradient fields −∇LA-\nabla L_A and −∇LB-\nabla L_B, the quantity in Dherin [5]. I verified Eq. (2) numerically on every model: the ratio of measured to predicted gap is between 0.99 and 1.00 for η≤0.01\eta\le0.01 (Appendix § 10). Proposition 1 is exact only for one small step. Whether a quantity defined this way says anything about hundreds of stochastic steps is an empirical question, and it is the subject of this paper.

Signals

All signals are evaluated at the current weights θ\theta during the first steps of training on BB. I use the Euclidean norm of the bracket as a scalar signal. Hessian–vector products are computed by double backpropagation ([16]), so no Hessian is ever formed.

Stored summary. When training on AA ends I store SA={θA,gA(θA),(λk,uk)k=1K,FA}\mathcal{S}_A=\{\theta_A,g_A(\theta_A),(\lambda_k,u_k)_{k=1}^{K},F_A\}: the weights, the gradient of AA, the top K=20K=20 eigenpairs of HA(θA)H_A(\theta_A) found by Lanczos iteration, and the diagonal empirical Fisher (used only by the EWC baseline). Writing H^A=∑kλkukukT\widehat{H}_A=\sum_k\lambda_k u_k u_k^{\mathsf{T}} and δ=θ−θA\delta=\theta-\theta_A, the summary gives a local model of AA’s gradient, g^A(θ)=gA(θA)+H^Aδ\widehat{g}_A(\theta)=g_A(\theta_A)+\widehat{H}_A\delta. AA’s data is then discarded.

Signals that use no old data.

Stored bracket (proposed):

b(θ)=∥HB(θ)g^A(θ)−H^AgB(θ)∥,(3)b(\theta)=\left\|H_B(\theta)\widehat{g}_A(\theta)-\widehat{H}_A g_B(\theta)\right\|, \tag*{(3)}

EWC penalty:

e(θ)=∑iFA,iδi2,(4)e(\theta)=\sum_i F_{A,i}\delta_i^2, \tag*{(4)}

Stored Taylor estimate:

t(θ)=gA(θA)Tδ+12∑kλk(ukTδ)2.(5)t(\theta)=g_A(\theta_A)^{\mathsf{T}}\delta+\frac{1}{2}\sum_k\lambda_k\left(u_k^{\mathsf{T}}\delta\right)^2. \tag*{(5)}

In Eq. (3), HBH_B and gBg_B use the current task’s data, which is available by definition. Eq. (4) is the quantity EWC adds to the loss ([10]); I use it as a predictor, not as a regulariser. Eq. (5) estimates the rise in AA’s loss directly.

Reference signals that use old data. The full bracket ∥[A,B](θ)∥\|[A,B](\theta)\| uses AA’s data at the current weights. Re-evaluation is the change in AA’s training loss, LA(θ)−LA(θA)L_A(\theta)-L_A(\theta_A), the most direct monitor when old data is kept. These are not competitors of the data-free signals. They show what the old data would buy and separate failures of the bracket from failures of the summary.

Protocol

Each signal is recorded at steps 5, 10, 15, 20 of training on BB and averaged. Training on BB lasts roughly 370 to 470 steps, so the signals see about the first 5%. For every setting I run all 20 ordered pairs of five tasks with 5 seeds, giving 100 runs, and report the Spearman rank correlation ρ\rho between a signal and ΔLA\Delta L_A. A signal with ρ=1\rho=1 ranks the runs by forgetting perfectly; it need not be calibrated in magnitude. Confidence intervals are 95% percentile bootstrap intervals over runs (10,000 resamples), and differences between signals are bootstrapped on the same resamples. Runs that share a seed or a task are not independent, so the intervals are approximate; I therefore also report per-seed agreement.

Experimental setup

Tasks. I use Split MNIST ([12]), Split Fashion-MNIST ([24]) and Split CIFAR-10 ([11]). Each dataset is split into five binary tasks by pairing classes in label order (classes 0/1, 2/3, and so on).

Two scenarios. Following van de Ven and Tolias [23], I use a task-incremental scenario (Task-IL), in which the network has ten outputs and the loss is restricted to the two outputs of the current task, and a domain-incremental scenario (Domain-IL), in which all tasks share the same two outputs. In my experiments these give slow and fast forgetting respectively (Table 1), and I use the terms interchangeably. The two properties are confounded here; I return to this in § 6.

SetupInputModelAccuracyForgetting, % mean (max)
MNISTpixels (784)MLP 256–2560.9891.3 (7.1)35.0 (85.2)
Fashion-MNISTpixels (784)MLP 256–2560.9900.9 (8.9)19.8 (46.5)
CIFAR-10 featuresfrozen ResNet-18 (512)MLP 256–2560.9730.7 (3.5)18.6 (46.2)
CIFAR-10 CNNpixels (3 × 32 × 32)small CNN0.7764.1 (14.1)21.2 (43.4)

Table 1. The four setups. Accuracy is the mean test accuracy of a task after it is trained alone. Forgetting is the mean (maximum) drop in A’s test accuracy after training on B, at η=0.05\eta= 0.05.

Models and training. The MLP has two hidden layers of 256 tanh units (about 2.7×1052.7 \times10^{5} parameters on pixels). For CIFAR-10 features, each image is passed once through a ResNet-18 (He et al., [8]) pretrained on ImageNet (Deng et al., [4]) and frozen; the same MLP is trained on the 512-dimensional output (about 2.0×1052.0 \times10^{5} parameters). Forgetting and all signals are measured on the MLP only. The CIFAR-10 CNN has two 3×33 \times3 convolutional layers (16 and 32 channels, tanh, average pooling) and a 64-unit hidden layer (about 1.4×1051.4 \times10^{5} parameters). I use tanh and average pooling so that the loss is twice differentiable. All models are trained with plain SGD without momentum, batch size 64 and learning rate 0.05 unless stated, for 2 epochs per task (MNIST, Fashion-MNIST) or 3 (CIFAR-10). I use plain SGD because Proposition 1 is derived for memoryless updates. Gradients, Hessian–vector products and the summary are estimated on a fixed subset of 2,000 training examples per task.

Well-learned and half-learned tasks. The first three setups reach 97–99% mean accuracy, and at least 94% on every task. The small CNN reaches only 78% and does not improve with twice the training (Appendix § 14). I keep it as a deliberate contrast: the same images, with the old task well learned (features) or half learned (CNN).

Results

Forgetting is an order effect

Table 2 compares forgetting with the order gap on A. On every setup and in both scenarios the two rank the runs almost identically (ρ=0.96\rho= 0.96–1.00) and have nearly the same size (ratio 1.00–1.20). The explanation is simple: when A is learned last it ends near its own optimum, so the difference between the two orders is the damage done to A by learning B after it. A ratio above one means that learning A after BB ends slightly better than learning AA alone. This result is close to true by construction, and I report it for that reason: it shows that in this setting predicting forgetting and predicting the order effect are the same problem. The remaining question is whether the bracket, which describes the order effect for one step, tracks it over a whole training run. Rows 3–4 show that it does when the old task is well learned (ρ=0.68\rho= 0.68–0.830.83 with the order gap on AA) and does not on the half-learned CNN (0.03 and 0.29).

MNISTFashion-MNISTCIFAR-10 featuresCIFAR-10 CNN (half learned)
Forgetting vs. order gap on A1.00 / 1.000.99 / 1.000.99 / 1.000.96 / 0.99
Order gap ÷ forgetting1.04 / 1.001.00 / 1.001.00 / 1.001.20 / 1.05
Bracket vs. order gap on A0.83 / 0.690.68 / 0.690.79 / 0.810.03 / 0.29
Bracket vs. weight gap0.66 / 0.69−0.06 / 0.580.54 / 0.480.16 / 0.39

Table 2. Order test (η=0.05\eta= 0.05, 3 seeds, 60 runs per cell; slow / fast). Row 1: rank correlation between forgetting ΔLA\Delta L_A and the order gap on A. Row 2: ratio of their mean absolute values. Rows 3–4: rank correlation of the full bracket, averaged over the first 20 steps of B, with the order gap on A and with the weight gap ∥θAB−θBA∥\lVert\theta_{AB} - \theta_{BA} \rVert.

Figure 1. (a) Training in the two orders ends at different weights; for one small step the gap is η2[A,B]\eta^2[A,B]. (b) A single Split MNIST run in the Domain-IL scenario. Accuracy on the old task falls from 99% to about 16% while the new task is learned within tens of steps, and the norm of the bracket jumps at the switch.

Slow forgetting: the stored bracket outperforms EWC without old data

Figure 2 and Table 3 (top) give the main result. On the three well-learned setups the stored bracket ranks forgetting with ρ=0.81\rho= 0.81, 0.70 and 0.76, against 0.58, 0.33 and 0.35 for the EWC penalty. The differences, +0.23, +0.37 and +0.41, have bootstrap intervals that exclude zero, and the bracket has the higher correlation in all 15 seed-level comparisons (5 seeds on each of 3 datasets). The stored bracket is also as good as the full bracket computed with old data (0.82, 0.74, 0.76), so in this regime the 20-direction summary loses little.

Figure 2. Slow forgetting (Task-IL), η=0.05\eta= 0.05, 100 runs per setup. Rank correlation of each signal with forgetting; bars show 95% bootstrap intervals. The first three signals use no old data. The hatched bar re-evaluates the old task on its own data and is shown for reference.

MNISTFashion-MNISTCIFAR-10 featuresCIFAR-10 CNN (half learned)
Slow forgetting (Task-IL)
Stored bracket (proposed)0.81 [0.70, 0.88]0.70 [0.56, 0.81]0.76 [0.64, 0.84]−0.12 [−0.31, 0.08]
EWC penalty0.58 [0.42, 0.71]0.33 [0.16, 0.48]0.35 [0.13, 0.55]0.22 [0.03, 0.39]
Stored Taylor estimate0.67 [0.52, 0.79]0.31 [0.10, 0.51]0.58 [0.40, 0.72]0.32 [0.12, 0.49]
Full bracket{sup}†`0.82 [0.72, 0.88]0.74 [0.61, 0.84]0.76 [0.65, 0.84]−0.11 [−0.30, 0.09]
Re-evaluation{sup}†`0.81 [0.71, 0.87]0.33 [0.11, 0.53]0.68 [0.53, 0.79]0.31 [0.11, 0.49]
Bracket − EWC+0.23 [0.13, 0.33]+0.37 [0.21, 0.53]+0.41 [0.21, 0.60]−0.34 [−0.53, −0.15]
Fast forgetting (Domain-IL)
Stored bracket (proposed)0.40 [0.22, 0.56]0.78 [0.68, 0.84]0.46 [0.28, 0.61]0.30 [0.09, 0.49]
EWC penalty0.59 [0.41, 0.74]0.79 [0.70, 0.85]0.84 [0.76, 0.88]0.47 [0.30, 0.62]
Stored Taylor estimate0.41 [0.20, 0.58]0.78 [0.68, 0.85]0.71 [0.59, 0.79]0.76 [0.66, 0.84]
Full bracket{sup}†`0.69 [0.56, 0.79]0.67 [0.55, 0.77]0.81 [0.73, 0.87]0.29 [0.09, 0.47]
Re-evaluation{sup}†`0.81 [0.73, 0.87]0.81 [0.71, 0.87]0.84 [0.76, 0.89]0.78 [0.68, 0.85]
Bracket − EWC−0.19 [−0.33, −0.06]−0.01 [−0.10, 0.07]−0.38 [−0.55, −0.22]−0.17 [−0.37, 0.03]

Table 3. Rank correlation with forgetting, η=0.05\eta= 0.05, 100 runs per cell, with 95% bootstrap intervals. The best data-free signal in each column is in bold. †Reference signals that use the old task’s data.

Two comparisons deserve care. First, against the stored Taylor estimate, which uses the same summary, the bracket is higher on all three setups (0.81 vs. 0.67, 0.70 vs. 0.31, 0.76 vs. 0.58); the difference is clear on Fashion-MNIST (+0.39, interval [0.23,0.56]) and CIFAR-10 features (+0.18, [0.03,0.34]) and within noise on MNIST (+0.14, [−0.02,0.30]). Second, against re-evaluation on the old data, the bracket is tied on MNIST (0.81 vs. 0.81), higher within noise on CIFAR-10 features (0.76 vs. 0.68; difference +0.08, interval [−0.05,0.21]) and clearly higher on Fashion-MNIST (0.70 vs. 0.33; +0.37, [0.21,0.55]). So a signal that uses no old data matches or exceeds direct monitoring with all of it. A likely reason is that slow forgetting has barely begun after 20 steps, so the change in A’s loss is still small relative to noise, whereas the bracket measures a rate.

Forgetting in this scenario is small (Table 1), which is the defining property of the slow case. The correlations are computed over 100 runs and are stable across seeds, but the absolute stakes per update are low. The result holds across learning rates on MNIST and is strongest for small steps (0.86, 0.81, 0.71 at η=0.02,0.05,0.1\eta= 0.02, 0.05, 0.1, against 0.55–0.59 for EWC; Appendix § 11), as expected from a small-step expansion.

Fast forgetting: the summary goes stale

For fast forgetting the picture changes (Figure 3, Table 3 bottom). Without old data, the EWC penalty is better than the stored bracket on MNIST (0.59 vs. 0.40) and CIFAR-10 features (0.84 vs. 0.46) and tied with it on Fashion-MNIST (0.79 vs. 0.78).

Figure 3. Fast forgetting (Domain-IL), η=0.05\eta= 0.05, 100 runs per setup. Hatched bars are reference signals that use old data.

The full bracket remains a good predictor on MNIST and CIFAR-10 features (0.69 and 0.81), so the bracket itself has not failed. The stored version has. In fast forgetting the weights move far from θA\theta_A within a few steps, and a local model of AA built at θA\theta_A no longer describes AA where the network now is. The EWC penalty is a function of distance alone, and it continues to track the damage. Re-evaluation on old data is the strongest signal, or tied for it, in every fast setting (0.78–0.84): fast forgetting is easy to detect when it can be observed.

A tiny buffer helps on MNIST only. If ten examples of A are kept and the bracket is computed from them instead of from the summary, it overtakes EWC on MNIST at all three learning rates (0.74, 0.72, 0.57 vs. 0.61, 0.59, 0.49; Appendix § 12). This does not carry over to CIFAR-10 features, where ten examples give 0.28 and fifty give 0.69, still below EWC.

Repairs that did not work. On CIFAR-10 features I tried three ways to repair the data-free bracket in fast forgetting (Appendix § 13): adding its rank to that of EWC (0.71), adding its rank to that of the Taylor estimate (0.62), and enlarging the summary to K=50K = 50 or 100 eigenpairs (0.49 in both cases, 3 seeds). None reaches the EWC penalty alone (0.84). The size of the summary is therefore not the limiting factor; its locality is.

When the bracket fails: half-learned tasks

On the CIFAR-10 CNN the bracket does not predict forgetting in either scenario (−0.12 and 0.30 stored; −0.11 and 0.29 with old data), so the summary is not at fault. Figure 4(a,Figure 4b) shows the contrast on the same images.

Figure 4. (a,b) Stored bracket against forgetting for the same CIFAR-10 tasks in the slow scenario, with the old task well learned (frozen features, 97% accuracy) and half learned (small CNN, 78%). (c) Norm of the old task’s gradient at θA\theta_A relative to the new task’s.

The difference is how well AA has been learned. Expanding AA’s loss around θA\theta_A,

LA(θ)−LA(θA)≈gA(θA)⊤δ⏟slope+12δ⊤HA(θA)δ⏟curvature(6)L_A(\theta)-L_A(\theta_A) \approx\underbrace{g_A(\theta_A)^\top\delta}_{\text{slope}} + \underbrace{\frac{1}{2}\delta^\top H_A(\theta_A)\delta}_{\text{curvature}} \tag*{(6)}

the first term vanishes only if AA has converged. Table 4 measures each part. On the well-learned setups the residual gradient of AA is 2–7% of BB’s. On the CNN it is 94% (slow) and 38% (fast), an order of magnitude larger. In slow forgetting on the CNN the slope term accounts for 57% of the damage and is the better predictor of forgetting (0.43 against 0.17 for curvature). The bracket contains HAgBH_Ag_B, a curvature quantity, and has no term that responds to movement along AA’s residual gradient, so it misses this.

MNISTFashion-MNISTCIFAR-10 featuresCIFAR-10 CNN (half learned)
∥gA∥/∥gB∥\lVert g_A\rVert/\lVert g_B\rVert at θA\theta_A0.07 / 0.030.04 / 0.020.07 / 0.040.94 / 0.38
Slope share of damage0.31 / 0.110.35 / 0.120.25 / 0.100.57 / 0.23
Full bracket0.82 / 0.690.67 / 0.690.78 / 0.800.04 / 0.30
term ∥HAgB∥\lVert H_Ag_B\rVert alone0.78 / 0.790.71 / 0.770.79 / 0.750.02 / 0.19
term ∥HBgA∥\lVert H_Bg_A\rVert alone0.75 / 0.680.50 / 0.630.68 / 0.720.04 / 0.25
Measured curvature damage0.84 / 0.470.71 / 0.800.87 / 0.780.17 / 0.73
Measured slope damage0.01 / 0.37−0.29 / −0.550.04 / 0.100.43 / 0.00

Table 4. Mechanism test (η=0.05\eta= 0.05, 3 seeds; slow / fast). Slope share is ∣gATδ∣/(∣gATδ∣+∣12δTHAδ∣)\lvert g_A^{\mathsf{T}}\delta\rvert/(\lvert g_A^{\mathsf{T}}\delta\rvert+\lvert\frac{1}{2}\delta^{\mathsf{T}}H_A\delta\rvert) at step 20, with means taken over runs. The last four rows are rank correlations with forgetting.

Learning AA properly removes the problem. With frozen pretrained features, every measure in Table 4 returns to the MNIST pattern: the residual gradient is small, damage is mostly curvature, the term ∥HAgB∥\lVert H_Ag_B\rVert alone predicts forgetting (0.79 and 0.75), and the stored bracket goes from −0.12 to 0.76 in the slow scenario. Longer training could not be used to test this on the CNN, whose accuracy does not improve with more epochs.

What remains unexplained. In fast forgetting on the CNN the damage is still mostly curvature (77%), and the measured curvature term predicts forgetting well (0.73), yet ∥HAgB∥\lVert H_Ag_B\rVert does not (0.19). I tested whether BB’s gradient points into directions of negative curvature of AA, which the norm would misread. It does not: the cosine between gBg_B and HAgBH_Ag_B is 0.82 on the CNN, higher than on the well-learned setups (0.59–0.62), although the CNN does have more negative curvature (Appendix § 15). The CNN’s largest curvature is three to seven times larger than in the other setups, and one possibility is that its Hessian changes quickly along the path, so that curvature measured at the current point no longer describes the accumulated damage. I leave this open.

In all three well-learned setups the single term ∥HAgB∥\lVert H_Ag_B\rVert is about as good as the full bracket, and better in fast forgetting on MNIST and Fashion-MNIST. The predictive content of the bracket lies mainly in how AA’s curvature acts on BB’s gradient.

Discussion and limitations

What the bracket is for. The results suggest a division of labour. Fast forgetting is loud: the EWC penalty detects it without data and re-evaluation detects it with data. Slow forgetting is quiet, and there the stored bracket is the best data-free signal I tested and is competitive with re-evaluation on all old data.

The bracket is therefore best seen as an early warning for the kind of forgetting that is otherwise easy to miss, in settings where the old data cannot be kept.

Limitations.

  • Scale. The models are small MLPs and one small CNN; on CIFAR-10 the positive result is for a frozen pretrained backbone with a trainable head.

  • Two tasks. Every run is a single pair A→BA \to B. Long task sequences are untested.

  • Scenario and speed are confounded. Slow forgetting is Task-IL and fast forgetting is Domain-IL in all experiments.

  • Small effects in the slow case. Mean forgetting there is about 1% of accuracy.

  • Easy pairs. Two of the five Fashion-MNIST pairs reach 100% accuracy, so that dataset confirms the pattern more than it extends it.

  • Ranking only. I report rank correlations; the signals are not calibrated estimates of the loss.

  • Optimiser. All results use plain SGD. Momentum and Adam would need a modified bracket.

  • Statistics. Main results use 5 seeds; the order and mechanism tests use 3, the curvature test 2. Bootstrap intervals treat runs as independent.

  • Cost. The summary stores (K+2)P(K+2)P numbers for a model with PP parameters, against 2P2P for EWC, and each evaluation of the bracket needs one Hessian–vector product on the current task.

Future work. The natural next step is to use the bracket to reduce forgetting, by steering updates away from directions in which HAgBH_A g_B is large, and to compare against EWC, replay and first-order projection methods ([7, 19]) over longer task sequences. Explaining the failure of the curvature term in fast forgetting on the CNN, and finding a summary that stays valid far from θA\theta_A, are open problems.

Conclusion

I tested the conjecture that the Lie bracket of task gradients is linked to catastrophic forgetting. In two-task learning, forgetting is an order effect, and the bracket tracks it when the old task is well learned. Computed from a small stored summary and no old data, the bracket predicts slow forgetting better than the EWC penalty on three datasets. It does not beat EWC for fast forgetting, and it fails when the old task has a large residual gradient, for a reason I measured. These boundaries make the claim narrower than the conjecture, and more useful: the bracket is a practical early warning for quiet forgetting on well-trained models.

Use of AI tools

An AI assistant (Claude, Anthropic) was used to help write the analysis code, produce figures and draft parts of the text. The author designed the study, ran all experiments, verified the results and references, and takes full responsibility for the content.

Code and data

The four notebooks used for all experiments, together with the per-run result files behind every table and figure, are available at https://github.com/Hackme262/lie-bracket-forgetting.

Numerical checks

Table 5 reports, for one pair of tasks at initialisation, the ratio ∥θAB−θBA∥/(η2∥[A,B]∥)\lVert\theta_{AB}-\theta_{BA}\rVert/(\eta^{2}\lVert[A,B]\rVert) for one full step in each order, and the cosine between the measured and predicted gap. Hessian–vector products were checked for symmetry (u⊤Hvu^{\top}Hv and v⊤Huv^{\top}Hu agree to within 0.03% on every model).

η=0.1\eta= 0.1η=0.03\eta= 0.03η=0.01\eta= 0.01η=0.003\eta= 0.003
Fashion-MNIST (MLP)0.878 (0.951)0.979 (0.995)0.995 (0.999)0.999 (1.000)
CIFAR-10 features (MLP)0.948 (0.996)0.984 (1.000)0.995 (1.000)0.999 (1.000)
CIFAR-10 CNN1.005 (0.933)0.992 (0.994)0.996 (0.999)0.999 (1.000)

Table 5. Check of Proposition 1: measured over predicted order gap (cosine in parentheses).

On MNIST the same check gave ratios between 1.001 and 1.007 with cosine up to 1.000.

Learning-rate sweep

η\etaStored bracketEWCTaylorFull bracket†^{\dagger}Re-eval.†^{\dagger}Forgetting
Slow0.020.860.550.580.860.611.0
Slow0.050.810.580.670.820.811.3
Slow0.10.710.590.790.730.841.2
Fast0.020.460.610.460.720.7730.9
Fast0.050.400.590.410.690.8135.0
Fast0.10.330.490.370.630.8237.1

Table 6. Split MNIST, three learning rates, 100 runs each. Rank correlation with forgetting. The last column is mean forgetting in accuracy (%). †^{\dagger}Uses old data.

On the CIFAR-10 CNN at η=0.02\eta= 0.02 the stored bracket improves but stays below EWC: slow 0.22 vs. 0.43, fast 0.42 vs. 0.54 (Taylor estimate 0.18 and 0.80).

Tiny buffers

Here the bracket is computed from nn stored examples of AA instead of the summary, and re-evaluation uses the same nn examples.

η\etaEWCStored br.Br 10Chk 10Br 50Chk 50Br 200Chk 200
Slow0.020.550.860.730.010.790.140.830.24
Slow0.050.580.810.660.120.710.310.770.42
Slow0.10.590.710.570.110.650.320.690.59
Fast0.020.610.460.740.680.750.710.770.76
Fast0.050.590.400.720.710.720.790.720.81
Fast0.10.490.330.570.720.570.790.590.82

Table 7. Split MNIST with a buffer of nn examples of the old task (100 runs each). “Br” is the bracket from the buffer, “Chk” is re-evaluation on the buffer.

In the slow scenario the data-free stored bracket is better than a bracket computed from 10 or 50 examples on every well-learned setup, and re-evaluation on small buffers is unreliable.

Stored br.Br 10Br 50Chk 10Chk 50EWC
Fashion-MNISTslow0.700.410.520.290.290.33
Fashion-MNISTfast0.780.590.660.590.690.79
CIFAR-10 featuresslow0.760.290.62−0.35−0.060.35
CIFAR-10 featuresfast0.460.280.690.220.650.84
CIFAR-10 CNNslow−0.12−0.12−0.210.110.190.22
CIFAR-10 CNNfast0.300.120.280.480.640.47

Table 8. Buffers on the other setups, η=0.05\eta= 0.05 (100 runs each).

Attempted repairs for fast forgetting

Signal (no old data unless stated)ρ\rho with forgetting
EWC penalty0.84
Stored bracket, K=20K = 200.46
Stored bracket + EWC penalty0.71
Stored bracket + Taylor estimate0.62
Stored bracket + EWC penalty + Taylor estimate0.75
Stored bracket, K=50K = 500.49
Stored bracket, K=100K = 1000.49
Bracket from 50 examples + EWC penalty0.81

Table 9. CIFAR-10 features, fast forgetting, η=0.05\eta= 0.05. Combinations add the ranks of the signals. Rows with K=50,100K = 50, 100 use 3 seeds (60 runs); the others use 5 seeds.

With K=50K = 50 and K=100K = 100 the Taylor estimate rises slightly (0.76, 0.77) and EWC is unchanged (0.85 on the same 60 runs). On Split MNIST, scoring the stored bracket at steps 5, 10, 15 and 20 separately gave 0.45, 0.38, 0.36 and 0.37, so measuring earlier does not help either.

Diagnostics on the half-learned CNN

Before identifying the residual gradient as the cause, I tested other explanations on the CIFAR-10 CNN (η=0.05\eta= 0.05, 3 seeds; slow / fast). Restricting the bracket to the convolutional layers (0.00 / 0.25) or to the dense layers (0.05 / 0.36) does not help. Projecting the bracket onto A’s gradient gives 0.09 / 0.41 with old data and 0.02 / 0.49 from the summary, a partial improvement in the fast scenario that remains below EWC (0.26 / 0.54 on the same runs). Training for 6 epochs instead of 3 raises accuracy only from 0.78 to 0.79 and lowers the full bracket’s correlation (−0.09 / 0.15).

Curvature at the old task’s solution

MNISTFashion-MNISTCIFAR-10 featuresCIFAR-10 CNN (half learned)
Largest eigenvalue λmax⁡\lambda_{\max}5.433.852.3516.26
Smallest eigenvalue λmin⁡\lambda_{\min}−0.30−0.23−0.12−2.21
∣λmin⁡∣/λmax⁡\lvert\lambda_{\min}\rvert/\lambda_{\max}0.0650.0720.0510.150
cos⁡(gB,HAgB)\cos(g_B, H_Ag_B)0.590.620.590.82

Table 10. Extreme eigenvalues of HA(θA)H_A(\theta_A) and alignment of B’s gradient with A’s curvature (fast scenario, η=0.05\eta= 0.05, 2 seeds).

In the slow scenario the eigenvalue ratios are similar (0.063, 0.061, 0.054, 0.153). The cosine is low there on every setup (0.06–0.11) because most of gBg_B lies on BB’s own output weights, which LAL_A does not depend on.

References

  1. [1]Samuel J. Bell and Neil D. Lawrence. The effect of task ordering in continual learning. arXiv preprint arXiv:2205.13323, 2022.arxiv.org/abs/2205.13323
  2. [2]Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with A-GEM. In International Conference on Learning Representations (ICLR), 2019a.arxiv.org/abs/1812.00420
  3. [3]Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhoseiny, Thalaiyasingam Ajanthan, Puneet K. Dokania, Philip H. S. Torr, and Marc’Aurelio Ranzato. On tiny episodic memories in continual learning. arXiv preprint arXiv:1902.10486, 2019b.arxiv.org/abs/1902.10486
  4. [4]Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 248–255, 2009.
  5. [5]Benoit Dherin. Implicit biases in multitask and continual learning from a backward error analysis perspective. In NeurIPS 2023 Workshop on Mathematics of Modern Machine Learning (M3L), 2023. arXiv:2311.00235.arxiv.org/abs/2311.00235
  6. [6]Thang Doan, Mehdi Abbana Bennani, Bogdan Mazoure, Guillaume Rabusseau, and Pierre Alquier. A theoretical analysis of catastrophic forgetting through the NTK overlap matrix. In Proceedings of the 24th International Conference on Artificial Intelligence and Statistics (AISTATS), volume 130 of PMLR, pages 1072–1080, 2021.arxiv.org/abs/2010.04003
  7. [7]Mehrdad Farajtabar, Navid Azizan, Alex Mott, and Ang Li. Orthogonal gradient descent for continual learning. In Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics (AISTATS), volume 108 of PMLR, pages 3762–3773, 2020. arXiv:1910.07104.arxiv.org/abs/1910.07104
  8. [8]Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016.arxiv.org/abs/1512.03385
  9. [9]Ido Nitzan Hidekel and Dan Raviv. Catastrophic forgetting is low-rank: A function-space theory for continual adaptation. arXiv preprint arXiv:2606.18024, 2026.arxiv.org/abs/2606.18024
  10. [10]James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13):3521–3526, 2017.DOI
  11. [11]Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
  12. [12]Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
  13. [13]David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems (NeurIPS), pages 6467–6476, 2017.
  14. [14]Michael McCloskey and Neal J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of Learning and Motivation, volume 24, pages 109–165. Academic Press, 1989.DOI
  15. [15]Seyed Iman Mirzadeh, Mehrdad Farajtabar, Razvan Pascanu, and Hassan Ghasemzadeh. Understanding the role of training regimes in continual learning. In Advances in Neural Information Processing Systems (NeurIPS), 2020.arxiv.org/abs/2006.06958
  16. [16]Barak A. Pearlmutter. Fast exact multiplication by the Hessian. Neural Computation, 6(1):147–160, 1994.DOI
  17. [17]Vinay V. Ramasesh, Ethan Dyer, and Maithra Raghu. Anatomy of catastrophic forgetting: Hidden representations and task semantics. In International Conference on Learning Representations (ICLR), 2021. arXiv:2007.07400.arxiv.org/abs/2007.07400
  18. [18]Alexey Rukhovich, Alexander Podolskiy, and Irina Piontkovskaya. Commute your domains: Trajectory optimality criterion for multi-domain learning. arXiv preprint arXiv:2501.15556, 2025.arxiv.org/abs/2501.15556
  19. [19]Gobinda Saha, Isha Garg, and Kaushik Roy. Gradient projection memory for continual learning. In International Conference on Learning Representations (ICLR), 2021.arxiv.org/abs/2103.09762
  20. [20]Anika Singh, Aayush Dhaulakhandi, Varun Chopade, Likhith Malipati, David Martinez, and Kevin Zhu. Mitigating forgetting in continual learning with selective gradient projection. arXiv preprint arXiv:2603.26671, 2026.arxiv.org/abs/2603.26671
  21. [21]Samuel L. Smith, Benoit Dherin, David G. T. Barrett, and Soham De. On the origin of implicit regularization in stochastic gradient descent. In International Conference on Learning Representations (ICLR), 2021.arxiv.org/abs/2101.12176
  22. [22]John Sweeney. The geometry of sequential learning: Lie-bracket prediction of transfer order. In Proceedings of the 43rd International Conference on Machine Learning (ICML), volume 306 of PMLR, pages 117806–117825, 2026. arXiv:2606.24993.arxiv.org/abs/2606.24993
  23. [23]Gido M. van de Ven and Andreas S. Tolias. Three scenarios for continual learning. arXiv preprint arXiv:1904.07734, 2019.arxiv.org/abs/1904.07734
  24. [24]Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.arxiv.org/abs/1708.07747
  25. [25]Dong Yin, Mehrdad Farajtabar, Ang Li, Nir Levine, and Alex Mott. Optimization and regularization-based continual learning: a loss approximation viewpoint. arXiv preprint arXiv:2006.10974, 2020.arxiv.org/abs/2006.10974
  26. [26]Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Proceedings of the 34th International Conference on Machine Learning (ICML), volume 70 of PMLR, pages 3987–3995, 2017.arxiv.org/abs/1703.04200

Paper details

vlnc:W_h4cuetvr
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 1

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Claude

View statement
Looking for related papers…
Contents