Catastrophic Forgetting › Visualizing Forgetting Dynamics
Language AI HandbookAll chapters Catastrophic Forgetting › Visualizing Forgetting DynamicsOne section · Sections in this chapter4 / 13 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
To develop strong intuition about how forgetting evolves during fine-tuning, let's simulate the training dynamics directly. We'll track two quantities simultaneously: performance on the new fine-tuning task (which we want to increase) and performance on the original capability (which we want to preserve). This dual tracking is the core discipline of forgetting-aware fine-tuning.
import numpy as np
np.random.seed(42)
# Simulate fine-tuning dynamics
epochs = 50
# Task A: original task (pre-training proxy)
# Task B: new fine-tuning task
# Before fine-tuning
task_a_baseline = 0.85
task_b_baseline = 0.45
# Simulate learning curves during fine-tuning
task_b_performance = []
task_a_performance = []
for epoch in range(epochs):
# Task B improves with training
task_b = task_b_baseline + (0.95 - task_b_baseline) * (
1 - np.exp(-epoch / 10)
)
task_b += np.random.normal(0, 0.01)
task_b_performance.append(np.clip(task_b, 0, 1))
# Task A degrades - rapid initial forgetting, then stabilizes
forgetting_rate = 0.3 * (1 - np.exp(-epoch / 8))
task_a = task_a_baseline - forgetting_rate + np.random.normal(0, 0.01)
task_a_performance.append(np.clip(task_a, 0, 1))
The visualization reveals a characteristic pattern: most forgetting happens early in training when learning rates are highest and the model is adjusting most aggressively. Later epochs show diminishing returns on both learning and forgetting as the model approaches a new equilibrium. This front-loaded forgetting profile has a practical implication: the first few epochs of fine-tuning are the most dangerous for prior capabilities. If you can control the rate of change in those early epochs, through learning rate warmup, layer freezing, or regularization, you can often prevent the most severe forgetting while still achieving strong task performance.