Distillation for forgetting is a regularization-based method in continual learning that repurposes knowledge distillation to preserve a model's performance on previously learned tasks. Instead of using a separate teacher model, the technique employs the model's own outputs—recorded before learning a new task—as soft targets or dark knowledge to guide and constrain parameter updates. This creates a self-supervised signal that penalizes the model for deviating too far from its prior knowledge state, directly addressing the plasticity-stability trade-off.
Glossary
Distillation for Forgetting

What is Distillation for Forgetting?
Distillation for forgetting is the application of knowledge distillation as a regularization technique in continual learning, where the current model's predictions on previous tasks are used as soft targets to mitigate catastrophic forgetting.
The method is foundational to algorithms like Learning without Forgetting (LwF). It operates by storing the model's logits for a set of representative inputs from an old task. When learning a new task, these stored outputs are replayed, and a distillation loss, such as KL divergence, is calculated between the old and new predictions. This loss is combined with the standard cross-entropy loss for the new task, ensuring the model consolidates old knowledge while integrating new information, effectively preventing catastrophic forgetting without requiring a large memory of raw data.
Core Mechanisms of Distillation for Forgetting
Distillation for forgetting uses knowledge distillation as a regularization technique to preserve a model's performance on previous tasks while it learns new ones, directly addressing the plasticity-stability trade-off in continual learning.
Soft Target Regularization
This mechanism is the core of how distillation mitigates catastrophic forgetting. Instead of using hard, one-hot labels for past data, the model's previous predictions are softened using temperature scaling (parameter T > 1) in the softmax function. This creates a probability distribution where the correct class has the highest probability, but related classes have non-zero values, encoding the model's learned class similarities. The student (the current model) is trained to match this rich distribution.
- Why it works: Soft targets provide a more informative gradient than hard labels, gently guiding parameter updates to preserve the existing decision boundaries.
- Analogy: It's like asking the model to "remember the reasoning" behind its old answers, not just the answers themselves.
- Critical Parameter: The temperature T controls the softening level; higher T produces a more uniform distribution, emphasizing dark knowledge.
Distillation Loss as a Stability Constraint
In the continual learning objective, the distillation loss term acts as a regularizer that penalizes changes to the model's functional mapping for inputs from previous tasks. It directly enforces stability. The total loss for a new task is often: L_total = L_new_task + λ * L_distill. Here, L_distill measures the discrepancy (e.g., KL divergence) between the current model's outputs and the soft targets from the old model.
- Role of λ: The hyperparameter λ balances plasticity (learning the new task) and stability (remembering old tasks).
- Contrast with Replay: Unlike experience replay, which rehearses on raw stored data, this is a functional replay—it rehearses the function the model learned.
- Limitation: Performance depends on the model's ability to generate accurate soft targets for old data without access to that data, which can degrade over many tasks.
Task-Agnostic and Identity-Aware Variants
Distillation for forgetting is applied differently based on the continual learning scenario:
- Task-Incremental Learning (Task-ID known): The standard application, as in LwF. A task-specific output head is added for the new task, and distillation is applied to the old heads.
- Class-Incremental Learning (No Task-ID): A more challenging setting where all classes share a single output head. Algorithms like iCaRL combine distillation with an exemplar memory and a nearest-mean-of-exemplars classifier. Distillation here preserves the embedding space geometry for old classes.
- Task-Agnostic Learning: The model is not informed of task boundaries. Distillation can be applied continuously or periodically using a snapshot of the model from a previous time step as the teacher, enforcing gradual evolution rather than abrupt forgetting.
Synergy with Memory Buffers
While pure distillation uses zero raw memory, it is often combined with a small episodic memory buffer for improved performance. This hybrid approach is seen in algorithms like iCaRL. The buffer stores a few real examples per past class. During training on a new task:
- Replay Data: Examples from the memory buffer are intermixed with new task data.
- Distillation Labels: For these replayed examples, the loss is a combination of the standard label loss and the distillation loss from the old model.
- Advantage: Provides ground-truth signals alongside soft targets, anchoring the model to real data and mitigating error accumulation from imperfect self-generated labels.
- Buffer Management: Critical strategies include herding (selecting representative exemplars) or random selection.
- Comparison: This is more effective than pure distillation but introduces the overhead of storing and managing a data buffer.
Limitations and Failure Modes
Understanding the boundaries of distillation for forgetting is crucial for system design:
- Long Task Sequences: Distillation loss can become less effective over many tasks as the teacher model's knowledge becomes increasingly outdated, leading to knowledge dilution.
- Dramatic Distribution Shifts: If a new task is radically different from previous tasks, the shared feature representation may need to change significantly, causing an inherent conflict that distillation cannot fully resolve.
- Bias Towards Recent Tasks: Without exemplars, the model may still gradually forget very early tasks, a phenomenon known as temporal bias.
- Computational Overhead: Requires forward passes to generate soft targets for rehearsal, though this is typically less costly than full generative replay.
- Not a Standalone Solution: Often requires careful tuning of λ and temperature T, and is most robust when combined with other techniques like a tiny memory buffer or elastic weight consolidation-like penalties.
Distillation for Forgetting vs. Other Continual Learning Methods
A technical comparison of knowledge distillation as a regularization technique against other primary strategies for mitigating catastrophic forgetting in continual learning.
| Method / Feature | Distillation for Forgetting | Regularization-Based (e.g., EWC) | Replay-Based (e.g., Experience Replay) | Architectural (e.g., Dynamic Networks) |
|---|---|---|---|---|
Core Mechanism | Uses model's own soft predictions (logits) on past tasks as a regularization target | Adds a penalty to parameter updates based on estimated importance to past tasks | Stores and retrains on a subset of raw or generated past data | Expands model capacity or routes information through task-specific components |
Explicit Past Data Storage | ||||
Computational Overhead | Low (forward passes for pseudo-data) | Medium (importance matrix calculation) | High (buffer management & replay training) | Varies (can be high for parameter growth) |
Memory Footprint | Very Low (stores only model parameters) | Low (stores Fisher/importance diagonal) | High (stores raw/synthetic examples) | Medium to High (stores task-specific parameters) |
Handles Task-Agnostic Scenarios | ||||
Preserves Exact Outputs | No (preserves relative probabilities/dark knowledge) | No (preserves important parameters) | Yes (re-exposes model to original data) | Yes (via dedicated sub-networks) |
Risk of Negative Transfer | Medium (if data drift is severe) | Low | Low | Very Low |
Primary Hyperparameter | Distillation loss weight (λ), Temperature (T) | Regularization strength (λ) | Memory buffer size, Replay ratio | Network expansion/gating policy |
Common Implementations and Algorithms
These are the primary algorithmic frameworks that apply knowledge distillation as a regularization technique to mitigate catastrophic forgetting in continual learning scenarios.
Learning without Forgetting (LwF)
Learning without Forgetting is the foundational algorithm for distillation-based continual learning. When learning a new task, the model generates soft targets for data from previous tasks using its own, frozen parameters from before the new training step. A distillation loss (e.g., KL divergence) between these old and new outputs is then added to the standard cross-entropy loss for the new task. This penalizes the model for changing its predictions on old data, effectively using itself as a static teacher to preserve prior knowledge without storing raw data.
- Key Mechanism: Self-distillation using frozen model snapshots.
- Primary Use Case: Task-incremental learning where task identity is known at inference.
- Limitation: Performance can degrade over many tasks without any exemplar memory.
iCaRL (Incremental Classifier and Representation Learning)
iCaRL is a comprehensive algorithm for class-incremental learning. It combines a bounded exemplar memory, a nearest-mean-of-exemplars classification rule, and knowledge distillation. For each old class, a few representative images are stored. When learning new classes, the model is trained with a combined loss: classification loss on new classes and a distillation loss applied to the outputs for old classes. The distillation loss ensures the logits for old classes remain stable. The classification rule at inference uses the stored exemplars to compute class prototypes, making it task-agnostic.
- Key Components: Exemplar memory, distillation loss, prototype-based inference.
- Primary Use Case: Class-incremental learning where new classes arrive sequentially.
- Advantage: Provides a practical, integrated system for incremental learning.
Generative Replay with Distillation
This method uses a generative model (e.g., a GAN or VAE) as a pseudo-rehearsal mechanism. The generator is trained to produce synthetic data representative of past tasks. During training on a new task, these generated pseudo-samples are interleaved with real new data. A distillation loss is applied to the model's predictions on these synthetic samples, comparing them to the predictions from a saved copy of the old model. This approach decouples the memory of data from the main model, using distillation to transfer the behavioral knowledge of past tasks through generated data.
- Key Mechanism: Generative model as a dynamic memory buffer.
- Primary Use Case: Scenarios where storing raw data is prohibited (privacy, storage).
- Challenge: Requires training and maintaining a high-fidelity generative model.
Dark Experience Replay (DER/DER++)
Dark Experience Replay enhances standard experience replay by storing not just raw input-label pairs, but also the model's logit outputs (the 'dark knowledge') at the time of learning. When replaying these memories, the loss function includes a dark knowledge distillation loss between the stored logits and the current model's logits, in addition to the standard classification loss. DER++ adds a further term to also replay the ground-truth labels. This provides a richer, more stable signal for consolidation, as the model is regularized to maintain its old internal representations.
- Key Mechanism: Memory buffer stores logits (dark knowledge) alongside data.
- Primary Use Case: Online continual learning with a fixed memory budget.
- Advantage: More efficient use of memory compared to storing only raw data.
Regularization-Augmented Distillation
This is a hybrid approach that combines distillation losses with parameter-based regularization techniques. Algorithms like Elastic Weight Consolidation (EWC) or Synaptic Intelligence (SI) estimate the importance of each network parameter to previous tasks. During new task training, the overall loss function becomes a sum of: the new task's classification loss, a distillation loss on old task outputs, and a regularization penalty that discourages movement of important parameters. The distillation loss preserves functional knowledge (outputs), while the parameter regularization preserves structural knowledge (important weights).
- Key Mechanism: Dual constraint on both model outputs and parameter values.
- Primary Use Case: Scenarios requiring extremely strong forgetting prevention over long task sequences.
- Consideration: Increased computational cost for calculating parameter importance.
Online Distillation for Continual Learning
This strategy employs multi-model online distillation. Instead of a single model, an ensemble or two models are maintained and trained concurrently on the data stream. The models act as peer teachers for each other. As new data arrives, each model is trained with a loss that includes a distillation term from the other model's predictions on a shared subset of data or past examples. This mutual distillation encourages consensus and stability in the evolving knowledge base. It is a form of collaborative continual learning that distributes the consolidation effort across multiple learners.
- Key Mechanism: Mutual, concurrent distillation between peer models.
- Primary Use Case: Systems with sufficient compute to maintain multiple model instances.
- Benefit: Can be more robust than self-distillation (LwF) as it leverages diverse learning perspectives.
Frequently Asked Questions
Distillation for forgetting is a core regularization technique in continual learning. These FAQs address its mechanisms, applications, and how it differs from related concepts.
Distillation for forgetting is the application of knowledge distillation as a regularization technique in continual learning. It works by using the model's own predictions (or those of a saved copy) on data from previous tasks as soft targets during training on new tasks. A distillation loss, typically Kullback-Leibler (KL) divergence, is added to the standard cross-entropy loss for the new task. This penalizes the model for deviating too far from its previous responses, thereby consolidating old knowledge and mitigating catastrophic forgetting without always requiring stored raw data.
Key Mechanism: When learning task B, the model (or a frozen copy from after task A) processes examples from task A. Its softened output logits become targets. The current model is trained to predict new labels for task B and to match its old probabilistic outputs for task A, preserving learned relationships between classes.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
These techniques and concepts are fundamental to understanding how distillation is applied within continual learning systems to manage the stability-plasticity trade-off.
Plasticity-Stability Trade-off
The Plasticity-Stability Trade-off is the fundamental, competing-objective challenge at the heart of continual learning. A model must be plastic enough to learn new information, yet stable enough to retain old knowledge.
- Stability: The resistance to catastrophic forgetting of previous tasks.
- Plasticity: The capacity to acquire new knowledge and adapt to new data distributions.
- Distillation's Role: Distillation for forgetting is a primary technique for enhancing stability. By penalizing deviation from previous behavior, it anchors the model, but must be carefully balanced to avoid stifling plasticity.
- System Design Impact: This trade-off dictates the choice and tuning of regularization strengths, memory sizes, and architectural adjustments in any continual learning system.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us