Gram-Calibrated Anchoring for Class-Incremental Learning

Qi Zhu, Ziang Gan, Libao ZhangNeurIPS 2026

TL;DR

When teaching a pre-trained Vision Transformer new classes sequentially, researchers usually assume that fine-tuning the model shifts its internal representation space so much that old class definitions must be constantly repaired or guarded. This paper shows that under Low-Rank Adaptation (LoRA), the representation barely drifts—meaning you can simply lock your classifier to the initial pre-trained class averages ("anchors") and never touch them again. Better yet, having a fixed coordinate system lets you mathematically untangle overlapping, look-alike classes at test time, boosting accuracy while slashing training costs by nearly 3x.

What Problem Does This Paper Address?

Imagine learning to identify dog breeds one week, and bird species the next, without ever looking at the dog photos again. In machine learning, this is Class-Incremental Learning (CIL), and its arch-nemesis is catastrophic forgetting: optimizing a network on new tasks overwrites the weights needed for old ones.

Today, we usually start with a powerful pre-trained Vision Transformer (ViT) and gently adapt it to new tasks using lightweight modules like LoRA, classifying images by seeing which class average—or prototype—their features are closest to (via cosine similarity). However, a nagging problem remains: as the backbone adapts to task 2, its feature space shifts, causing prototypes saved during task 1 to go stale ("feature drift"). Existing methods bend over backwards to fix this, building expanding pools of task-specific adapters or running complex post-hoc alignments.

Meanwhile, a quieter geometric problem goes ignored: pre-trained class prototypes aren't orthogonal. Semantically similar classes cluster together. Standard cosine similarity checks each class independently, causing evidence for a test image's true class to "leak" into correlated neighbors.

Methods

The authors introduce Gram-Calibrated Anchoring (GCA), which simplifies training and sharpens inference using a single continually updated LoRA module (no stored exemplars, no growing adapter pools).

Figure 2: Overview of Gram-Calibrated Anchoring (GCA). (a) Anchor prototypes ac are extracted once from the pretrained ViT f0 and form a frozen classification head; during incremental training, only LoRA parameters are updated against this fixed head. (b) At inference, standard cosine logits s = A⊤z are Gram-smoothed (s = Gβ + A⊤η), leaking evidence to correlated classes. GCI deconvolves by applying (G + λI)−1 to recover the coordinate vector γ⋆, then normalizes by per- class standard deviation σ to yield the final prediction ˆy = arg max ˜γ.
  1. Anchor-Frozen Training: When a new batch of classes arrives, GCA passes their images through the original, unadapted ViT once to compute their normalized mean features (anchor prototypes). It locks these anchors in as a frozen classification head and trains only the LoRA parameters against them. No proxy classifiers are trained, and prototypes are never recomputed.
  2. Gram-Compensated Inference (GCI): Because the anchors are fixed forever, we know the exact geometry between all observed classes—captured by their pairwise correlation matrix, the Gram matrix ($G = A^\top A$). Instead of naive cosine scoring ($A^\top z$), GCI treats inference as a ridge regression problem. It multiplies the cosine scores by the regularized inverse $(G + \lambda I)^{-1}$ to deconvolve (un-mix) evidence that leaked between similar classes. Finally, it divides each class's score by its noise-propagation standard deviation so classes sitting in dense semantic neighborhoods compete fairly against isolated ones.

Datasets

No new benchmarks are introduced. GCA is evaluated on four standard CIL image classification datasets, split into sequences of 10, 20, or 50 incremental tasks:

  • ImageNet-R (200 classes of artistic renditions from ImageNet)
  • ImageNet-A (200 classes of natural adversarial examples)
  • CUB-200 (200 fine-grained bird species)
  • CIFAR-100 (100 everyday object classes)

(Note: A cross-domain check on satellite imagery via EuroSAT is also briefly mentioned in the limitations/appendix).

Key Insights and Ideas

  • Feature drift under LoRA is surprisingly tame: You might expect sequential LoRA updates to warp the ViT's feature space. Yet empirically, relative weight perturbations stay tiny (< 0.09) and grow sub-linearly. Even "oracle" prototypes—cheating by re-encoding all past data with the final model—barely beat static pre-trained anchors (77.68% vs. 76.41% on ImageNet-R). Fighting prototype drift was solving a secondary problem!
  • Cosine similarity blurs correlated classes: If two classes share a 0.8 cosine correlation in pre-trained space, a pure signal for one automatically hands a 0.8 score to the other, shrinking the decision margin from 1.0 to 0.2.
  • Targeted surgery at test time: When the authors grouped classes using WordNet semantics, they found a clear correlation ($r = 0.65$) between how tightly clustered a group's anchors were and how much GCI boosted accuracy. GCI selectively fixes crowded semantic regions while leaving orthogonal classes alone.

Key Results

Tested on ViT-B/16 (pre-trained on ImageNet-21K and DINO), GCA delivers state-of-the-art or highly competitive accuracy at a fraction of the compute:

Accuracy vs. wall-clock training time and inference GFLOPs on ImageNet-A
  • Accuracy: On 20-task splits, GCA reaches 87.47% final average accuracy on CUB-200, 78.43% on ImageNet-R, and 63.91% on ImageNet-A—beating recent heavyweights like CL-LoRA by 9.47 percentage points on ImageNet-A and 12.82 points on CUB-200.
  • Extreme Long-Horizon Robustness: Across 50 tiny tasks on ImageNet-A, where adapter drift causes CL-LoRA to collapse to 24.33%, GCA holds steady at 60.37%.
  • Speed & Compute: On ImageNet-R ($T=10$), GCA cuts training FLOPs by 2.93x vs. CL-LoRA and 2.44x vs. LoRA-DRS, translating to 2.06x and 3.57x faster wall-clock training times, respectively.

Limitations and Future Work

GCA leans heavily on a foundational assumption: the pre-trained backbone must already separate the target classes reasonably well. If a downstream domain looks nothing like the pre-training data (such as EuroSAT satellite imagery), initial anchors may be poorly aligned, and forcing the model to stay near them creates a tug-of-war between stability and plasticity. To handle severe domain or modality shifts, the authors point toward adaptive regularization or periodic re-anchoring as promising next steps.

Summary updated

Abstract

We introduce Gram-Calibrated Anchoring (GCA) for class-incremental learning (CIL) with pre-trained models (PTMs), specifically Vision Transformers. GCA rests on the observation that, under continual low-rank adaptation (LoRA), ```anchor prototypes```---class means extracted once from the frozen pre-trained backbone---are effective substitutes for prototypes recomputed from the adapted model; a formal stability analysis bounds decision-boundary shifts in terms of feature-level prototype drift, while empirical LoRA perturbation measurements support the small-drift regime. This motivates fixing the classification head to anchor prototypes computed upon each task's arrival rather than recalibrating prototypes after training. The fixed anchor geometry then enables ```Gram-Compensated Inference``` (GCI), which applies the regularized inverse of the anchor Gram matrix to deconvolve inter-class correlation that standard cosine classification ignores, and normalizes each coordinate by its estimation standard deviation for fair cross-class comparison. The resulting method trains a single continually evolved LoRA module with no exemplar storage or expanding adapter pools. Experiments on ImageNet-R, ImageNet-A, CIFAR-100, and CUB-200 with multiple backbones show that GCA achieves competitive accuracy across four CIL benchmarks while significantly reducing training cost over recent methods.
BibTeX
@inproceedings{zhu2026gram,
  author = {Qi Zhu and Ziang Gan and Libao Zhang},
  title = {{Gram-Calibrated Anchoring for Class-Incremental Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=wGCFSJasYK},
}
Figure