TL;DR
This paper introduces a novel test-time consistency framework for Vision-Language Models (VLMs) that significantly improves their semantic consistency without requiring any retraining or access to labeled data. By leveraging semantically equivalent input variants and applying two lightweight loss functions, the method enhances model robustness and reliability, especially in high-stakes applications.
What Problem Does This Paper Address?
Vision-Language Models (VLMs) have shown remarkable progress in tasks like visual question answering and image captioning. However, a critical issue is their semantic inconsistency: they can produce different, yet semantically equivalent, outputs for inputs that are essentially the same but slightly perturbed (e.g., rephrased questions or slightly altered images). This inconsistency undermines their reliability and trustworthiness, especially in real-world scenarios. While prior work has attempted to address this through architectural changes or extensive fine-tuning on curated datasets, these methods are often computationally expensive and require significant data. This paper tackles the problem of achieving semantic consistency in VLMs at inference time, making it practical and accessible.
Methods
The core of the proposed method is a test-time consistency framework that operates post-hoc, meaning it's applied after the model has been trained and during the inference phase. It's designed to be model-agnostic and plug-and-play.
The framework works by taking a single test input and generating multiple semantically equivalent variants of it. These variants are then passed through the VLM to obtain output distributions. Two complementary loss functions are used to encourage consistency:
- Cross-Entropy Agreement Loss (LCE): This loss encourages the model's output token distributions across the different input variants to align. It penalizes divergence in these distributions, promoting a smoother and more consistent generation process at the token level.
- Pseudo-Label Consistency Loss (LPL): This loss aligns the output of each variant towards a consensus "pseudo-label." This pseudo-label is derived by clustering the decoded textual outputs from the variants and selecting the most frequent response. This helps to anchor the model's predictions to a stable, dominant semantic output.
The framework then performs a small number of gradient-based updates (typically 1-4 steps) using a weighted sum of these two losses. To further refine this, an adaptive step selection mechanism is introduced, which dynamically chooses the optimal number of adaptation steps for each test input to avoid over-adaptation and degradation.
Datasets
The primary dataset used for evaluation is the MM-R³ consistency benchmark [6]. This benchmark is specifically designed to evaluate VLM consistency by providing three types of semantic variations:
- Question Rephrasing: Linguistic perturbations of the question.
- Image Restyling: Visual perturbations of the image (e.g., using neural style transfer).
- Context Reasoning: Visual perturbations involving occlusions.
The paper also mentions evaluation on the OKVQA dataset [19] to assess the impact on original task performance.
Key Insights and Ideas
- Test-time adaptation for consistency: The paper demonstrates that significant improvements in semantic consistency can be achieved during inference without any retraining, which is a major practical advantage.
- Complementarity of losses: The combination of Cross-Entropy Agreement Loss (for token-level alignment) and Pseudo-Label Consistency Loss (for output-level consensus) is crucial for achieving robust consistency.
- Adaptive step selection: Dynamically adjusting the number of adaptation steps per input is key to balancing consistency gains with avoiding over-adaptation and potential performance degradation.
- Consistency as a core metric: The work strongly advocates for consistency to be treated as a primary evaluation criterion for VLMs, alongside accuracy, for building reliable systems.
- Robustness to perturbations: The method shows strong performance across various semantic perturbations, highlighting its ability to generalize and maintain stable outputs.
Key Results
- Substantial consistency gains: The proposed framework consistently improves semantic consistency (Con and Sc metrics) across multiple state-of-the-art VLMs (LLaVA 1.5M, LLaVA-Next, Qwen2-VL, InternVL3, Idefics2) on the MM-R³ benchmark. For example, on LLaVA-Next, consistency for Question Rephrasing improved from 49.18 to 85.18 with the adaptive test-time method.
- Improved overall performance: The framework also leads to significant improvements in the overall score (Oall), which is a harmonic mean of accuracy and consistency. For LLaVA-1.5M on Question Rephrasing, Oall increased from 52.73 to 64.08.
- Preservation/Enhancement of Accuracy: Notably, the method often preserves or even slightly enhances accuracy on original, unperturbed tasks, as seen in OKVQA results where LLaVA-Next and Qwen2-VL accuracy improved after adaptation.
- Efficiency: The method requires only a few gradient steps at test time, making it computationally efficient compared to full fine-tuning.
- Comparison to Fine-tuning: The test-time approach achieves competitive or superior results in consistency compared to full fine-tuning methods, while being vastly more efficient.
Limitations and Future Work
- Inference Latency: The method requires multiple forward and backward passes per test input, which increases inference latency. While more efficient than full fine-tuning, it's not instantaneous.
- Limited to Local Optima: Adaptation is performed locally on a single test point, which might not correct broader model deficiencies or systematic biases, and different inputs could lead to different local optima.
- Not Suitable for Frozen Models: The approach updates model parameters during inference, making it unsuitable for deployment in strictly frozen or closed-source model environments.
- MM-R³ Scope: The analysis is limited by the specific perturbations in the MM-R³ dataset, which may not cover all real-world consistency challenges.
- Future Work: The authors suggest exploring more sophisticated adaptation strategies and investigating the trade-offs between consistency and other desirable model properties. They also advocate for consistency to be a central design goal for future VLM development.
Summary updated