skip to content

Catastrophic Forgetting

Adapting to a new task overwrites the weights that solved the old one. Interviewers probe it because a forgetful model looks perfect on the new metric and quietly fails at everything it used to do.

on this pageshow

questions

4

What is catastrophic forgetting when a pretrained network is fine-tuned on a new task?

level: juniorimportance: must knowfreq 58%

answer

  1. learning B costs you A
  2. the loss has no term for old data
  3. shared weights, myopic optimizer
  4. new head, new gradients, drifted features
  5. old task metrics nobody is watching

basics

~20 s

Catastrophic forgetting is the sharp drop in a network's performance on its original task after it is trained on a new one. Fine-tuning minimises only the new task's loss, so the shared weights drift away from the old solution.

solid answer

~50 s

Catastrophic forgetting is what happens when you keep training a network on task B and its accuracy on task A collapses, often within a few hundred steps. The cause is not mysterious: gradient descent is minimising a loss computed only on task B's data, and nothing in that objective references task A. Every parameter is shared, so the optimizer is free to move weights out of the region where task A's loss was low as long as that lowers task B's loss. A warehouse pick-and-place policy fine-tuned for a new suction gripper can end up unable to run the parallel-jaw task it shipped with, even though nobody changed the parallel-jaw code. It is worst when the two tasks share a backbone but differ in output space or input statistics, and when you train for many epochs at a step size large enough to move the pretrained features rather than just the head.

go deeper

for a junior

Be able to state the definition in one sentence and name the cause: training minimises only the new task's loss, and the weights are shared. Know that the old task's metrics have to be measured or the regression is invisible.

for a middle

Explain the optimization view — no term in the objective references the old data, so nothing resists moving out of the old low-loss region. Distinguish representation drift from a re-aimed output head, and say how you would tell them apart.

for a senior

Show that you expect it and instrument for it. Talk about which factors set the severity — task distance, how many layers move, how long you train, how many adaptation stages have stacked up — and about the retained evaluation that catches it before release.

for a principal

Own the position that any repeatedly adapted model needs a forgetting budget as an explicit release criterion, not a debugging afterthought. Be ready to argue when accepting the loss on a retired capability is the right call versus paying to retain it.

## The phenomenon A network is trained on task A until it performs well. Training then continues on task B — new labels, new data, or simply a newer slice of the same stream. Performance on B rises as expected. Performance on A, which nobody is measuring because A's data is no longer in the loop, falls hard. That collapse is **catastrophic forgetting**: the loss of previously acquired capability caused by learning something new in the same set of weights. The word *catastrophic* is doing real work. Forgetting in a neural network is not the slow decay a person experiences; it can take a network from 0.91 recall to below 0.5 on the old task inside a single epoch of the new one. ## Why it happens Think about what the optimizer is actually asked to do. During fine-tuning the objective is the average loss over the **new** task's batches. There is no term in that objective that mentions the old data, so there is no force at all resisting movement away from the old solution. The old solution was one point in a large region of weight space where task A's loss is low; the new gradient points wherever task B's loss falls fastest, and that direction is essentially unrelated to A's low-loss region. Three structural facts make it worse: - **The parameters are shared.** A single backbone encodes features for both tasks. There is no partition of weights reserved for A, so any update that helps B may overwrite a feature A depended on. - **The objective is myopic.** Stochastic gradient descent optimises the current batch's loss. It has no memory of the loss surface it came from, and no notion that some directions are cheap for B but expensive for A. - **The output layer usually changes.** Adapting to a new label set typically means a fresh, randomly initialised head. Early in training that head produces large, badly aimed gradients that propagate into the backbone, and if the old head was discarded the old task's predictions are gone by construction, not merely degraded. ## Two distinguishable failures It is worth separating **representation drift** from **head drift**, because they are diagnosed and repaired differently. - *Head drift*: the backbone still encodes everything the old task needed, but the classifier on top has been re-aimed at the new labels. In a class-incremental setup, where each stage introduces new classes and only those classes appear as positives, the final layer picks up a strong recency bias — logits for recently seen classes systematically outrank older ones. - *Representation drift*: the features themselves have moved, so the information the old task needed is no longer linearly available. A cheap way to tell them apart is to freeze the current backbone and fit a fresh linear classifier on old-task data. If that probe recovers most of the old performance, the features survived and the head was the casualty. If it does not, the representation itself has been overwritten. ## Where the severity comes from Forgetting is not a constant; it scales with how far training is allowed to move the weights and how far apart the tasks are. - **Distance between tasks.** Two tasks that need similar features interfere less. A new suction-gripper skill that reuses the same visual features as the old parallel-jaw skill damages less than one that needs an entirely different notion of graspability. - **How much of the network moves.** The more layers are unfrozen and the larger the steps, the more the pretrained features can be displaced. Lower layers, which encode generic structure, typically drift less than the task-specific upper layers, partly because their gradients are smaller and partly because generic features remain useful for the new task. - **How long training runs.** Forgetting compounds with steps taken on the new distribution, so a long fine-tune on a small new dataset is a common way to destroy a good backbone. - **Sequence length.** Under repeated sequential adaptation — five stages, then ten — the earliest stage is usually the worst hit, because it has had the most subsequent updates to survive. ## What it is not Two confusions are worth naming. First, forgetting is **not** overfitting. An overfit model has memorised the training set of the task it is being trained on; a model that has forgotten may generalise perfectly well on the new task while having lost a different one. They can occur together, but neither implies the other. Second, forgetting is **not** literal erasure. The weights still carry a great deal of old-task structure, which is why old performance is often partially recoverable from a small amount of old data far faster than it was originally learned. That partial recoverability is exactly what the standard mitigations exploit: keeping a slice of old data in the training stream, or adding an explicit penalty that makes the parameters the old task relied on expensive to move. ## The practical consequence Because the new-task metrics look healthy the whole time, forgetting is invisible unless you deliberately keep measuring the old task. Any pipeline that adapts a model repeatedly needs a retained evaluation set from the original task, scored on the same cadence as the new-task validation set, or the regression ships.

  • Is catastrophic forgetting the same thing as overfitting the new task?
    No. Overfitting means the model memorises its current training set and generalises poorly on that same task. Forgetting means performance on a different, earlier task collapses, and it can happen while the new task generalises well. They have different causes and different fixes, though a long, aggressive fine-tune on a small dataset tends to produce both at once.
  • Which parts of a network tend to forget most, and why?
    The task-specific upper layers and the output head. Lower layers encode generic structure that remains useful for the new task, so their gradients are smaller and they drift less. The head is often replaced outright for a new label set, and a freshly initialised head also sends large early gradients back into the backbone, which is what damages the features.
  • If the old task's data is gone, is the old capability permanently lost?
    Usually not entirely. The weights still carry much of the old structure, so a modest amount of old data restores old performance far faster than the original training did. That is evidence the capability was buried rather than erased. Without any old data at all you are limited to methods that constrained the parameters before the new training began.

Overwriting a whiteboard for a new meeting: nothing forbids using the space where yesterday's diagram was, because the only thing being optimised is today's diagram.

saying these in an interview costs you the question

  • Calls it overfitting to the new task
  • Thinks the network literally erases stored memories
  • Believes a low new-task loss proves nothing was lost
  • Assumes only the output head can be affected
  • Says it only happens with a bad learning rate

context

open as a page

How does replaying a small buffer of source examples reduce catastrophic forgetting?

level: middleimportance: should knowfreq 44%

basics

~20 s

Interleaving a small sample of the original task's data into every batch puts an old-task term back into each gradient. The optimizer can no longer lower the new loss at unlimited cost to the old one.

open as a page

How do you detect catastrophic forgetting while adapting a model to a new task?

level: seniorimportance: should knowfreq 46%

basics

~20 s

Keep a frozen evaluation set from the original task and score it on the same cadence as the new task's validation set. Forgetting shows up as a falling retained-source score, so make it a release gate.

open as a page

How does elastic weight consolidation protect a network against catastrophic forgetting?

level: seniorimportance: nice to knowfreq 26%

basics

~20 s

Elastic weight consolidation adds a quadratic penalty pulling every parameter toward its old-task value, scaled by that parameter's Fisher information. Weights the old task depended on become stiff, while unimportant ones stay free to fit the new task.

open as a page