# What Is Catastrophic Forgetting?

> Why a fine-tuned AI model can get worse at old jobs, how teams guard against it, and what to say about the trade-offs, for your AI interview.

**In short:** Catastrophic forgetting is when a neural network trained on a new task loses much of what it learned before. Fine-tuning a language model on narrow new data can break its old skills, so teams test the old skills after every training run.

AI and LLM interview question Q296, Fine-tuning and adaptation. Intermediate, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-catastrophic-forgetting

## Say it in 30 seconds

Catastrophic forgetting is when a model learns a new task and loses much of what it knew before. The same weights hold its old skills, so new training can overwrite them. A support model tuned on a new product line can start getting the old products wrong. Teams fight it by mixing old examples into training, and by testing old skills on every run before release.

## Say it in 2 minutes

A neural network keeps what it knows in its weights, the many numbers that training adjusts. Fine-tuning changes those numbers again, to make the model better at one job. But the same numbers also held skills from earlier training. So the model can get better at the new job while getting worse at an old one. That loss is catastrophic forgetting, and it is quiet, because the new score looks fine.

Here is a case I'd expect at work. A support assistant for a mid-size bank answers card questions well. We fine-tune it on six thousand tickets about a new loan product. The loan answers improve, but card fee questions start going wrong. Nothing in the new data showed the model how to answer them, and the team only tested loans. Customers found it first.

What I'd do is three things. I keep a sample of old card tickets in every training mix, which is called replay. I keep a frozen test set for the card skill and run it after each training run. Then I block the release if the card score drops past a limit we agree before training. LoRA, which trains small add-on weights while the original ones stay frozen, also limits forgetting more than common tricks such as weight decay, though it can learn the new task less well.

No method keeps every skill for free. Mixing old data usually costs some accuracy on the new task, so I say that trade-off out loud and name the cost I would accept.

## What is catastrophic forgetting, in plain words?

A neural network keeps what it knows in its weights, the many numbers that training adjusts. Fine-tuning is extra training on a model that already exists, using examples for one job. That training moves the same weights, so it can make the model better at the new job and worse at an old one. That loss is catastrophic forgetting.

Google's Machine Learning Crash Course describes fine-tuning as adapting a model to a particular task by training it on task-specific data. That is the step where forgetting can creep in.

Think of a claims handler at an insurance firm who spends six months only on motor claims. When she moves back to property claims, she is slower and makes mistakes on rules she used to know well. The motor work pushed out the property rules she had learned. A model can lose its old skills the same way, and nobody notices unless someone tests them.

- **Weights:** The numbers inside a model that hold what it learned. Training changes them.
- **Fine-tuning:** Extra training on a model that already exists, using examples for one job.
- **Replay:** Mixing a sample of old examples into the new training, so the old skill stays in play.
- **Regression:** A skill that gets worse after a change. Teams test for it before shipping.

## Why does new training erase old skills?

A model has no separate drawer for each skill. A skill is spread across many weights, and the same weights serve many skills. Fine-tuning nudges them toward the new task, and nothing in the update says which old skills to protect.

The problem is an old one. A 2013 study by Ian J. Goodfellow and colleagues tested how much old tasks suffer when a network is then trained on a second task. Its abstract says the problem is widely believed to be serious for neural networks, and the study also looked at how the relationship between the two tasks changes the forgetting.

> "Catastrophic forgetting is a problem faced by many machine learning models and algorithms." (Goodfellow and colleagues, 2013)
>
> "The experiments reveal that catastrophic forgetting is generally observed in LLMs ranging from 1b to 7b parameters." (A 2023 study of large language models)

Large language models are not immune. The 2023 study tested models of 1b to 7b parameters, and found that forgetting is generally observed in them.

Worked example, with made-up numbers. A support assistant for a mid-size bank handles card questions well. The team fine-tunes it on six thousand loan tickets and tests only loans.

- **Before: Cards 84, loans 58.** Made-up scores out of 100, before training.
- **After: Cards 63, loans 91.** Only the loan test ran, so the card drop was missed.

The loan score went up. The card score fell, and nobody saw it until customers complained about card fees.

## What helps keep old skills?

Teams use a few methods, and each one has a cost. Replay, also called experience replay, is the most straightforward. Keep a sample of old examples in the new training run, so the old skill gets a reminder every time.

*Diagram, Two training runs, two outcomes: Same base model, two training runs. Path 1 trains on loan tickets only, so the card skill drops. Path 2 adds old card tickets, so the card skill stays close to where it started while the loan skill still improves.*
1. Path 1 starts from the base model and trains on loan tickets only.
2. Path 2 starts from the same model and trains on loans plus old card tickets.
3. Without old examples, the card skill falls, as in this made-up test.
4. With the mix, the card skill stays close to where it started.

Other methods change how far the weights may move. James Kirkpatrick and colleagues' method, elastic weight consolidation (EWC), slows learning on the weights that matter most for old tasks. Their paper says it is possible to overcome the limit that forgetting seemed to put on learning in sequence.

LoRA is the other common tool. The Hugging Face guide explains that the original weights stay frozen while small add-on sets of numbers learn the new job.

A 2024 study compared LoRA with full fine-tuning on programming and maths data. It found that LoRA mitigates forgetting more than two common training tricks, weight decay (which penalises large weights) and dropout (which switches off random parts of the network during training). It also found that LoRA better keeps the base model's ability outside the new domain. But in the usual small add-on setting, LoRA substantially underperforms full fine-tuning on the new task.

Here is that trade-off in a short program. It is one weight standing in for a whole fee model, with made-up numbers. Task A is the old card rule, where the output is twice the input. Task B is a new loan rule that pushes the other way. One weight cannot hold both jobs, so this is the worst case. The replay line (line 19) keeps the task A examples in the mix.

```python
# A one-number stand-in for a bank's fee model. Task A (old card rule): y = 2x. Task B (new loan rule): y = -x.
# Train on A, then on B only, then on B mixed with the A examples (replay).
def train(w, data, steps=200, lr=0.05):
    for _ in range(steps):
        grad = sum(2 * (w * x - y) * x for x, y in data) / len(data)
        w -= lr * grad
    return w

def error(w, data):
    return round(sum((w * x - y) ** 2 for x, y in data) / len(data), 2)

task_a = [(1, 2), (2, 4), (3, 6)]
task_b = [(1, -1), (2, -2), (3, -3)]

w = train(0.0, task_a)
print("after A: w =", round(w, 2), "| A error", error(w, task_a))
w_b = train(w, task_b)
print("B only:  w =", round(w_b, 2), "| A error", error(w_b, task_a), "| B error", error(w_b, task_b))
w_r = train(w, task_b + task_a)
print("replay:  w =", round(w_r, 2), "| A error", error(w_r, task_a), "| B error", error(w_r, task_b))
```

Output:

```text
after A: w = 2.0 | A error 0.0
B only:  w = -1.0 | A error 42.0 | B error 0.0
replay:  w = 0.5 | A error 10.5 | B error 10.5
```

Replay cut the old task's error from 42 to 10.5, but the new task's error rose from 0 to 10.5. That is the worst case, because one weight has no room for both jobs. A real model has far more weights, so the cost is usually smaller, but it is rarely zero.

> **Tip:** Asked which fix to pick? Say replay first, because it is simple to try. Reach for LoRA when memory or training budget is tight, and always name what it costs on the new task.

## How do you catch it before users do?

Test the old skills as hard as the new ones. Freeze a test set for each skill you must keep, run every set after each training run, and block the release when an old score drops past an agreed limit.

1. **Freeze the old-skills test set:** Fixed questions with known good answers for each product line you must keep. Do not change them between runs, so the scores compare fairly.
2. **Run every set after each run:** Score the new skill and every old one, each time. A new-only test can look like a win while the old line breaks.
3. **Block a release past the limit:** Agree the limit before training, for example a drop of more than 3 points on any old set. Past the limit, the run goes back.

*Diagram, Testing before every release: Each training run is scored on every test set. Only a run whose old scores stay within the agreed limit can ship, and any other run goes back for another round.*
1. The finished training run is handed over to be scored.
2. Every run is scored on the new test set and on the frozen old set.
3. If each old score stays within the agreed limit, the model can ship.
4. If an old score drops past the limit, the run goes back for another round.

In the bank example, the card test would have shown the drop from 84 to 63 on the first run, long before customers complained.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: new training can erase old skills.
- [ ] Why it happens: the same weights hold many skills.
- [ ] Fixes with costs: replay, LoRA, and methods like elastic weight consolidation.
- [ ] Testing: a frozen old-skills set, run after every training run.
- [ ] An honest trade-off: no method keeps everything for free.
- [ ] An example with made-up numbers, and what you would test first.

**Common traps**

- Trap: "Just train it longer on the new data." Better: More training on new data alone pushes the old skills out further. Mix in old examples and test them.
- Trap: "It's the same as overfitting." Better: Overfitting means doing well on the training data but badly on data the model has not seen. Forgetting means losing skills it already had. Both can happen at once.
- Trap: "The new score went up, so ship it." Better: A better new score says nothing about the old skills. Test both sets before a release.

## Can you spot the gap?

**Spot the gap:** Which release config would have caught the card-fee drop before customers did?

A. eval: loan tickets only; gate: loan score at least 85; ship if passed
B. eval: loan tickets, card tickets; gate: card score drop at most 3 points; ship if both pass
C. eval: loan tickets only; card scores logged for later; ship if the loan score passes
D. eval: card tickets only; gate: none; ship on Friday

**Answer:** B. Only the second option tests the old card line and blocks the release when that score falls past the limit. The third option logs the card score without a gate, so a drop still ships.

**Quick check:** Which change lowers forgetting, at some cost to the new job?

A. Train longer on the new tickets only
B. Mix a sample of old examples into the new training
C. Raise the learning rate so it adapts faster
D. Drop the old test set to save time

**Answer:** B. Replay keeps a reminder of the old job in every run. More training, or a faster learning rate, on new data alone pushes old skills out further. Dropping the old test set hides the damage.

## Can you answer these from memory?

**Flash cards**

- **What is catastrophic forgetting?** A model learns a new task and loses much of what it knew before.
- **Why does it happen?** The same weights hold many skills, and new training moves them.
- **What is replay?** Mixing a sample of old examples into the new training data.
- **Does LoRA help?** Forgets less than weight decay or dropout, but learns the new task much less well in small add-on setups.
- **How do you catch it?** Keep a frozen old-skills test set and run it after every training run.
- **What is the trade-off of replay?** Mixing in old data usually costs some accuracy on the new task.

## Likely follow-up questions

- Q297 How do you spot overfitting during fine-tuning? https://designervenkat.online/interview/ai/how-do-you-spot-overfitting-during-fine-tuning
- Q300 How do you evaluate a fine-tuned model? https://designervenkat.online/interview/ai/how-do-you-evaluate-a-fine-tuned-model
- Q284 What is LoRA? https://designervenkat.online/interview/ai/what-is-lora
- Q294 How do you prepare a fine-tuning dataset? https://designervenkat.online/interview/ai/how-to-prepare-a-fine-tuning-dataset
- Q282 What is full fine-tuning? https://designervenkat.online/interview/ai/what-is-full-fine-tuning
- Q302 Continued pretraining for a domain? (full answer coming)
