Manuscript Offprint

arXiv:2610.39861

M-PFT: Angular Margin for Calibrated Prompt-Tuning of Fine-Tuned Vision-Language Models

Shihab Aaqil Ahamed, Mohamed Ansaff, Nang Khin Myat Lay Phyu, Udaya Sampath K. Perera Miriya Thanthrige, Chamira U. S. Edussooriya, Ranga Rodrigo, Muhammad Haris Khan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Prompt-tuning has emerged as a parameter-efficient technique for adapting large-scale vision-language models (VLMs) to downstream tasks while keeping the pre-trained weights frozen. However, prompt-tuned VLMs often suffer from a base-to-novel dual miscalibration problem, where models typically show underconfidence on base classes and overconfidence on novel classes. Current VLM calibration approaches address this dual miscalibration either separately or jointly, but lack a geometric understanding of the hyperspherical embedding space and thus fail to exploit angular discriminative properties to adjust distorted decision boundaries. To address this, we propose M-PFT, a novel angular-margin approach for prompt tuning that introduces two complementary objectives to promote class discriminability and semantic anchoring. This enlarges the angular margin by 1) minimizing the maximum cosine similarity between tunable class embeddings to reduce embedding collapse and 2) minimizing the angular distance between each tunable embedding and its corresponding zero-shot embedding to preserve semantic geometry. Extensive experiments across 9 prompt-tuning methods with various backbones on 15 diverse datasets show that our approach reduces the average calibration error on novel classes, while remaining competitive on base classes and maintaining comparable accuracy. Further analyses reveal that M-PFT effectively adjusts distorted decision boundaries induced by prompt tuning while preserving the pre-trained embedding space, improving calibration with negligible computational overhead. Our code is available at M-PFT.

1. Introduction

Foundational vision-language models (VLMs), such as CLIP [36] and ALIGN [16], have achieved remarkable progress in open-vocabulary image recognition by leveraging

Figure

Figure 1. Comparison of calibration scores with TCPT [39] and DAC [45] on 10 fine-grained classification datasets with CoOp [52] for base (left) and novel (right) classes. Each axis reports 1−ECEECEworst1 - \frac{ECE}{ECE_{worst}} (percentage of the worst method's ECE removed; larger is better). Ours maximizes the covered area (a higher score indicates a larger footprint), indicating better calibration and effective addressing of the dual miscalibration problem.

ing large-scale natural-language supervision. To efficiently adapt such pre-trained large VLMs to domain-specific tasks, where full fine-tuning is often computationally prohibitive, Parameter-Efficient Fine-Tuning (PEFT) techniques have gained considerable attention [20]. Representative PEFT approaches, such as Low-Rank Adaptation [15], inject trainable low-rank decomposition matrices into transformer layers based on the hypothesis that weight updates have a low intrinsic rank, while Prompt-Tuning [20] optimizes a small subset of learnable prompt tokens while keeping the backbone frozen. Recently, attention has shifted toward Test-Time Prompt-Tuning [40], which, unlike standard prompt-tuning, requires no labeled training data and instead optimizes learnable prompt vectors via gradient descent, adapting them during inference on unlabeled test samples. In open-vocabulary settings, prompt-tuned VLMs can substantially improve performance on base classes while preserving the model's inherent capability to generalize to novel classes [17, 51]. Such low-cost adaptation is particularly valuable in safety-critical applications such as healthcare and autonomous systems, where full fine-tuning is often infeasible [8, 49].

However, existing few-shot prompt-tuning techniques [11,

Figure

○ Origin●● Base tunable □□ Base zero-shot ↘ θjk\theta_{jk}: separability

▶ Novel tunable□□ Novel zero-shot ↘ θj\theta_j: semantic drift

Figure 2. Hyperspherical visualization of the dual miscalibration problem. LCE\mathcal{L}_{\mathrm{CE}} distorts decision boundaries by inducing embedding collapse θjk↓\theta_{jk} \downarrow and semantic drift θj↑\theta_j \uparrow. Lmin⁡−max⁡\mathcal{L}_{\min-\max} maximizes θjk\theta_{jk} to mitigate collapse and improve class discriminability, while Lanchor\mathcal{L}_{\text{anchor}} minimizes the drift θj\theta_j by anchoring tunable embeddings to zero-shot embeddings to preserve semantic geometry. This dual design creates complementary objectives that act synergistically to enlarge the angular margin θjk−θj\theta_{jk} - \theta_j, yielding well-separated, discriminative decision boundaries while preserving pre-trained semantics and addressing the dual miscalibration.

17, 18, 23, 46, 50–53] for VLMs primarily focus on improving classification accuracy while often overlooking reliable confidence calibration, i.e., the degree to which a model's predicted confidence reflects the true likelihood of correctness [10, 42], which is evaluated with Expected Calibration Error (ECE). For example, prompt-tuned VLMs exhibit base-to-novel dual miscalibration, which typically shows underconfidence on base classes and overconfidence on novel classes [39, 44]. When deployed in safety-critical applications, this dual miscalibration is harmful in two ways: overconfidence often results in models assigning high confidence to incorrect predictions, leading to inappropriate automation or missed human review, while underconfidence assigns low confidence to correct predictions, which is associated with uncertain or unreliable confidence estimates undermining triage, wasting expert time, and eroding trust [3, 5, 26, 32, 54].

To maintain well-calibrated confidence estimates across both base and novel classes, some progress has been made toward addressing dual miscalibration. In light of this, prior works such as DAC [45] scale the temperature based on the textual deviation (TD) score between embeddings of each novel class. CAC [24] adjusts logits based on image-text alignment, while DOR [44] samples textual outliers that do not overlap with base classes. Another approach [29] normalizes logits and constrains them to the original zero-shot VLM distribution by modifying the softmax expression with margin penalization. TCPT [39] introduces an auxiliary regularization loss to stabilize decision boundaries with a mean-variance margin while preserving semantic dispersion by aligning the first and second moments of text embeddings. Despite these advances, we observe that these statistical approaches fail to adequately exploit the angular discriminative properties of the hyperspherical embedding space when adjusting distorted decision boundaries, which is crucial for resolving dual miscalibration. Specifically, most methods do not impose explicit geometric constraints during prompt tuning, allowing learned embeddings to deviate from the pre-trained embedding space. We define θjk\theta_{jk} as the angle between tunable class embeddings and θj\theta_j as the angle between a tunable embedding and its corresponding zero-shot embedding. This can result in issues like (1) embedding collapse, where tunable class embeddings cluster together ( θjk↓\theta_{jk} \downarrow), reducing inter-class discriminability [22], and (2) semantic drift, where tunable embeddings move away from their corresponding zero-shot embeddings ( θj↑\theta_j \uparrow), distorting decision boundaries, degrading model's ability to learn semantic relationships between class embeddings, and inducing spurious overconfident predictions on novel inputs [24, 44]. Furthermore, auxiliary losses employed by existing methods target statistical properties rather than angular discriminative properties of class embeddings. This can introduce gradients in opposing directions that partially offset each other, limiting their ability to adjust distorted decision boundaries [29, 39]. Consequently, these methods cannot effectively enlarge the angular margin and remain suboptimal for calibration.

Inspired by these insights, we propose M-PFT, a novel angular optimization approach that introduces a simple yet effective angular-margin approach into prompt tuning. This exploits the angular discriminative properties of the hyperspherical embedding space [21, 22] with negligible computational overhead. To address dual miscalibration, our proposed method 1) promotes class discriminability by minimizing the maximum cosine similarity between tunable class embeddings, encouraging discriminative decision boundaries, and 2) enforces semantic anchoring by minimizing the angular distance between each tunable embedding and its corresponding zero-shot embedding, thereby preserving semantic geometry. As shown in Fig. 2, these complementary objectives act synergistically to enlarge the angular margin ( θjk−θj\theta_{jk} - \theta_j): Lmin-max\mathcal{L}_{\text{min-max}} maximizes θjk\theta_{jk}, while Lanchor\mathcal{L}_{\text{anchor}} minimizes θj\theta_j. This absence of conflicting gradients (see Tab. 4 and Fig. 4) and yields well-separated, discriminative decision boundaries while preserving the pre-trained embedding space, thereby reducing base-class underconfidence and novel-class overconfidence, as shown in Fig. 1. Our major contributions are summarized as follows:

• We propose a novel angular-margin approach that exploits the angular discriminative properties of the hyperspherical embedding space to address dual miscalibration of prompt-tuned VLMs, improving upon leading calibration

∗^{*}These authors contributed equally to this work.

techniques for prompt tuning.

• We introduce two complementary objectives that adjust distorted decision boundaries while preserving the semantic geometry of the pre-trained embedding space. The angular margin is enlarged by 1) minimizing the maximum cosine similarity between tunable class embeddings and 2) minimizing the angle between each tunable embedding and its corresponding zero-shot embedding.

• We conduct extensive experiments across 9 prompt-tuning methods and 15 diverse datasets, showing that M-PFT achieves better calibration without compromising accuracy and outperforms post-hoc and training-time baselines.

References (51)