M5-022M5: NLP & Large Language ModelsInstruction Tuning & Supervised Fine-TuningMedium
⚡Flashcard Drill➔Mastery:
Catastrophic Forgetting in SFT and Mitigation Strategies
🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Catastrophic forgetting occurs when fine-tuning on narrow instruction datasets overwrites pre-trained general knowledge and reasoning circuits, mitigated through pre-training data replay, low learning rates, and parameter-efficient tuning.
📌 Key Takeaways
- •Root cause: base model parameters optimized for broad web text are forcefully updated on small, domain-skewed SFT datasets, overwriting rare knowledge and subtle reasoning circuits
- •Manifestation: model becomes fluent at following instruction formats but suffers severe drops on benchmark reasoning (GSM8K, HumanEval) and factual knowledge (MMLU)
- •Mitigation strategies: Pre-training data replay (mixing 5-10% pre-training tokens into SFT), Parameter-Efficient Fine-Tuning (LoRA), conservative learning rates, and early stopping
📐 Mathematical Derivations
Mathematical Mechanism: 1. Weight Drift Formulation: Pre-trained weights reside in a broad minimum of pre-training loss . SFT optimizes . The parameter displacement is . By Taylor expansion of pre-training loss around : Because , the degradation in general capability is governed by the curvature . Large updates along sharp curvature directions destroy pre-trained representations. 2. Replay Regularization Objective: Maintaining constrains gradient updates to directions that do not increase pre-training cross-entropy.
🏭 Production Trade-offs
Deep Dive & Engineering Trade-offs: ① The Replay Buffer Standard: Incorporating a 5-10% replay mixture of high-quality pre-training data (code, math, general literature) during SFT is the most reliable industrial defense against forgetting. ② LoRA as an Architectural Regularizer: Because LoRA freezes the base weights and updates only a low-rank adapter , the base representations are mathematically preserved. If the adapted model exhibits regression, the adapter can be scaled down via or merged selectively. ③ Learning Rate Discipline: SFT learning rates must be an order of magnitude smaller than pre-training rates (e.g., for full fine-tuning; for LoRA). ④ Epoch Limits: SFT should rarely exceed 2-3 epochs. Training for 5+ epochs causes sharp overfitting to instruction patterns and rapid erosion of world knowledge. ⑤ Interview Strategy: Formulate weight drift using Taylor expansion and the Hessian, explain the pre-training replay loss objective, and contrast full fine-tuning with LoRA's protective freeze mechanism.
⚠️ Common Interview Pitfalls
- ✕Fine-tuning with learning rates as large as pre-training rates (causes immediate representational collapse)
- ✕Training SFT for too many epochs (>4 epochs rapidly accelerates catastrophic forgetting)
- ✕Evaluating only instruction-following benchmarks while failing to monitor core reasoning benchmarks (MMLU, GSM8K)
🎯 Interviewer Follow-up Inquiries
- ?Why does mixing 5% pre-training data into SFT prevent catastrophic forgetting without harming conversational ability?
- ?How does Weight Decay regularize parameter drift during supervised fine-tuning?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚