Manuscript Offprint

arXiv:2610.21470

Cross-Prompt Inference Mitigates Rare-Class Suppression in Imbalanced VLM Finetuning

Emanuel Ben Baruch, Sivan Biham, Alon Shoshan, Yochai Zvik, Avi Ben-Cohen

ABSTRACT

When a vision-language model is finetuned on class-imbalanced data, rare-class recall can fall well below the model's own zero-shot performance. In this regime, we uncover a surprising matched-prompt penalty whereby the standard choice of reusing the descriptive finetuning prompt at inference can yield lower rare-class recall than using a different descriptive prompt. We call this inference-time strategy cross-prompt inference. We evaluate diverse VLMs across six datasets and find that cross-prompt inference consistently recovers rare-class recall, with varying trade-offs in frequent-class recall. The effect reflects a train-eval prompt interaction rather than prompt quality alone, and does not arise with non-descriptive prompt changes. It is strongest when imbalance and visual confusability produce substantial rare-class suppression, and is weak or absent when such suppression does not occur. Using Tuning Contribution (TuCo), which decomposes a model's computation into pretrained and finetuning parts, we find that cross-prompt inference reduces reliance on finetuning-induced computation and shifts the model toward its pretrained component. Reducing that finetuning contribution also substantially reduces the cross-prompt advantage. These results show that rare-class knowledge suppressed by imbalanced finetuning can remain accessible under a different inference prompt.

1 INTRODUCTION

Vision-language models are increasingly adapted to downstream image classification through supervised finetuning on labeled data (Zhang et al., 2024; Geigle et al., 2024). In many applications, this data is long-tailed. A small set of frequent classes has abundant supervision, while rare classes have only a few examples. Such imbalance can bias a supervised classifier toward frequent classes and degrade performance where supervision is scarce (Cui et al., 2019; Cao et al., 2019; Kang et al., 2020; Menon et al., 2021).

VLMs offer an additional degree of freedom. Their label space can be expressed through natural language, either with class names alone or with short descriptions of visual attributes and contrastive cues. These descriptions can surface class knowledge acquired during pretraining. This may be particularly useful when rare classes have little downstream supervision.

We find that severe imbalance can suppress this rare class knowledge during finetuning. Across fine-grained benchmarks, rare class recall can fall well below the model's zero-shot level while performance on frequent classes improves. Evaluating with descriptive prompts, we uncover a surprising interaction between the finetuning and inference prompts. When finetuning uses a descriptive prompt P, evaluating with that same prompt can yield lower rare-class recall than evaluating the identical finetuned model with a different descriptive prompt P′P'. This switch can recover substantial rare-class recall, with varying trade-offs in frequent-class recall. We call this effect the matched-prompt penalty and the inference-time strategy cross-prompt inference (see Figure 1).

The matched-prompt penalty reflects an interaction between the training and evaluation prompts rather than the quality of either prompt alone. Moreover, changing between non-descriptive prompts does not recover rare-class recall, indicating that descriptive content is necessary.

Figure

(a) Cross-prompt inference

Figure

(b) Food-101 matrix

Figure 1: The matched-prompt penalty under class-imbalanced VLM finetuning. (a) Finetuning with prompt P on an imbalanced distribution favors frequent classes and suppresses rare ones. Reusing P at inference preserves this suppression, while a different descriptive prompt P′P' mitigates it without retraining by enabling the model to draw less on the computation introduced by finetuning. (b) A 7×77 \times 7 Food-101 cross-prompt matrix, in which the matched cell is never its row maximum.

To better understand why cross-prompt inference recovers rare classes, we analyze how the evaluation prompt changes the relative influence of pretrained and finetuning-induced computation. Using TuCo (Nuti et al., 2025), we find that mismatched descriptive prompts rely less on computation introduced during finetuning. Reducing that contribution also substantially reduces the cross-prompt advantage. Together, these results support the view that cross-prompt inference shifts computation away from imbalanced finetuning and toward the pretrained component, recovering rare-class knowledge suppressed by finetuning.

We further characterize when this recovery occurs. Rare class suppression grows with both the imbalance ratio and the visual similarity between frequent and rare classes. Cross-prompt inference therefore helps most in fine-grained and highly imbalanced settings, where finetuning has substantially degraded rare-class performance. When rare classes remain intact after finetuning, the matched-prompt penalty is weak or absent. We further find that cross-prompt inference complements standard oversampling, yielding further gains in rare-class recall. We evaluate these findings across six datasets and six VLMs spanning several model families and scales.

Our contributions are threefold. First, we identify the matched-prompt penalty in imbalanced VLM finetuning and show that cross-prompt inference can mitigate the resulting rare-class suppression. Second, TuCo analysis shows that cross-prompt inference reduces reliance on finetuning-induced computation, and that its recovery advantage shrinks when this contribution is removed. Third, we characterize the conditions under which the effect arises. The penalty strengthens with imbalance severity and class similarity, persists after oversampling, and disappears without descriptive prompts.

References (62)