CAMA: Calibrated Anti-Collapse Marginal Alignment for Test-Time Adaptation of Vision-Language Models
Organizations: The University of Texas at Dallas
Abstract
Test-time adaptation (TTA) updates a model using unlabeled test data to help it handle distribution shifts. However, prior work has found that image corruption causes a vision-language model (VLM) to produce more similar features for different images, a phenomenon known as feature compression. Under compression, entropy minimization, the most common TTA objective, can cause the model to favor a few classes and perform worse than before adaptation. Despite these observations, a detailed analysis of how these failures are connected and an effective strategy for preventing them are still lacking. In this paper, we first analyze why entropy minimization fails for VLMs. We then propose CAMA, a new test-time adaptation objective that maximizes batch mutual information to encourage confident predictions for individual images while maintaining diverse predictions across the batch. CAMA also estimates a reference class distribution early in the test stream and aligns each batch's average prediction with this reference during adaptation. We prove that feature compression biases the predictions and that entropy minimization amplifies this bias into collapse, whereas CAMA is guaranteed to preserve every class. Across standard corruption benchmarks, we observe collapse on nearly every VLM backbone evaluated. CAMA prevents collapse in every observed case and, in turn, achieves the best accuracy on every backbone. Quantitative and qualitative analyses confirm that CAMA reverses the feature compression behind the collapse, and ablations show that each of its components contributes.
Figures & tables
| CIFAR-10-C | CIFAR-100-C | |||||||||
| Method | Noise | Blur | Weather | Digital | Mean | Noise | Blur | Weather | Digital | Mean |
| ZS [ 27 ] | 44.68 | 63.55 | 76.48 | 55.81 | 61.16 | 22.10 | 38.42 | 49.17 | 30.03 | 35.79 |
| TENT [ 31 ] | 23.96 | 65.50 | 84.81 | 64.34 | 62.03 | 8.05 | 41.89 | 51.72 | 42.71 | 37.96 |
| RoTTA [ 35 ] | 45.83 | 63.88 | 77.00 | 56.82 | 61.89 | 23.01 | 38.38 | 49.38 | 30.44 | 36.12 |
| RPL [ 28 ] | 24.54 | 63.67 | 85.31 | 63.32 | 61.52 | 6.87 | 42.95 | 52.77 | 43.40 | 38.47 |
| SAR [ 24 ] | 54.05 | 67.86 | 80.06 | 64.17 | 67.37 | 28.42 | 42.35 | 53.68 | 37.12 | 41.19 |
| Backbone | Benchmark | ZS | TENT | SAR | BATCLIP | Mint | ClipTTA | CAMA |
|---|---|---|---|---|---|---|---|---|
| SigLIP [ 37 ] | C10-C | 59.04 | 59.93 | 65.70 | 72.80 | 70.01 | 67.46 | 78.43 |
| C100-C | 34.76 | 24.37 | 35.90 | 41.35 | 42.91 | 40.34 | 48.70 | |
| IN-C | 27.91 | 28.67 | 30.29 | 29.89 | 33.26 | 31.12 | 37.20 | |
| MetaCLIP [ 34 ] | C10-C | 75.94 | 84.50 | 80.14 | 85.17 | 83.25 | 80.58 | 87.33 |
| C100-C | 48.12 | 54.54 | 54.57 | 55.60 | 57.26 | 53.79 | 61.70 | |
| IN-C | 31.49 | 32.95 | 35.07 | 36.02 | 36.26 | 33.73 | 39.89 |
| Feature cosine | Top share (%) | Accuracy (%) | ||||||
|---|---|---|---|---|---|---|---|---|
| Backbone | ZS | TENT | CAMA | TENT | CAMA | ZS | TENT | CAMA |
| CLIP B/16 | 0.91 | 0.92 | 0.68 | 80.1 | 12.6 | 43.7 | 23.1 | 70.2 |
| SigLIP | 0.87 | 0.89 | 0.64 | 76.9 | 12.7 | 40.6 | 26.4 | 67.3 |
| EVA-CLIP | 0.70 | 0.93 | 0.28 | 60.7 | 10.4 | 73.8 | 44.2 | 86.2 |
| ConvNeXt | 0.68 | 0.89 | 0.39 | 72.8 | 11.0 | 58.8 | 31.4 | 76.3 |
| RN50 | 0.88 | 0.93 | 0.52 | 95.8 | 11.1 | 35.1 | 12.1 | 58.3 |
| Reference | CIFAR-10-C | CIFAR-100-C | ImageNet-C |
|---|---|---|---|
| Oracle | 79.55 | 48.78 | 34.95 |
| CAMA | 79.46 | 48.77 | 34.93 |
| Mean-prob | 68.00 | 39.49 | 23.41 |
| Mean-logit | 58.54 | 41.33 | 14.63 |
| Batch size | |||||
|---|---|---|---|---|---|
| Benchmark ( ) | |||||
| CIFAR-10-C (10) | |||||
| CIFAR-100-C (100) | |||||
| ImageNet-C (1000) | |||||
Appendix figures & tables19 assets
Supplementary material from the paper’s appendix.
Appendix
| =10 | =100 | =1000 | ||||
|---|---|---|---|---|---|---|
| Family | Range | Mean | Range | Mean | Range | Mean |
| Noise | 1.6–2.9 | 2.1 | 1.9–2.4 | 2.1 | 1.00–1.01 | 1.00 |
| Blur | 2.6–6.2 | 4.7 | 1.9–5.8 | 4.5 | 1.14–1.15 | 1.14 |
| Weather | 5.1–6.3 | 5.6 | 6.6–9.1 | 8.1 | 1.05–1.09 | 1.07 |
| Digital | 2.3–5.4 | 3.9 | 2.5–5.3 | 4.2 | 1.06–1.15 | 1.11 |
| CIFAR-10-C | CIFAR-100-C | ImageNet-C | |
| Optimizer | AdamW | Adam | AdamW |
| Learning rate | |||
| Weight decay | 0.01 | 0.0 | 0.01 |
| Batch size | 200 | 200 | 64 |
| 3 | 3 | 16 | |
| (Eq. ( 1 )) | 0.05 | 0.05 | 0.05 |
| Method | CIFAR-10-C | CIFAR-100-C | ImageNet-C |
|---|---|---|---|
| TENT | |||
| BATCLIP | |||
| Mint | |||
| CAMA |
| 16 | 32 | 64 | 128 | 200 | |
|---|---|---|---|---|---|
| CIFAR-10-C | 76.69 | 79.01 | 80.08 | 80.30 | 79.46 s |
| CIFAR-100-C | 51.37 | 51.56 | 51.17 | 50.21 | 48.77 s |
| ImageNet-C | 36.61 | 36.14 | 34.93 s | 33.15 | 31.75 |
| CIFAR-10-C | CIFAR-100-C | |||||
|---|---|---|---|---|---|---|
| 0.05 | 0.1 | 0.2 | 0.05 | 0.1 | 0.2 | |
| 0.01 | 79.50 | 79.48 | 79.35 | 48.76 | 48.75 | 48.74 |
| 0.05 | 79.52 | 79.46 | 79.46 | 48.76 | 48.77 | 48.76 |
| 0.10 | 79.53 | 79.51 | 79.48 | 48.77 | 48.77 | 48.78 |
| Benchmark | With shrinkage | Without shrinkage | Gain | |
|---|---|---|---|---|
| CIFAR-10-C | 16 | |||
| 8 | ||||
| 4 | ||||
| CIFAR-100-C | 16 | |||
| 8 | ||||
| 4 |
| Method | Gaussian | Shot | Impulse | Defocus | Glass | Motion | Zoom | Snow | Frost | Fog | Brightness | Contrast | Elastic | Pixelate | JPEG | Mean | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CIFAR-10-C | ZS | 37.92 | 41.70 | 54.42 | 71.75 | 40.89 | 67.93 | 73.62 | 73.89 | 77.35 | 70.22 | 84.45 | 62.36 | 53.81 | 47.65 | 59.43 | 61.16 |
| TENT | 15.49 | 18.28 | 38.12 | 81.59 | 21.73 | 76.32 | 82.35 | 84.62 | 82.19 | 80.60 | 91.83 | 80.55 | 63.52 | 58.57 | 54.71 | 62.03 | |
| RoTTA | 39.17 | 42.90 | 55.41 | 72.18 | 41.32 | 68.02 | 74.01 | 74.38 | 78.01 | 70.80 | 84.80 | 63.19 | 54.62 | 49.32 | 60.15 | 61.89 | |
| RPL | 15.47 | 17.43 | 40.73 | 81.76 | 20.08 | 69.89 | 82.93 | 84.43 | 83.19 | 81.84 | 91.80 | 79.42 | 64.89 | 54.07 | 54.90 | 61.52 | |
| SAR | 47.98 | 53.60 | 60.56 | 74.30 | 47.56 | 73.15 | 76.43 | 77.91 | 79.88 | 75.66 | 86.79 | 71.62 | 58.34 | 62.03 | 64.71 | 67.37 | |
| TPT | 37.74 | 42.24 | 60.57 | 72.88 | 44.80 | 69.69 | 75.37 | 75.96 | 78.84 | 72.12 | 85.68 | 62.04 | 58.90 | 55.14 | 62.64 | 63.64 |
| Benchmark | Backbone | ZS | TENT | RoTTA | RPL | SAR | VTE | BATCLIP | Mint | ClipTTA | CAMA |
|---|---|---|---|---|---|---|---|---|---|---|---|
| CIFAR-10-C | CLIP ViT-B/16 | 61.16 | 62.03 | 61.89 | 61.52 | 67.37 | 64.15 | 73.85 | 73.67 | 68.23 | 79.46 |
| SigLIP | 59.04 | 59.93 | 59.81 | 59.38 | 65.70 | 60.78 | 72.80 | 70.01 | 67.46 | 78.43 | |
| MetaCLIP | 75.94 | 84.50 | 76.70 | 83.87 | 80.14 | 78.22 | 85.17 | 83.25 | 80.58 | 87.33 | |
| EVA-CLIP | 81.12 | 81.69 | 83.35 | 76.70 | 85.11 | 79.40 | 89.87 | 67.85 | 89.59 | 90.71 | |
| ConvNeXt-CLIP | 64.16 | 41.49 | 64.63 | 36.49 | 11.87 | 64.49 | 78.00 | 65.32 | 60.61 | 78.62 | |
| RN50 | 35.08 | 12.07 | 22.32 | 11.78 | 21.24 | 36.58 | 34.85 | 24.96 | 56.36 | 58.29 |
| Mean pairwise cosine | Top-class share (%) | |||||||
|---|---|---|---|---|---|---|---|---|
| Backbone (clean cosine) | Corruptions | Corrupted | TENT | CAMA | TENT | CAMA | CAMA TENT | |
| CLIP ViT-B/16 (0.789) | TENT collapses | 4 | 0.907 | 0.925 | 0.679 | 80.1 | 12.6 | |
| others | 11 | 0.844 | 0.601 | 0.655 | 19.2 | 10.6 | ||
| SigLIP (0.713) | TENT collapses | 6 | 0.868 | 0.895 | 0.641 | 76.9 | 12.7 | |
| others | 9 | 0.785 | 0.567 | 0.617 | 16.7 | 10.6 | ||
| MetaCLIP (0.704) | TENT collapses | 0 | — | — | — | — | — | — |
| Variant | CIFAR-10-C | CIFAR-100-C | ImageNet-C |
|---|---|---|---|
| Full CAMA | 79.46 | 48.77 | 34.93 |
| Without escort | 79.52 | 48.77 | 34.96 |
| Without shrinkage | 79.48 | 48.42 | 32.26 |
| Without MI | 65.36 | 33.11 | 16.42 |
| Stream | Benchmark | ZS | TENT | BATCLIP | Mint | ClipTTA | CAMA |
|---|---|---|---|---|---|---|---|
| Episodic | CIFAR-10-C | 61.16 | 62.03 | 73.85 | 73.67 | 68.23 | 79.46 |
| CIFAR-100-C | 35.79 | 37.96 | 42.09 | 44.53 | 40.53 | 48.77 | |
| Continual | CIFAR-10-C | 61.16 | 10.40 | 56.65 | 63.04 | 75.90 | 78.86 |
| CIFAR-100-C | 35.79 | 1.49 | 27.05 | 32.46 | 46.48 | 50.68 | |
| Mixed corr. | CIFAR-10-C | 60.96 | 58.95 | 68.09 | 67.63 | 64.95 | 74.11 |
| CIFAR-100-C | 35.77 | 37.66 | 37.97 | 37.75 | 38.23 | 42.71 |
| CIFAR-10-C | CIFAR-100-C | |||
|---|---|---|---|---|
| Method | Mild ( ) | Strong ( ) | Mild ( ) | Strong ( ) |
| BATCLIP | ||||
| BATCLIP + replay | ||||
| Mint | ||||
| Mint + replay | ||||
| ClipTTA | ||||
| Benchmark | Backbone | Source | TENT | CAMA |
|---|---|---|---|---|
| CIFAR-10-C | ConvNeXt-Base | 69.11 | 81.85 | 88.96 |
| CIFAR-10-C | ViT-B/16 | 80.97 | 82.81 | 90.48 |
| CIFAR-100-C | ViT-B/16 | 63.94 | 65.94 | 75.84 |
Test-Time Adaptation
Test-time adaptation updates or recalibrates pretrained models at inference to handle distribution shifts, often without target labels.
See all 355 papers