Method Calt Food DTD UCF Flow. Pets Air. Cars Sun Euro Avg MaPLe [ 17 ] L Margin \mathcal{L}_{\text{Margin}} L Margin Acc. 94.80 91.87 60.47 77.30 71.70 97.83 33.93 74.80 78.33 76.40 75.74 ECE 2.00 1.07 13.92 3.82 15.76 1.73 11.53 2.45 3.25 6.01 5.09 [2pt/2pt] L Margin + L 1 \mathcal{L}_{\text{Margin}}+\mathcal{L}_{\text{1}} L Margin + L 1 Acc. 94.23 92.13 59.50 79.10 73.33 97.77 26.43 74.57 78.47 70.93 74.65 ECE 2.32 0.55 12.13 3.90 11.71 1.72 7.39 2.58 1.58 7.80 5.17 [2pt/2pt] L Margin + L mom. \mathcal{L}_{\text{Margin}}+\mathcal{L}_{\text{mom.}} L Margin + L mom. Acc. 94.87 91.77 61.27 79.87 73.87 97.57 36.03 75.27 78.13 67.60 75.63 ECE 1.42 0.86 7.37 3.32 10.07 2.29 8.33 2.60 1.11 7.45 4.48 We follow the standard few-shot protocol [ 48 ] , each dataset is split into disjoint base and novel classes. Prompt tuning is performed only on base classes using a limited number of labeled samples per class. The calibration performance is reported for both base and novel classes.
Datasets. We evaluate on 11 datasets spanning coarse-grained, fine-grained, and domain-specific tasks. Object classification is assessed on ImageNet [ 4 ] and Caltech101 [ 6 ] . Fine-grained recognition tasks include DTD [ 2 ] (textures), Flowers (FLW) [ 28 ] , Food101 [ 1 ] , SUN397 [ 41 ] , and UCF101 [ 36 ] . Domain-specific benchmarks comprise Stanford Cars [ 19 ] , FGVC-Aircraft [ 24 ] , Oxford Pets [ 31 ] , and EuroSAT [ 10 ] . We also provide results on out-of-distribution datasets for the ImageNet-A [ 12 ] , ImageNet-V2 [ 33 ] , ImageNet-R [ 11 ] , and ImageNet-S [ 38 ] datasets in the suppl. material.
Baseline Methods. We benchmark our approach against a diverse and comprehensive set of prompt-tuning and calibration techniques. Classical baselines include MBLS [ 22 ] and Temperature Scaling [ 9 ] . We also compare with recent methods such as DAC [ 39 ] , a post-hoc approach for adapting CLIP to novel classes, and a training-time regularization method introduced by [ 25 ] . For prompt tuning, we evaluate three representative approaches in the main paper: CoOp [ 48 ] , KgCoOp [ 42 ] , and MaPLe [ 17 ] . Results for additional methods including CoCoOp [ 46 ] , ProDA [ 43 ] , ProGrad [ 50 ] , and PromptSRC [ 18 ] are in the supp. material.
Evaluation Metrics and Implementation details. We evaluate classification performance using top-1 accuracy (ACC). To measure model calibration, we report the Expected Calibration Error (ECE), a widely used metric. We also report results with Adaptive Calibration Error [ 29 ] (ACE) and Maximum Calibration Error [ 26 ] (MCE) in the supp. material. For all experiments, we use CLIP (ViT-B/16) [ 32 ] as the pre-trained vision-language model. Prompt-tuning is conducted in a few-shot setting with 16 samples per class, using a learning rate of 0.005 and a batch size of 8. For each baseline method, we adopt its official implementation. All experiments are performed on an NVIDIA RTX A6000 GPU with 48GB memory. We provide detailed hyperparameters in the supp. material.
Calibration on Base Classes. Table 1 reports the results on 11 fine-grained classification datasets using three prompt-tuning methods. Our approach consistently maintains or slightly improves the classification accuracy while significantly reducing the calibration error. When applied to MaPLe, it improves the average accuracy from 82.41% to 82.75% and reduces ECE from 3.19% to 2.78%. For CoOp, we observe a larger drop in ECE from 6. 35% to 2. 93%, surpassing both post hoc techniques such as temperature scaling (2.96%) and prior regularization methods. Gains are especially pronounced on highly miscalibrated datasets; for example, CoOp on Aircraft shows a reduction from 25.70% to 4.96% in ECE. These improvements show that preserving margin distributions and embedding geometry effectively mitigates underconfidence in base-class predictions.
Calibration on Novel Classes. Table 2 reports accuracy and ECE on novel classes under the open-vocabulary setting. While prompt-tuned models such as CoOp and MaPLe offer improved accuracy over zero-shot CLIP, they often exhibit severe overconfidence (e.g., CoOp ECE = 12.45, MaPLe ECE = 5.76). Post-hoc methods like Temperature Scaling and DAC yield marginal improvements but struggle to correct the underlying semantic drift. Our method consistently reduces calibration error while preserving or improving accuracy. For example, with MaPLe, our method reduces average ECE from 5.76 to 4.23 while maintaining comparable accuracy (75.14%). Notably, our method consistently outperforms recent post-hoc techniques like DAC and avoids the accuracy-calibration tradeoffs seen with methods like ZS-Norm. These results confirm that our approach effectively mitigates overconfidence on novel classes while preserving generalization capabilities.
Ablation Study on Loss Components. Table 4 analyzes the contribution of each component on novel class calibration with the MaPLe backbone. All variants are built on a cross-entropy baseline, where fine-tuning with only CE yields 5.76% ECE. Adding margin regularization ( L Margin \mathcal{L}_{\text{Margin}} L Margin ) reduces ECE to 5.09% while maintaining accuracy at 75.74%. When combining margin regularization with direct ℓ 1 \ell_{1} ℓ 1 alignment ( L 1 \mathcal{L}_{1} L 1 ), we observe improvements on some datasets but slightly lower overall accuracy (74.65%). Our full method, combining margin regularization with moment matching ( L mom \mathcal{L}_{\text{mom}} L mom ), achieves the best calibration (4.48% ECE) while preserving clean accuracy (75.63%). This demonstrates that moment matching provides superior regularization compared to direct embedding alignment, effectively preserving the global structure of CLIP’s embedding space while allowing task-specific adaptations. Figure 4: Performance with different numbers of shots and hard prompt styles. Calibration Across Varying Shots: Figure 3(a) shows classification and calibration metrics under different shot counts (4, 8, 16, 32) for both base and novel classes. Ours maintains low ECE across different prompt tuning settings, demonstrating robust calibration even in extreme few-shot scenarios.
Robustness to Prompt Initialization: Figure 3(b) evaluates the robustness of our method to different prompt initialization strategies, averaged over 10 datasets, comparing in between vanilla Maple [ 17 ] and Maple+Ours . Maple+Ours demonstrates consistent performance across different initialization choices (see suppl.) for both base and novel classes. This robustness across initialization schemes suggests that our regularization framework addresses the fundamental geometric factors underlying miscalibration rather than optimizing for specific conditions.
Figure 5: Margin based Label Smoothing(MBLS) vs Mean-Variance Margin(Margin) Regularization. In base class reliability diagram (Observation 1), MBLS with Cross-Entropy (CE) shows underconfidence, while adding a Margin term alleviates this. For Observations 3 and 4, we train CE , CE + MBLS , and CE + Margin with MaPLe, compute the top-1 margin m = z y − max j ≠ y z j m=z_{y}-\max_{j\neq y}z_{j} m = z y − max j = y z j , and plot the Empirical Cumulative Distribution Function (ECDF). The ECDF shows Margin yields fewer low-margin samples(Underconfident samples), MBLS trims large but leaves small ones, and CE lies in between. Box plots confirm this: Margin has the highest median ( ≈ 5 \approx 5 ≈ 5 ) with a right-shifted IQR, MBLS caps extremes with a tight IQR, while CE retains a broad spread. Margin vs MBLS: Compared to MBLS, Margin regularization reduces underconfidence by lifting low-margin samples (Figure 5 , Observations 1–3), whereas MBLS primarily caps extreme margins.
5 Conclusion
We proposed a method to calibrate prompt-tuned VLMs by addressing a key challenge: preserving predictive reliability without distorting CLIP’s semantic structure. Our approach introduces two complementary regularizers, a mean-variance logit margin loss and a moment-matching constraint on text embeddings, to jointly enforce geometric fidelity and calibration. It requires no architectural changes and integrates seamlessly with existing prompt tuning setups, making it broadly applicable across domains. Evaluated on 11 datasets and multiple prompt-tuning strategies, our method consistently improves calibration, particularly on novel classes, without compromising classification accuracy. By decoupling predictive uncertainty from semantic drift, it enables more trustworthy and robust deployment of VLMs in real-world, open-vocabulary scenarios. We hope this work encourages further research into calibration-aware adaptations of foundation models.
Supplementary Material
Contents of Supplementary Material
In this supplementary material, we provide the following:
1. Calibration analysis for base and novel classes across prompt learning methods (Sec. 6 ) 2. Robustness evaluation under natural distribution shifts (Sec. 7 ) 3. Additional results for ACE and MCE performance metrics (Sec. 8 ) 4. Hyperparameters details (Sec. 11 ) 5. Prompt templates and variations (Sec. 12 ) 6. Variance analysis (Sec. 13 ) 7. Results on Different Backbones (Sec. 14 ) 8. Decision Boundary Visualization (Sec. 15 )
6 Calibration Analysis for Base and Novel Classes Across Prompt Learning Methods
Method Calt Pets Cars Flow Food Air SUN DTD Euro UCF Avg Zero Shot Acc. 97.20 91.30 63.60 71.80 90.10 27.70 69.40 53.00 57.00 71.00 69.50 ECE 6.49 2.25 3.74 3.11 1.57 3.03 1.59 4.53 8.35 3.24 3.58 CoCoOp [ 46 ] CoCoOp [ 46 ] Acc. 97.77 95.02 70.72 94.62 90.43 35.33 79.19 75.54 85.40 81.71 80.57 ECE 1.43 3.21 6.89 7.85 0.86 5.42 3.78 3.88 8.09 3.78 4.52 [2pt/2pt] ZS-Norm [ 25 ] Acc. 97.83 95.22 70.65 95.00 90.63 36.03 79.70 76.35 82.53 81.90 80.58 ECE 2.93 3.20 8.67 7.56 1.49 8.50 7.50 10.82 16.09 4.08 7.08 [2pt/2pt] Penalty [ 25 ] Acc. 97.83 94.98 69.95 92.43 90.72 34.35 79.34 71.49 69.57 80.49 78.12 ECE 5.00 6.06 10.36 14.90 3.95 6.83 6.69 17.22 20.94 7.17 9.91 [2pt/2pt] Ours Acc. 97.93 94.69 69.42 94.11 90.51 34.25 78.92 74.77 84.70 82.34 80.16 ECE 1.13 2.31 7.01 7.98 0.49 5.81 2.63 3.70 6.47 3.23 4.08 ProDA [ 43 ] ProDA [ 43 ] Acc. 97.61 94.75 69.76 89.96 89.33 33.01 76.17 70.02 81.83 79.99 78.24 ECE 1.06 1.67 3.86 6.07 0.86 3.52 6.66 10.25 3.73 2.56 4.02 [2pt/2pt] ZS-Norm [ 25 ] Acc. 97.55 94.37 69.77 89.62 89.50 33.03 76.46 71.33 82.00 79.33 78.30 ECE 1.93 2.22 4.74 7.41 1.31 3.00 6.62 3.73 11.93 2.72 4.56 [2pt/2pt] Penalty [ 25 ] Acc. 97.35 94.61 69.32 89.14 90.36 32.17 76.94 59.80 63.86 78.07 75.16 ECE 4.00 8.11 7.86 12.89 3.79 4.91 2.09 11.28 18.05 7.83 8.08 [2pt/2pt] Ours Acc. 97.20 94.31 69.50 87.88 90.02 32.99 76.96 72.91 82.70 80.63 78.51 ECE 1.75 2.29 6.91 8.21 1.18 3.38 1.18 2.27 5.37 2.50 3.50 ProGrad [ 50 ] ProGrad [ 50 ] Acc. 97.72 94.67 69.29 81.26 90.33 31.35 76.88 67.13 79.27 78.20 76.61 ECE 3.53 3.83 6.84 6.82 1.65 2.60 3.70 6.38 12.24 3.92 5.15 [2pt/2pt] ZS-Norm [ 25 ] Acc. 97.87 94.36 69.27 82.91 90.45 32.35 77.92 70.37 75.57 78.70 76.98 ECE 5.51 4.85 10.02 10.95 2.67 8.50 10.33 23.04 17.46 6.47 9.98 [2pt/2pt] [2pt/2pt] Penalty [ 25 ] Acc. 97.81 94.21 69.02 84.14 90.47 32.65 77.33 57.29 67.21 75.65 74.58 ECE 5.51 6.39 8.69 13.38 3.49 6.70 5.54 7.70 16.49 5.79 7.97 [2pt/2pt] Ours Acc. 97.55 94.45 68.95 82.62 90.29 31.57 77.03 68.52 79.78 79.04 76.98 ECE 3.18 3.46 7.01 6.90 1.36 3.06 3.10 6.41 11.20 3.12 4.88 PromptSRC [ 18 ] PromptSRC [ 18 ] Acc. 98.08 95.36 78.15 97.95 90.60 40.74 82.63 83.41 93.17 87.09 84.72 ECE 2.31 2.64 8.65 5.15 1.17 5.26 2.75 2.56 9.27 2.84 4.26 [2pt/2pt] ZS-Norm [ 25 ] Acc. 98.21 95.43 77.55 97.50 90.78 40.78 82.62 81.56 48.78 85.76 79.90 ECE 4.41 4.58 12.01 8.65 3.21 10.37 5.43 20.69 20.10 6.73 9.62 [2pt/2pt] Penalty [ 25 ] Acc. 98.01 95.69 77.45 97.82 90.36 40.89 82.29 81.84 48.38 85.91 79.86 ECE 5.41 4.78 10.61 9.65 4.51 12.47 6.43 18.69 19.10 8.98 10.06 [2pt/2pt] Ours Acc. 98.30 95.57 79.11 98.39 90.67 42.50 82.77 83.83 95.05 86.87 85.31 ECE 1.03 0.89 8.96 0.97 0.90 6.04 1.34 4.59 4.33 1.39 3.04 Table 4: Accuracy and calibration performance on base classes across 10 fine-grained classification benchmarks . We report top-1 accuracy (Acc) and Expected Calibration Error (ECE) for multiple prompt-tuning strategies and diverse calibration baselines. Higher Acc. indicates better classification performance, while lower ECE reflects better calibration.
In the main paper, we provide the calibration results for three representative prompt learning methods: CoOp [ 48 ] , KgCoOp [ 42 ] , and MaPLe [ 17 ] . Here we provide the results for additional prompt learning methods including CoCoOp [ 46 ] , ProDA [ 43 ] , ProGrad [ 50 ] , and PromptSRC [ 18 ] for both base and novel classes to demonstrate the broader applicability and effectiveness of our calibration approach.
Calibration Performance on Base Classes. Table 4 presents the accuracy and calibration performance on base classes across 10 fine-grained classification benchmarks. The results consistently demonstrate that our calibration approach achieves superior calibration performance (lower ECE) while maintaining competitive accuracy across all evaluated prompt learning methods. Notably, our method shows the most significant improvements with PromptSRC [ 18 ] , reducing the average ECE from 4.26 to 3.04 without compromising clean accuracy. The consistent improvements across diverse prompt learning architectures validate the generalizability of our approach.
Method Calt Pets Cars Flow Food Air SUN DTD Euro UCF Avg Zero Shot Acc. 94.10 97.10 75.00 77.50 91.10 35.90 75.50 60.60 63.80 78.60 74.30 ECE 1.60 3.42 3.31 4.91 1.83 6.55 3.48 6.86 9.12 5.52 4.43 CoCoOp [ 46 ] CoCoOp [ 46 ] Acc. 94.51 97.69 73.26 72.27 91.02 33.47 76.54 57.65 63.14 74.89 73.44 ECE 1.84 2.64 1.88 9.17 1.64 10.93 2.21 11.26 9.06 4.90 5.55 [2pt/2pt] ZS-Norm [ 25 ] Acc. 94.76 97.24 73.56 70.45 91.43 32.97 76.84 54.59 57.01 71.64 72.05 ECE 2.63 2.87 2.11 9.39 2.16 7.21 3.99 3.91 9.24 4.36 4.79 [2pt/2pt] Penalty [ 25 ] Acc. 94.29 95.62 75.07 70.52 91.46 33.59 76.85 56.76 54.50 74.08 72.27 ECE 2.22 5.11 5.69 5.80 4.22 5.30 3.93 11.13 11.44 3.66 5.85 [2pt/2pt] DAC Acc. - - - - - - - - - - - ECE 3.65 2.43 2.21 7.74 1.64 9.03 1.09 7.47 13.49 2.70 5.15 [2pt/2pt] Ours Acc. 94.43 97.45 74.71 71.91 91.62 33.97 76.41 56.40 61.67 76.40 73.50 ECE 1.51 2.58 3.22 6.36 0.96 8.85 0.87 4.77 6.68 2.76 3.86 ProDA [ 43 ] ProDA [ 43 ] Acc. 93.99 96.90 73.16 72.51 90.64 31.35 65.02 53.99 51.86 72.76 70.22 ECE 3.22 1.96 3.18 8.51 0.84 15.03 14.08 16.90 21.85 4.74 9.03 [2pt/2pt] ZS-Norm [ 25 ] Acc. 93.81 97.28 72.53 72.81 90.44 30.09 66.59 52.13 57.77 72.67 71.01 ECE 2.36 2.42 2.06 8.34 0.94 10.76 12.12 7.65 8.75 4.41 5.98 [2pt/2pt] Penalty [ 25 ] Acc. 93.92 97.20 73.39 73.57 90.70 32.45 67.73 50.48 60.05 72.49 71.20 ECE 1.53 6.14 3.76 4.36 3.47 7.82 2.51 4.96 14.47 3.86 5.29 [2pt/2pt] DAC Acc. - - - - - - - - - - - ECE 4.87 4.72 3.28 6.32 0.70 7.40 1.06 5.68 3.33 4.14 4.15 [2pt/2pt] Ours Acc. 93.56 97.56 73.81 72.74 91.14 30.57 66.18 53.82 58.58 75.79 71.38 ECE 1.48 3.25 2.77 5.12 1.01 6.78 1.90 4.60 4.91 2.35 3.42 ProGrad [ 50 ] ProGrad [ 50 ] Acc. 94.76 97.32 74.85 75.29 91.06 34.43 75.42 56.44 61.98 78.74 74.03 ECE 1.67 3.52 2.68 7.46 1.76 9.21 2.05 4.48 8.83 3.57 4.52 [2pt/2pt] ZS-Norm [ 25 ] Acc. 94.43 97.37 74.97 75.18 91.18 31.49 74.79 55.80 67.97 77.39 74.06 ECE 1.80 5.11 5.32 3.73 2.68 3.79 7.10 12.79 12.83 4.83 6.00 [2pt/2pt] Penalty [ 25 ] Acc. 94.87 96.98 75.81 74.54 91.05 34.55 75.03 53.74 66.97 76.80 74.03 ECE 1.90 5.54 5.07 4.80 3.08 5.31 3.08 4.96 14.86 5.05 5.37 [2pt/2pt] DAC Acc. - - - - - - - - - - - ECE 1.97 3.31 2.29 5.04 1.85 10.46 1.32 3.49 6.90 2.42 3.91 [2pt/2pt] Ours Acc. 94.29 97.48 75.09 74.66 91.21 32.87 74.81 55.60 67.91 78.53 74.25 ECE 1.03 3.26 1.98 5.14 1.47 9.34 2.32 3.30 6.06 3.06 3.70 PromptSRC [ 18 ] PromptSRC [ 18 ] Acc. 94.21 97.31 75.58 77.28 91.51 29.73 78.79 61.03 74.72 77.86 75.80 ECE 1.51 3.26 2.06 5.50 1.77 12.92 1.07 6.68 8.08 2.81 4.57 [2pt/2pt] ZS-Norm [ 25 ] Acc. 94.18 97.61 74.80 76.31 91.60 36.23 78.80 59.02 37.07 77.25 72.29 ECE 2.06 4.30 3.63 5.86 3.66 4.64 3.57 12.29 12.56 3.95 5.65 [2pt/2pt] Penalty [ 25 ] Acc. 94.17 97.55 74.12 76.34 91.99 36.63 78.14 59.62 37.37 77.76 72.37 ECE 3.06 5.40 4.63 4.86 4.98 4.94 4.53 11.29 10.66 4.65 5.90 [2pt/2pt] DAC Acc. - - - - - - - - - - - ECE 1.58 2.98 2.39 5.03 1.55 8.55 0.79 5.50 7.24 2.46 3.81 [2pt/2pt] Ours Acc. 94.29 97.28 74.49 75.44 91.68 36.85 78.39 57.53 72.64 77.72 75.63 ECE 1.14 1.19 2.39 5.44 0.72 9.26 0.77 6.81 8.37 1.89 3.80 Table 5: Accuracy and calibration performance on novel classes across 10 fine-grained classification benchmarks . We report top-1 accuracy (Acc) and Expected Calibration Error (ECE) for multiple prompt-tuning strategies and diverse calibration baselines. Higher Acc. indicates better classification performance, while lower ECE reflects better calibration.
Calibration Performance on Novel Classess. We further evaluate the calibration performance on novel classes to assess the generalization capability of our approach when dealing with unseen categories during training. Table 5 presents the accuracy and calibration performance on novel classes across the same 10 benchmarks. Our method demonstrates consistent calibration improvements across all prompt learning methods when evaluated on novel classes. The results show that our approach effectively generalizes to unseen categories, with particularly notable improvements in ECE reduction. For instance, with ProDA [ 43 ] , our method reduces the average ECE from 9.03 to 3.42 while maintaining comparable clean accuracy (70.22 vs 71.38). Similarly, with CoCoOp [ 46 ] , we achieve an ECE reduction from 5.55 to 3.86. These results highlight the robustness of our calibration approach in handling the challenging scenario of novel class prediction, where models are more prone to overconfidence due to limited training exposure.
Method INet-V2 INet-S INet-A INet-R Avg MaPLe [ 17 ] MaPLe [ 17 ] Acc. 67.35 53.35 68.31 85.22 68.56 ECE 3.14 3.94 2.52 3.14 3.19 [2pt/2pt] ZS-Norm [ 25 ] Acc. 66.15 53.24 68.41 85.17 68.49 ECE 3.41 4.12 6.98 7.13 5.41 [2pt/2pt] Penalty [ 25 ] Acc. 66.72 53.04 68.61 85.17 68.39 ECE 3.61 4.62 7.48 7.33 5.76 [2pt/2pt] Ours Acc. 67.19 53.15 67.86 85.28 68.37 ECE 3.09 3.91 2.21 2.05 2.82 Table 6: Accuracy and calibration performance on base classes across 4 natural distribution shift datasets . We report top-1 accuracy (Acc) and Expected Calibration Error (ECE) for MaPLe [ 17 ] . Higher Acc. indicates better classification performance, while lower ECE reflects better calibration.
Method INet-V2 INet-S INet-A INet-R Avg MaPLe [ 17 ] MaPLe [ 17 ] Acc. 67.36 53.36 68.31 85.22 68.56 ECE 3.16 3.73 2.52 3.14 3.14 [2pt/2pt] ZS-Norm [ 25 ] Acc. 66.75 53.34 68.60 85.16 68.46 ECE 3.54 4.01 6.47 7.21 5.31 [2pt/2pt] Penalty [ 25 ] Acc. 66.75 53.11 68.60 85.16 68.41 ECE 3.64 4.11 7.47 7.32 5.64 [2pt/2pt] Ours Acc. 67.20 53.21 67.86 85.28 68.39 ECE 3.11 3.63 2.20 2.05 2.75 Table 7: Accuracy and calibration performance on novel classes across 4 natural distribution shift datasets . We report top-1 accuracy (Acc) and Expected Calibration Error (ECE) for MaPLe [ 17 ] . Acc. indicates better classification performance, while lower ECE reflects better calibration.
7 Results on Natural Distribution Shifts
Here, we provide results on out-of-distribution datasets for the ImageNet-A [ 12 ] , ImageNet-V2 [ 33 ] , ImageNet-R [ 11 ] , and ImageNet-S [ 38 ] datasets demonstrating the robustness of our calibration approach under natural distribution shifts.
Base Classes. Table 6 presents the accuracy and calibration performance on base classes across these 4 natural distribution shift datasets. Our method consistently outperforms baseline calibration approaches across all datasets. Notably, our approach achieves superior calibration with an average ECE of 2.82 compared to the vanilla MaPLe baseline (3.19), ZS-Norm (5.41), and Penalty (5.76). The improvements are particularly pronounced on challenging datasets like ImageNet-A and ImageNet-R, where our method reduces ECE from 2.52 to 2.21 and from 3.14 to 2.05, respectively, while maintaining competitive accuracy.
Novel Classes. Table 7 shows the corresponding results on novel classes under distribution shift. The consistent performance across both base and novel classes demonstrates the generalization capability of our calibration approach. Our method achieves an average ECE of 2.75 on novel classes, significantly outperforming ZS-Norm (5.31) and Penalty (5.64) baselines. The robustness across different types of distribution shifts, including adversarial examples (ImageNet-A), renditions (ImageNet-R), and sketch-like images (ImageNet-S), validates that our approach addresses fundamental calibration issues rather than dataset-specific artifacts.
These results are particularly important for real-world deployment scenarios where models encounter data that differs from the training distribution. The consistent calibration improvements across diverse distribution shifts demonstrate that our method provides reliable confidence estimates even under challenging out-of-distribution conditions.
8 Additional Results: ACE and MCE Performance Metrics
Method Calt Pets Cars Flow Food Air SUN DTD Euro UCF Avg CoOp [ 48 ] CoOp [ 48 ] MCE 0.24 0.31 0.91 2.46 1.72 4.77 3.99 5.68 0.60 3.34 2.40 ACE 0.44 0.62 3.65 4.67 3.65 25.70 8.11 12.01 1.95 6.41 6.72 [2pt/2pt] ZS-Norm [ 25 ] MCE 1.40 2.17 2.20 2.76 0.90 4.34 0.82 14.76 11.82 0.87 4.20 ACE 4.32 7.70 11.26 11.12 3.14 13.05 4.26 49.53 36.04 3.36 14.38 [2pt/2pt] Penalty [ 25 ] MCE 1.62 1.85 2.13 2.50 1.38 2.23 0.94 4.30 11.34 1.63 2.99 ACE 4.75 6.41 10.01 9.36 5.98 8.61 4.61 21.48 20.86 7.09 9.92 [2pt/2pt] Ours MCE 0.33 1.01 1.87 1.68 0.12 1.21 0.31 0.56 1.67 0.22 0.90 ACE 0.98 2.10 7.55 4.94 0.21 2.40 1.30 2.01 5.12 1.15 2.78 MaPLe [ 17 ] MaPLe [ 17 ] MCE 0.51 0.60 1.68 1.29 0.34 0.91 0.19 1.04 0.74 0.56 0.79 ACE 2.14 1.19 6.91 3.21 0.73 2.95 1.17 3.71 2.94 1.49 2.64 [2pt/2pt] ZS-Norm [ 25 ] MCE 1.28 1.01 3.79 1.45 2.25 1.95 2.27 2.80 1.24 0.61 1.87 ACE 5.28 3.21 20.73 7.21 11.17 6.98 8.59 12.37 6.91 3.40 8.59 [2pt/2pt] Penalty [ 25 ] MCE 1.88 1.85 2.30 3.15 1.11 2.27 1.24 3.69 0.61 1.45 1.96 ACE 5.68 6.29 11.17 11.97 3.71 8.72 6.81 20.23 3.10 7.61 8.53 [2pt/2pt] Ours MCE 0.62 0.34 1.20 0.87 1.47 0.62 1.11 1.50 0.60 0.94 0.93 ACE 1.62 0.80 3.98 2.18 3.66 0.94 4.38 7.55 1.54 1.34 2.80 KGCoOp [ 42 ] KGCoOp [ 42 ] MCE 1.14 1.17 2.23 2.75 0.62 1.17 0.97 1.61 3.31 1.25 1.62 ACE 2.56 2.95 10.14 11.95 1.59 2.95 4.91 8.39 11.90 4.59 6.19 [2pt/2pt] ZS-Norm [ 25 ] MCE 1.31 1.13 2.28 3.02 0.64 3.12 1.34 3.85 4.06 1.12 2.19 ACE 2.98 3.06 10.58 13.00 1.69 9.59 6.51 20.40 15.58 5.75 8.91 [2pt/2pt] Penalty [ 25 ] MCE 1.27 1.40 2.10 3.03 0.81 1.67 1.20 2.87 3.30 1.33 1.90 ACE 4.20 4.61 9.96 12.53 2.44 6.41 5.92 10.66 13.14 6.04 7.59 [2pt/2pt] Ours MCE 0.86 1.05 1.12 2.01 0.55 1.94 0.81 1.12 3.61 0.86 1.39 ACE 1.83 2.83 8.1 11.21 1.42 5.11 4.15 7.21 12.65 3.95 5.85 Table 8: Calibration performance on base classes across 10 fine-grained classification benchmarks . We report Maximum Calibration Error (MCE) and Adaptive Calibration Error (ACE) for multiple prompt-tuning strategies and diverse calibration baselines. Lower MCE and ACE reflects better calibration.
Method Calt Pets Cars Flow Food Air SUN DTD Euro UCF Avg CoOp [ 48 ] CoOp [ 48 ] MCE 2.61 0.64 2.38 5.48 1.44 5.01 4.35 7.06 4.41 6.11 3.95 ACE 3.47 1.67 12.45 18.33 3.84 28.41 13.92 26.88 12.73 19.17 14.09 [2pt/2pt] DAC [ 39 ] MCE 1.50 0.66 1.21 2.08 0.49 3.57 1.03 2.24 3.03 1.70 1.76 ACE 2.60 1.70 5.17 10.18 1.75 17.27 4.00 10.51 8.58 8.63 7.04 [2pt/2pt] ZS-Norm [ 25 ] MCE 1.46 2.06 0.75 1.08 0.82 2.24 0.55 9.32 11.82 1.14 3.12 ACE 2.59 7.9 3.01 5.93 3.3 9.86 2.27 21.97 37.04 3.91 9.78 [2pt/2pt] Penalty [ 25 ] MCE 0.92 2.1 0.68 1.16 1.00 2.46 0.76 0.9 7.54 1.36 1.89 ACE 2.23 7.32 2.69 5.46 4.69 7.44 2.91 4.35 14.94 4.51 5.65 [2pt/2pt] Ours MCE 1.05 1.26 0.55 0.98 0.25 2.9 0.64 1.97 3.9 1.49 1.42 ACE 2.3 2.92 2.02 3.67 0.91 10.47 2.99 9.6 11.24 5.04 4.83 MaPLe [ 17 ] MaPLe [ 17 ] MCE 0.55 1.04 0.56 5.02 0.37 1.48 0.65 3.50 1.66 0.66 1.55 ACE 1.26 2.44 2.83 12.67 1.12 7.27 2.49 14.90 7.90 2.81 5.57 [2pt/2pt] DAC [ 39 ] MCE 0.39 1.06 0.77 4.42 0.50 2.26 0.40 1.95 2.55 0.66 1.50 ACE 1.19 2.44 2.57 11.28 1.48 8.90 1.37 8.24 9.12 2.32 4.89 [2pt/2pt] ZS-Norm [ 25 ] MCE 0.84 1.23 2.13 1.76 1.32 1.92 1.07 1.40 0.91 7.51 2.01 ACE 1.62 4.15 9.46 7.77 3.83 7.85 3.77 6.11 4.84 13.73 6.31 [2pt/2pt] Penalty [ 25 ] MCE 0.84 1.72 1.40 1.32 1.11 1.07 0.91 2.73 7.11 1.76 2.00 ACE 1.92 7.60 6.41 4.83 4.05 3.47 4.74 10.46 16.73 8.67 6.89 [2pt/2pt] Ours MCE 0.44 0.52 1.61 1.08 1.70 0.88 2.66 0.55 0.14 0.87 1.05 ACE 0.32 0.95 6.38 3.13 11.27 2.07 8.49 2.48 0.58 4.74 4.04 KGCoOp [ 42 ] KGCoOp [ 42 ] MCE 0.53 1.16 0.9 1.06 0.74 1.78 0.39 1.22 3.37 0.69 1.18 ACE 1.22 3.26 3.36 5.45 2.01 5.86 1.83 5.02 8.69 2.59 3.93 [2pt/2pt] DAC [ 39 ] MCE 0.62 1.21 0.85 1.37 0.64 3.02 0.42 1.33 1.75 0.77 1.20 ACE 1.56 3.02 3.11 6.61 1.93 11.74 1.82 7.26 6.63 2.70 4.64 [2pt/2pt] ZS-Norm [ 25 ] MCE 0.58 1.17 0.94 1.06 0.75 2.97 0.59 1.90 1.52 0.97 1.25 ACE 1.33 3.30 3.86 5.31 2.10 8.39 3.30 5.95 6.51 3.81 4.39 [2pt/2pt] Penalty [ 25 ] MCE 0.56 1.43 0.99 1.38 0.87 1.34 0.58 1.68 3.72 1.28 1.38 ACE 1.19 3.51 3.89 5.14 2.64 5.00 3.35 5.63 13.86 4.23 4.84 [2pt/2pt] Ours MCE 0.51 1.21 0.85 0.98 0.68 2.78 0.47 1.97 1.35 0.91 1.17 ACE 1.1 3.43 3.68 4.91 1.92 7.85 2.01 4.11 4.32 3.15 3.65 Table 9: Calibration performance on novel classes across 10 fine-grained classification benchmarks . We report Maximum Calibration Error (MCE) and Adaptive Calibration Error (ACE) for multiple prompt-tuning strategies and diverse calibration baselines. Lower MCE and ACE reflects better calibration.
In the main paper, we evaluate classification performance using top-1 accuracy and model calibration using Expected Calibration Error (ECE). Here we provide comprehensive results for additional calibration metrics including Adaptive Calibration Error (ACE) [ 29 ] and Maximum Calibration Error (MCE) [ 26 ] to further validate the effectiveness of our approach.
Table 8 presents the MCE and ACE results on base classes across 10 fine-grained classification benchmarks. Our method demonstrates consistent improvements across both metrics for all evaluated prompt learning methods. For CoOp, our approach reduces the average MCE from 2.40 to 0.90 and ACE from 6.72 to 2.78, representing substantial calibration improvements. Similarly, with KGCoOp, we achieve reductions in MCE from 1.62 to 1.39 and ACE from 6.19 to 5.85. These results are particularly noteworthy as MCE captures the worst-case calibration error, indicating that our method not only improves average calibration but also reduces extreme miscalibration cases.
Table 9 shows the results on novel classes . The improvements are consistent with the base class results, demonstrating the generalization capability of our calibration approach. For KGCoOp on novel classes, our method maintains similar MCE performance (1.18 vs 1.17) while slightly improving ACE from 3.93 to 3.65. The robustness across different calibration metrics validates that our approach addresses fundamental calibration issues rather than optimizing for specific metrics.
The consistent improvements across ECE, MCE, and ACE metrics provide strong evidence that our calibration method effectively reduces both average and worst-case calibration errors, making it suitable for deployment in safety-critical applications.
9 Medical Image Analysis
Furthermore, we evaluated our proposed solution on four Med-VLMs: PLIP [ 13 ] , QuiltNet [ 14 ] , using three downstream datasets: KatherColon (Kather) [ 15 ] , PanNuke [ 7 ] , and DigestPath [ 3 ] . We compared the proposed method with other calibration methods, such as CE, MbLs, ZS-Norm, and penalty.
Table 10 shows that the proposed method consistently yields the lowest ECE values when compared with Vanilla Cross Entropy Loss(CE). At the same time, our proposed method gives the lowest reduced Overall Average ECE value compared to other baselines, yielding 7.09 while maintaining the stable accuracy.
Model → \rightarrow → PLIP QuiltNet Average Dataset → \rightarrow → Kather PanNuke DigestPath Kather PanNuke DigestPath All Loss ↓ \downarrow ↓ ACC ↑ \uparrow ↑ ECE ↓ \downarrow ↓ ACC ↑ \uparrow ↑ ECE ↓ \downarrow ↓ ACC ↑ \uparrow ↑ ECE ↓ \downarrow ↓ Acc ↑ \uparrow ↑ ECE ↓ \downarrow ↓ ACC ↑ \uparrow ↑ ECE ↓ \downarrow ↓ ACC ↑ \uparrow ↑ ECE ↓ \downarrow ↓ ACC ↑ \uparrow ↑ ECE ↓ \downarrow ↓ Cross Entropy-based Losses Cross Entropy Loss PL 83.91 5.92 66.70 17.82 82.87 9.50 87.97 2.49 69.82 19.70 81.59 11.27 78.81 11.12 MbLS PL 84.39 3.57 66.70 17.82 82.76 9.53 84.76 3.48 65.54 23.05 82.58 10.90 77.79 11.39 ZS-Norm PL 85.63 3.07 71.52 17.22 82.84 7.31 91.91 0.87 69.55 19.18 84.78 6.37 81.04 9.00 Penalty PL 86.48 3.90 70.49 3.11 69.61 2.40 89.29 12.28 59.88 3.41 79.23 17.53 75.83 7.11 Ours 87.98 1.31 65.72 12.40 84.84 4.71 88.70 1.45 68.31 16.17 83.46 6.49 79.83 7.09 Table 10: Comparison of proposed method (with baseline methods using Cross Entropy (CE). Accuracy (ACC, %) and Expected Calibration Error (ECE, %) are shown for PLIP and QuiltNet on histopathology datasets (Kather, PanNuke, DigestPath). Best results are in bold , second-best underlined . 10 Loss Component Analyses
Figure 6: L mom \mathcal{L}_{\text{mom}} L mom loss analyses on both Base and Novel Classes Fig. 6 shows how L mom \mathcal{L}_{\text{mom}} L mom loss works directly with L CE \mathcal{L}_{\text{CE}} L CE on both Base and Novel classes without L margin \mathcal{L}_{\text{margin}} L margin loss. L mom \mathcal{L}_{\text{mom}} L mom reduces the underconfidence in base classes marginally without any inter-class logit separation. However, it reduces the overconfidence issue alone(without having margin loss) in Novel classes by preserving CLIP’s semantic geometry, maintaining relative class structure. As you can see in Fig.2 of the main paper, when incorporating L margin \mathcal{L}_{\text{margin}} L margin with L mom \mathcal{L}_{\text{mom}} L mom , it helps to reduce the miscalibration issue further more in both Base and Novel classes by having inter-class separation and maintaining relative class structure geometry. 11 Hyperparameters Details
ACC ECE ( α , β ) (\alpha,\beta) ( α , β ) Base Novel Avg Base Novel Avg ( 0.1 , 0.01 ) (0.1,0.01) ( 0.1 , 0.01 ) 89.65 82.38 86.02 1.99 5.66 3.83 ( 0.2 , 0.01 ) (0.2,0.01) ( 0.2 , 0.01 ) 89.72 79.66 84.69 3.46 8.53 5.99 ( 0.3 , 0.01 ) (0.3,0.01) ( 0.3 , 0.01 ) 89.28 80.72 85.00 4.46 9.50 6.98 ( 0.1 , 0.05 ) (0.1,0.05) ( 0.1 , 0.05 ) 89.12 79.99 84.56 3.95 6.26 5.10 ( 0.2 , 0.05 ) (0.2,0.05) ( 0.2 , 0.05 ) 83.39 81.49 82.44 4.10 8.20 6.15 ( 0.3 , 0.05 ) (0.3,0.05) ( 0.3 , 0.05 ) 89.75 80.52 85.14 2.01 8.01 5.01 Table 11: Hyperparameter search for α \alpha α (0.1–0.3) and β \beta β (0.01 and 0.05), with results averaged across Caltech [ 6 ] , Food101 [ 1 ] , and DTD [ 2 ] , reported on both base and novel classes. ACC ECE λ \lambda λ Base Novel Avg Base Novel Avg 1 89.44 81.51 85.48 3.47 4.54 4.01 3 89.17 82.14 85.65 2.11 3.94 3.03 5 89.71 82.64 86.18 1.80 3.22 2.51 8 89.93 82.44 86.19 2.99 5.24 4.12 10 89.15 82.00 85.58 3.64 5.21 4.43 Table 12: Hyperparameter search for λ mom \lambda_{\text{mom}} λ mom over values 1–10, with results averaged across Caltech [ 6 ] , Food101 [ 1 ] , and DTD [ 2 ] , reported on both base and novel classes. For all experiments, we use CLIP (ViT-B/16) [ 32 ] as the pre-trained vision-language model. Prompt-tuning is conducted in a few-shot setting with 16 samples per class, using a learning rate of 0.005 and a batch size of 8. For each baseline method, we adopt its official implementation and follow the recommended hyperparameter settings from the original papers. All experiments are performed on an NVIDIA RTX A6000 GPU with 48GB memory.
For our proposed calibration method, we use the following hyperparameters across all experiments: λ Margin = 1.0 \lambda_{\text{Margin}}=1.0 λ Margin = 1.0 controls the strength of the margin-based regularization, α = 0.1 \alpha=0.1 α = 0.1 balances the average marin, β = 0.01 \beta=0.01 β = 0.01 is the weight for the variance loss, and λ mom = 5.0 \lambda_{\text{mom}}=5.0 λ mom = 5.0 controls the local moment matching regularization. Table 11 and 12 show how we choose these values. These hyperparameters were fixed across all datasets and prompt learning methods to ensure fair comparison. We conduct 3 random seeds for each experiment and report the average results. 12 Prompt Templates and Variations
In the main paper, Figure 4b presents our method’s robustness to different prompt initialization. The following prompt templates were evaluated to assess initialization robustness: ‘‘a nice image of a {}’’ , ‘‘an example of a {}’’ , ‘‘a picture of a {}’’ , and ‘‘a photo of the cool {}’’ . These templates represent different stylistic and semantic variations commonly used in prompt learning literature. This robustness is particularly valuable in practical deployment scenarios where optimal prompt initialization may not be known in advance.
13 Variance Analysis
Method Calt Pets Cars Flow Food Air SUN DTD Euro Avg CoCoOp [ 48 ] CoCoOp [ 48 ] Var. Acc 0.81 0.08 2.65 1.53 4.41 0.01 3.61 0.19 0.69 1.55 Var. ECE 0.36 0.03 3.09 8.82 3.88 0.01 6.25 0.10 0.21 2.53 [2pt/2pt] ZS-Norm [ 25 ] Var. Acc 1.02 0.24 4.60 4.62 0.58 0.12 1.29 0.19 0.33 1.44 Var. ECE 1.69 0.12 0.88 6.66 4.45 0.10 1.04 0.23 5.11 2.25 [2pt/2pt] Penalty [ 25 ] Var. Acc 0.12 0.09 0.11 0.32 0.59 5.81 2.25 0.09 0.08 1.05 Var. ECE 0.08 0.02 0.20 0.04 0.75 1.00 2.50 0.19 0.02 0.53 [2pt/2pt] Ours Var. Acc 0.05 0.01 7.72 1.21 1.96 0.07 0.01 0.18 0.01 1.25 Var. ECE 0.01 0.03 2.43 0.01 1.46 0.00 0.73 0.21 0.06 0.55 KGCoOp [ 42 ] KGCoOp [ 42 ] Var. Acc 0.03 0.00 2.19 1.21 0.58 0.01 0.85 0.15 0.08 0.57 Var. ECE 0.04 0.00 4.00 0.25 0.72 0.00 0.01 0.01 0.17 0.58 [2pt/2pt] ZS-Norm [ 25 ] Var. Acc 0.05 0.00 7.29 0.92 0.50 0.01 3.35 0.35 0.00 1.39 Var. ECE 0.04 0.00 2.31 0.07 0.01 0.01 1.80 0.00 0.04 0.48 [2pt/2pt] Penalty [ 25 ] Var. Acc 0.01 0.00 1.66 0.16 1.23 0.01 1.04 0.11 0.15 0.49 Var. ECE 0.08 0.06 0.38 0.18 1.19 0.01 2.37 0.07 0.06 0.49 [2pt/2pt] Ours Var. Acc 0.05 0.00 2.31 0.17 0.96 0.02 0.00 0.40 0.04 0.44 Var. ECE 0.02 0.00 0.16 0.74 0.44 0.04 0.02 0.10 0.36 0.21 Table 13: Variance across 3 random seeds for 9 novel classes of fine-grained classification benchmarks .
To assess the statistical robustness of our approach, we evaluate the variance in performance across 3 random seeds for both accuracy and calibration metrics. Table 13 presents the variance results across 9 novel classes of fine-grained classification benchmarks for CoCoOp and KGCoOp methods. Our approach demonstrates superior stability with consistently lower variance in both accuracy and ECE compared to baseline calibration methods. For CoCoOp, our method achieves significantly lower average variance in accuracy (1.25 vs 1.55) and ECE (0.55 vs 2.53) compared to the vanilla baseline. Similarly, with KGCoOp, we maintain competitive variance performance with average accuracy variance of 0.44 compared to the baseline’s 0.57, while substantially reducing ECE variance from 0.58 to 0.21. The reduced variance in calibration error is particularly noteworthy as it indicates that our method provides more consistent and reliable confidence estimates across different experimental runs, which is crucial for deployment in safety-critical applications.
14 Results on Different Backbones
To evaluate the adaptability of our method, we conduct experiments on CoOp [ 48 ] with different backbones, namely RN-50 and ViT-B/32. The Tables 14 and 15 results show that our approach consistently outperforms existing methods across both backbones, while also maintaining improvements in accuracy. In base classes, for RN-50, our method achieves an average ECE of 3.46 compared to 4.04 for the vanilla baseline. Similarly, for ViT-B/32, our method attains an ECE of 2.87, outperforming the vanilla baseline at 3.15. For novel classes, our method achieves the second-lowest average ECE of 5.46 on RN-50, with ZS-Norm [ 25 ] performing slightly better at 5.23. In contrast, on ViT-B/32, our method achieves the lowest ECE of 5.82, surpassing all other approaches.
Method Calt Pets Cars Flow Food Air SUN DTD Euro UCF Avg CoOp-RN50 [ 48 ] CoOp-RN50 [ 48 ] Acc. 95.22 90.5 70.22 95.25 82.54 29.95 76.37 74.85 81.32 80.4 76.99 ECE 1.27 2.32 6.15 4.22 1.15 2.62 2.81 8.65 9.34 1.82 4.04 [2pt/2pt] ZS-Norm [ 25 ] Acc. 95.55 90.96 69.89 95.19 82.71 25.89 76.67 74.27 89.57 79.58 78.03 ECE 4.04 5.63 10.52 9.92 3.4 17.28 4.35 37.15 35.76 7.18 13.52 [2pt/2pt] Penalty [ 25 ] Acc. 96.31 92.1 68.58 94.65 83.66 26.63 74.57 68.48 47.61 77.9 78.12 ECE 6.21 8.69 11.85 11.34 5.29 6.4 5.68 18.93 22.61 9.95 10.71 [2pt/2pt] Ours Acc. 95.44 91.08 69.90 95.22 82.77 29.01 77.07 75.42 89.79 79.96 78.57 ECE 1.37 2.21 8.65 4.74 0.84 3.32 1.23 5.87 4.12 2.21 3.46 CoOp–ViT-B/32 [ 48 ] CoOp–ViT-B/32 [ 48 ] Acc. 97.05 92.71 73.13 95.28 84.93 31.87 79.16 77.55 91.10 82.83 79.88 ECE 1.17 2.45 4.86 4.18 1.06 3.12 2.5 6.15 3.91 2.09 3.15 [2pt/2pt] ZS-Norm [ 25 ] Acc. 97.18 92.08 72.86 94.81 85.12 32.19 79.64 76.23 90.09 82.76 80.25 ECE 1.98 7.96 9.70 7.91 6.00 12.97 3.48 38.62 39.31 5.25 13.32 [2pt/2pt] Penalty [ 25 ] Acc. 96.73 93.22 73.33 94.75 86.05 29.99 78.95 69.64 53.42 5.94 75.78 ECE 4.88 6.66 10.54 10.05 4.45 4.82 5.42 22.00 22.15 5.94 9.69 [2pt/2pt] Ours Acc. 97.46 93.14 73.78 95.09 85.12 31.83 79.58 79.01 91.09 82.87 80.09 ECE 0.92 1.68 6.77 4.53 0.79 2.91 0.95 4.77 3.52 1.87 2.87 Table 14: Accuracy and calibration performance on base classes across 10 fine-grained classification benchmarks using RN-50 and ViT-B/32 . We report top-1 accuracy (Acc) and Expected Calibration Error (ECE) for CoOp [ 48 ] , a prompt-tuning strategy, evaluated with different backbones.
Method Calt Pets Cars Flow Food Air SUN DTD Euro UCF Avg CoOp-RN50 [ 48 ] CoOp-RN50 [ 48 ] Acc. 87.27 92.11 57.84 61.87 82.55 18.72 64.46 41.67 34.15 55.07 11.38 ECE 3.57 2.10 8.08 10.24 0.86 18.75 9.07 25.47 22.18 13.47 11.38 [2pt/2pt] ZS-Norm [ 25 ] Acc. 88.39 89.97 57.86 59.93 81.52 20.34 65.77 35.79 40.08 57.37 59.70 ECE 4.30 3.09 2.43 5.99 6.33 4.37 2.64 10.97 9.24 2.98 5.23 [2pt/2pt] Penalty [ 25 ] Acc. 88.75 93.38 61.37 83.63 20.22 67.45 45.21 31.57 58.16 3.01 61.05 ECE 3.05 7.94 1.7 4.81 8.24 10.02 2.92 9.96 11.67 3.01 6.33 [2pt/2pt] Ours Acc. 87.52 93.08 59.88 61.47 82.50 21.66 64.94 39.05 42.75 53.94 60.68 ECE 2.82 2.68 3.43 4.13 1.72 5.36 4.53 8.83 10.93 10.16 5.46 CoOp–ViT-B/32 [ 48 ] CoOp–ViT-B/32 [ 48 ] Acc. 92.25 94.00 60.04 60.31 85.16 22.12 68.98 47.95 56.47 63.57 64.63 ECE 3.29 2.30 8.53 13.28 1.33 16.75 8.57 19.74 17.18 10.32 10.13 [2pt/2pt] ZS-Norm [ 25 ] Acc. 91.56 93.46 59.01 54.09 84.50 21.64 70.14 43.44 52.04 65.98 63.59 ECE 2.62 7.94 4.05 10.94 6.86 5.59 1.34 17.82 14.8 3.13 7.51 [2pt/2pt] Penalty [ 25 ] Acc. 92.39 96.12 59.83 53.78 86.58 23.90 70.52 45.45 44.66 61.77 63.560 ECE 4.41 6.93 2.66 7.31 5.23 8.63 2.19 8.77 10.71 4.22 6.11 [2pt/2pt] Ours Acc. 91.41 93.48 61.10 61.65 84.22 23.08 70.59 50.23 56.55 64.02 65.63 ECE 2.23 2.15 4.33 5.92 0.74 9.90 3.72 14.30 9.14 5.80 5.82 Table 15: Accuracy and calibration performance on novel classes across 10 fine-grained classification benchmarks using RN-50 and ViT-B/32 . We report top-1 accuracy (Acc) and Expected Calibration Error (ECE) for CoOp [ 48 ] , a prompt-tuning strategy, evaluated with different backbones.
15 Decision Boundary Visualization
Figure 7 shows that the Text Momentum-Matching loss better preserves the geometric structure of CLIP’s pretrained embedding space by aligning the statistical moments of tuned and frozen text embeddings, compared to ℓ 1 \ell_{1} ℓ 1 alignment or Orthogonality-based class-wise dispersion [ 35 ] on novel classes. Figure 7: T-SNE visualization of Text Features 16 Computational Analyses
Method Total-Time-Per Batch Peak GPU Memory MaPLe [ 17 ] 15.91(seconds) 1.75 GB [2pt/2pt] Ours 15.83(seconds) 1.75 GB Table 16: Training Time taken per epoch (in seconds) and peak GPU memory usage for 16-shot experiment on Flower [ 28 ] datasets
To analyse the computational and memory overhead, we measured training time and peak GPU memory on Flower101 [ 28 ] 16-shot with ViT-B/16, using the original MaPLe [ 17 ] configuration as baseline. Compared to MaPLe, our method has less training time and the same GPU usage.
17 Regularizer in scale:
In Fig. 9 and Tab. 9 , we log gradient-norm ratios to check optimisation-scale dominance. For the margin regularizer L Margin = L mean + L var L_{\text{Margin}}=L_{\text{mean}}+L_{\text{var}} L Margin = L mean + L var with L mean = − α E [ m ] L_{\text{mean}}=-\alpha\,\mathbb{E}[m] L mean = − α E [ m ] and L var = β V a r ( m ) L_{\text{var}}=\beta\,\mathrm{Var}(m) L var = β Var ( m ) , and measure ρ margin = ∥ ∇ θ L mean ∥ ∥ ∇ θ L var ∥ + ε \rho_{\text{margin}}=\frac{\|\nabla_{\theta}L_{\text{mean}}\|}{\|\nabla_{\theta}L_{\text{var}}\|+\varepsilon} ρ margin = ∥ ∇ θ L var ∥ + ε ∥ ∇ θ L mean ∥ , which is bounded (median 2.65 2.65 2.65 ; 10–90% [ 1.54 , 5.07 ] [1.54,\,5.07] [ 1.54 , 5.07 ] ), indicating comparable contributions of the linear mean and quadratic variance terms. For moment matching, with L μ = ∥ Δ μ ∥ 2 2 L_{\mu}=\|\Delta\mu\|_{2}^{2} L μ = ∥Δ μ ∥ 2 2 and L Σ = ∥ Δ Σ ∥ F 2 L_{\Sigma}=\|\Delta\Sigma\|_{F}^{2} L Σ = ∥ΔΣ ∥ F 2 , we log ρ mom = ∥ ∇ θ ( λ mom L μ ) ∥ ∥ ∇ θ ( λ mom L Σ ) ∥ + ε \rho_{\text{mom}}=\frac{\|\nabla_{\theta}(\lambda_{\text{mom}}L_{\mu})\|}{\|\nabla_{\theta}(\lambda_{\text{mom}}L_{\Sigma})\|+\varepsilon} ρ mom = ∥ ∇ θ ( λ mom L Σ ) ∥ + ε ∥ ∇ θ ( λ mom L μ ) ∥ , which after a brief transient stabilises and shows no covariance-term dominance (median 16.92 16.92 16.92 ; 10–90% [ 10.5 , 80.84 ] [10.5,\,80.84] [ 10.5 , 80.84 ] ). Across regularizers, ρ mom/margin = ∥ ∇ θ L mom ∥ ∥ ∇ θ L margin ∥ + ε \rho_{\text{mom/margin}}=\frac{\|\nabla_{\theta}L_{\text{mom}}\|}{\|\nabla_{\theta}L_{\text{margin}}\|+\varepsilon} ρ mom/margin = ∥ ∇ θ L margin ∥ + ε ∥ ∇ θ L mom ∥ stays near a constant scale (median 0.38 0.38 0.38 ; 10–90% [ 0.18 , 1.30 ] [0.18,\,1.30] [ 0.18 , 1.30 ] ), and both remain non-trivial yet typically subdominant to CE: ρ margin/CE = ∥ ∇ θ L margin ∥ ∥ ∇ θ L CE ∥ + ε \rho_{\text{margin/CE}}=\frac{\|\nabla_{\theta}L_{\text{margin}}\|}{\|\nabla_{\theta}L_{\text{CE}}\|+\varepsilon} ρ margin/CE = ∥ ∇ θ L CE ∥ + ε ∥ ∇ θ L margin ∥ and ρ mom/CE = ∥ ∇ θ L mom ∥ ∥ ∇ θ L CE ∥ + ε \rho_{\text{mom/CE}}=\frac{\|\nabla_{\theta}L_{\text{mom}}\|}{\|\nabla_{\theta}L_{\text{CE}}\|+\varepsilon} ρ mom/CE = ∥ ∇ θ L CE ∥ + ε ∥ ∇ θ L mom ∥ have medians 0.28 0.28 0.28 and 0.17 0.17 0.17 . Thus, our objective is well-conditioned despite mixed-order terms. ε = 10 − 12 \varepsilon=10^{-12} ε = 1 0 − 12 only for numerical stability.