Complementary Cache Guidance with Gradient Disentanglement for Continuous Test-Time Adaptation

Fanchun Meng, Yuhang Pei, Jiazhen Huang, Tao Ren, Yifan Wang, Wei Ju, Xiao LuoNeurIPS 2026

TL;DR

Vision-language models like CLIP stumble when deployed in real-world environments where data distributions shift continuously, and trying to adapt them on the fly often causes them to overwrite what they already know. This paper introduces CURE, a framework that balances rapid adaptation with long-term memory by combining a dual-timescale cache with geometric gradient disentanglement. By forcing long-term historical updates to live in the mathematical "null space" of short-term learning signals, the model adapts to new domains without suffering from catastrophic forgetting.

What Problem Does This Paper Address?

Pretrained Vision-Language Models (VLMs) are remarkably good at zero-shot tasks, right up until the real world throws a distribution shift at them—like changing weather, lighting, or visual styles. Continuous Test-Time Adaptation (CTTA) tries to fix this by updating the model on the fly using unlabeled, streaming test data.

However, existing CTTA methods run into two nasty roadblocks when the environment keeps changing:

  1. Error accumulation from overconfidence: Standard methods rely on the model's own confidence (low entropy) to generate "pseudo-labels" for self-training. But VLMs are notoriously overconfident even when wrong. In a shifting stream, bad pseudo-labels snowball and poison the model.
  2. Parameter interference: Updating weights to handle a new domain often conflicts with parameters needed for previous domains.
Figure 1: Catastrophic forgetting during continuous test- time adaptation. The curves show accuracy on the initial Flowers102 domain as adaptation proceeds across the domains on the x-axis. The blue dashed line represents frozen zero-shot CLIP-ViT-B/16, while the red dashed line represents a standard TTA baseline. Gray bars in- dicate gradient cosine similarity between updates from the current and initial domains.

As shown above, as a standard TTA model adapts across a sequence of datasets, gradient updates begin to conflict (negative cosine similarity), overwriting prior knowledge and dragging performance below the frozen zero-shot baseline.

Methods

To balance short-term plasticity with long-term stability, CURE (Complementary Cache Guidance with Gradient Disentanglement) introduces three connected mechanisms, updating only the lightweight affine parameters of the normalization layers for efficiency:

Figure 2: The overall framework of our CURE. Given the streaming test samples, we construct the affinity structure among text prompts as a voting committee to estimate the prediction reliability, then maintain a complementary cache system to capture recent adaptation dynamics and stable historical knowledge. The cached representations further guide low-rank subspace disentanglement.
  • Semantic Voting Committee (New): Instead of trusting raw prediction entropy—or naively averaging multiple text prompts—CURE builds an affinity graph of diverse text prompts for each class, sorting them from semantic outliers to centroids. Progressive groups of prompts vote on the image's label. If the vote is split or disagrees with the base prediction, the sample's entropy is penalized so noisy data gets filtered out.
  • Complementary Dual Cache (New): While single-cache TTA is standard, CURE splits memory into two queues. A short-term cache stores recent, reliable samples (low reweighted entropy) to capture local dynamics. A long-term cache monitors gradient consistency across steps, specifically selecting reliable samples from the short-term cache that have weak or negative alignment with the current update—preserving historical evidence that might otherwise be forgotten.
  • Gradient Space Disentanglement (New): Learning from both caches simultaneously would normally cause their gradients to clash. CURE collects recent short-term gradients and uses Singular Value Decomposition (SVD) to project short-term updates onto a top-$r$ low-rank principal subspace (filtering out transient batch noise). Crucially, it projects long-term cache updates onto the orthogonal null space of those short-term directions, ensuring historical consolidation never interferes with immediate adaptation.

Datasets

Because CURE operates strictly at test time, no source training data is used. The authors evaluate it on two standard benchmarks (no new datasets are introduced):

  • Cross-Dataset Generalization: 10 diverse recognition datasets, including Flowers102, OxfordPets, StanfordCars, FGVC-Aircraft, Food101, EuroSAT, UCF101, DTD, SUN397, and Caltech101.
  • Out-of-Distribution (OOD) Generalization: ImageNet alongside four shifted variants: ImageNet-A, ImageNet-V2, ImageNet-R, and ImageNet-Sketch.

Key Insights and Ideas

  • "Unhelpful" samples are great for long-term memory: When moving data from the short-term to the long-term cache, CURE picks already-vetted samples with the lowest contribution scores to the current step's loss reduction. Low alignment with right-now updates doesn't mean a sample is bad—it means it holds distinct historical patterns that the current batch isn't reinforcing.
  • Less is more in subspace rank: In sensitivity tests, setting the short-term subspace rank to $r=8$ was optimal. Making the rank too large actually hurts accuracy because it shrinks the complementary null space, leaving less geometric room to protect long-term knowledge.
  • Every leg of the stool matters: Ablation studies show that removing long-term caching drops overall accuracy by 2.86%, while removing either null-space projection (-2.54%), low-rank projection (-2.42%), or prompt voting (-2.45%) causes nearly identical, substantial drops. Reliability, memory, and geometry have to work together.

Key Results

Using CLIP (ViT-B/16), CURE achieves state-of-the-art accuracy while avoiding the heavy compute of backpropagation-heavy prompt-tuning methods (like TPT and DiffTPT):

  • Cross-Domain: CURE hits an average accuracy of 70.13% across the 10 datasets (ranking 2.2 on average), beating zero-shot CLIP (63.46%) by 6.67 percentage points and edging out the strongest cache-based competitor, DPE (69.40%), on every single dataset.
  • ImageNet & OOD: CURE reaches 66.25% overall average accuracy (64.78% OOD average, rank 1.7), improving ImageNet accuracy to 72.15% (+5.42% over zero-shot CLIP) with moderate memory and testing-time overhead.
  • Qualitative: t-SNE visualizations on EuroSAT confirm that CURE transforms CLIP's scattered, overlapping zero-shot features into tight, cleanly separated class clusters online without any ground-truth labels.

Limitations and Future Work

Not discussed in the paper. (Note: At least within the main body of the manuscript, the authors do not include a dedicated section discussing limitations or future directions).

Summary updated

Abstract

Continuous test-time adaptation (CTTA) is crucial for deploying vision-language models (VLMs) in real-world environments where data distributions shift over time. Existing approaches typically utilize confidence-driven pseudo-labeling to enhance the performance on the target domain while retraining VLMs using historical information. Despite the progress, their performance is far from satisfactory due to error accumulation from noisy pseudo-labels and optimization interference between newly acquired and historical knowledge. Towards this end, we propose a novel approach named Complementary Cache Guidance with Gradient Disentanglement (CURE) for CTTA of VLMs. The core of our CURE is to balance instant knowledge acquisition and historical knowledge consolidation using both complementary cache systems and parameter space disentanglement. In particular, our CURE first constructs affinity structures among diverse text prompts, which guide majority voting to improve the quality of pseudo-labeling. More importantly, our CURE introduces a complementary cache system consisting of a short-term cache and a long-term cache with sample quality monitoring. The short-term cache stores recent reliable samples with low reweighted entropy, while the long-term cache preserves representative samples with high gradient consistency across iterations. Then, we extract prototypes from both caches for cross-modal alignment, enabling the model to acquire new knowledge while mitigating old knowledge forgetting. To further reduce the interference when learning from two caches, we perform low-rank decomposition of the gradient space, which facilitates historical knowledge consolidation in the null space of short-term signals. Extensive experiments on several benchmarks demonstrate the superiority of CURE over state-of-the-art baselines. Our source code is available at https://github.com/Fan-Chun-Meng/CURE.
BibTeX
@inproceedings{meng2026complementary,
  author = {Fanchun Meng and Yuhang Pei and Jiazhen Huang and Tao Ren and Yifan Wang and Wei Ju and Xiao Luo},
  title = {{Complementary Cache Guidance with Gradient Disentanglement for Continuous Test-Time Adaptation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bU9thZFC6N},
}
Figure