iCaRL (Incremental Classifier and Representation Learning) is a class-incremental learning algorithm that enables a neural network to learn new object categories sequentially over time without catastrophically forgetting previously learned ones. Its core innovation is a hybrid approach combining a nearest-mean-of-exemplars classification rule with knowledge distillation and a bounded episodic memory of stored examples. This allows the model to be updated with new data while preserving its performance on all past classes, operating without explicit task identifiers at inference time.
Glossary
iCaRL (Incremental Classifier and Representation Learning)

What is iCaRL (Incremental Classifier and Representation Learning)?
iCaRL is a foundational algorithm in class-incremental learning that enables a model to learn new categories over time without forgetting old ones, using a combination of exemplar memory and knowledge distillation.
The algorithm works in three key phases. First, it uses herding to select and retain a maximally representative subset of images (exemplars) for each old class in a fixed-size memory buffer. Second, when learning new classes, it applies a distillation loss to constrain the model's outputs on old classes, preserving its previous decision boundaries. Finally, it employs a nearest-mean-of-exemplars classifier at inference, comparing new inputs to the mean feature vector of each class's stored exemplars, which is more stable than a standard softmax layer for incremental learning.
Key Features of the iCaRL Algorithm
iCaRL is a foundational algorithm for class-incremental learning. Its design combines a bounded memory, a distillation-based training objective, and a specialized classification rule to enable models to learn new visual concepts over time without forgetting old ones.
Bounded Exemplar Memory
iCaRL maintains a small, fixed-size episodic memory of real data samples (exemplars) from previously learned classes. This memory is managed using a herding algorithm, which selects a representative subset of images that best approximates the class mean in the feature space. The bounded size creates a fundamental plasticity-stability trade-off, forcing the algorithm to be selective about what past knowledge to preserve.
Nearest-Mean-of-Exemplars Classification
At inference, iCaRL does not use a standard linear classifier. Instead, it employs a nearest-mean-of-exemplars rule. For each class, a prototype vector is computed as the mean feature vector of all its stored exemplars. A new sample is classified by comparing its extracted features to all class prototypes using Euclidean distance and assigning the label of the closest prototype. This non-parametric rule is inherently adaptable to new classes without retraining the final classification layer.
Knowledge Distillation Loss
The core mechanism for preventing catastrophic forgetting is distillation for forgetting. When learning a new set of classes, the model's predictions on new data are combined with its own predictions (from the previous model state) on the same data. A knowledge distillation loss (typically Kullback-Leibler divergence) penalizes deviations from the old model's outputs, effectively encouraging the new model to retain its original behavior on the feature representations relevant to old tasks.
Combined Classification & Distillation Objective
iCaRL's training objective is a weighted sum of two losses:
- A standard cross-entropy loss on the new classes (using both new data and exemplars from the memory).
- The knowledge distillation loss applied to all classes (old and new) using exemplars from the memory. This dual objective ensures the model simultaneously acquires new knowledge (plasticity) and consolidates old knowledge (stability). The feature extractor is updated end-to-end under this combined signal.
Incremental Representation Learning
Unlike methods that freeze the feature extractor, iCaRL updates the deep representation (the convolutional backbone) continuously. The distillation loss regularizes updates to this shared representation, allowing it to evolve for new tasks while remaining useful for old ones. This enables forward transfer—where learning new classes can sometimes improve performance on old ones—and is key to long-term scalability.
Task-Agnostic Inference
iCaRL operates in a class-incremental learning setting, which is task-agnostic. The model is not provided with a task identifier at test time and must distinguish between all classes seen so far. The nearest-mean-of-exemplars classifier naturally supports this, as the set of class prototypes is simply expanded as new tasks arrive. This makes the algorithm suitable for real-world deployment where task boundaries are unclear.
iCaRL vs. Other Continual Learning Approaches
A feature comparison of the iCaRL algorithm against other major families of continual learning methods, highlighting core mechanisms and practical trade-offs.
| Feature / Mechanism | iCaRL (Incremental Classifier and Representation Learning) | Regularization-Based Methods (e.g., EWC, LwF) | Dynamic Architecture Methods (e.g., Progressive Nets) |
|---|---|---|---|
Core Strategy | Exemplar memory + knowledge distillation | Regularization loss constraints | Expanding or routing network parameters |
Requires Stored Raw Data? | |||
Bounded Memory Footprint | |||
Network Capacity Fixed? | |||
Task Identity Required at Inference? | |||
Primary Use Case | Class-incremental learning | Task-incremental learning | Task-incremental or multi-task learning |
Mitigates Catastrophic Forgetting Via... | Rehearsal & distillation | Parameter importance penalties | Parameter isolation or specialization |
Scalability to Many Tasks | Limited by memory buffer | High (no data storage) | Limited by growing parameters |
Frequently Asked Questions
iCaRL (Incremental Classifier and Representation Learning) is a foundational algorithm in class-incremental learning. It addresses the challenge of learning new visual classes over time without forgetting old ones, using a combination of exemplar memory, knowledge distillation, and a specialized classification rule.
iCaRL (Incremental Classifier and Representation Learning) is a class-incremental learning algorithm that enables a neural network to learn new object classes sequentially without catastrophic forgetting of previously learned classes. It works through three core mechanisms: a bounded episodic memory that stores a few exemplars per old class, knowledge distillation applied to the network's outputs to preserve old knowledge, and a nearest-mean-of-exemplars classification rule that uses stored exemplars to compute class prototypes in the feature space for inference.
Operationally, when learning a new set of classes, iCaRL:
- Combines new data with exemplars from memory in a balanced batch.
- Trains the network with a combined loss: a standard classification loss for new data and a distillation loss that penalizes deviation from the old model's predictions on the exemplars.
- Updates the memory using a herding algorithm to select the most representative exemplars for all classes seen so far, within a fixed total budget.
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
iCaRL integrates several key techniques from continual learning and model compression. These related concepts define its mechanisms for knowledge retention and incremental adaptation.
Knowledge Distillation
Knowledge distillation is a model compression and transfer learning technique where a smaller student model is trained to mimic the behavior of a larger teacher model. In iCaRL, this principle is applied internally: the model from the previous learning step acts as the teacher, providing soft targets to regularize training on new data, thereby preserving old knowledge. The loss function typically uses Kullback-Leibler (KL) Divergence to match probability distributions.
- Core Mechanism: Transfers 'dark knowledge' from logits.
- iCaRL Role: Prevents catastrophic forgetting by distilling old model's predictions.
Catastrophic Forgetting
Catastrophic forgetting, or catastrophic interference, is the tendency of a neural network to abruptly and drastically lose performance on previously learned tasks when trained on new data. It is the central problem iCaRL is designed to solve. This occurs due to the overwriting of shared weights during gradient-based optimization on a non-stationary data stream.
- Cause: Unconstrained parameter updates for new tasks.
- iCaRL's Solution: Combines knowledge distillation loss with exemplar rehearsal to constrain updates and consolidate old knowledge.
Experience Replay
Experience replay is a continual learning mechanism where a subset of past training examples is stored in a memory buffer and replayed during new learning phases. iCaRL implements a bounded exemplar memory, storing a fixed number of representative images per old class using a herding algorithm. This provides direct exposure to old data.
- Memory Management: Uses herding to select representative exemplars.
- Function: Provides real data for rehearsal alongside distillation, grounding the regularization signal.
Class-Incremental Learning
Class-incremental learning (CIL) is the specific continual learning scenario addressed by iCaRL. The model must learn new classes sequentially over time while maintaining performance on all previously seen classes, without receiving task identifiers at inference. This is more challenging than task-incremental learning, as the model must autonomously discriminate between all classes.
- Key Challenge: No task-ID provided during prediction.
- iCaRL's Classifier: Employs a nearest-mean-of-exemplars rule in the feature space, which is inherently task-agnostic.
Nearest-Mean-of-Exemplars Classification
This is the novel classification rule introduced by iCaRL for the class-incremental setting. Instead of using a standard linear output layer (which biases towards newly learned classes), iCaRL classifies based on distance in feature space. For each class, a prototype vector is computed as the mean feature vector of its stored exemplars. At inference, a sample is assigned to the class with the closest prototype.
- Advantage: Naturally accommodates new classes without retraining the classifier head.
- Requirement: Depends on a stable, high-quality feature representation learned via distillation.
Learning without Forgetting (LwF)
Learning without Forgetting is a seminal continual learning algorithm that, like iCaRL, uses knowledge distillation to preserve old knowledge. However, LwF is exemplar-free; it relies solely on distilling the model's own responses on new data to approximate its old behavior. iCaRL extends this concept by adding an exemplar memory, which provides a more stable and accurate distillation target and enables the nearest-mean classifier.
- Comparison: LwF is a pure distillation approach, while iCaRL is a hybrid (distillation + replay) method.
- Trade-off: iCaRL typically achieves higher accuracy at the cost of maintaining a memory buffer.

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