Seeing the Image: Prioritizing Visual Correlation by Contrastive Alignment

Xin Xiao, Bohong Wu, Jiacong Wang, Chunyuan Li, Xun Zhou, Haoyuan Guo · OpenReview

Abstract

Existing image-text modality alignment in Vision Language Models (VLMs) treats each text token equally in an autoregressive manner. Despite being simple and effective, this method results in sub-optimal cross-modal alignment by over-emphasizing the text tokens that are less correlated with or even contradictory with the input images. In this paper, we advocate for assigning distinct contributions for each text token based on its visual correlation. Specifically, we present by contrasting image inputs, the difference in prediction logits on each text token provides strong guidance of visual correlation. We therefore introduce Contrastive ALignment (CAL), a simple yet effective re-weighting strategy that prioritizes training visually correlated tokens. Our experimental results demonstrate that CAL consistently improves different types of VLMs across different resolutions and model sizes on various benchmark datasets. Importantly, our method incurs minimal additional computational overhead, rendering it highly efficient compared to alternative data scaling strategies.

Introduction

Standard Vision Language Models (VLMs) are typically trained using a next-token prediction objective, which treats every word in a caption or instruction with equal importance. However, this approach overlooks a fundamental reality of multimodal data: not all text tokens are equally relevant to the visual input. In many cases, tokens are either visually irrelevant (e.g., functional grammar like "the" or "is") or visually contradictory (e.g., hallucinations in AI-generated datasets where a model describes objects not present in the image).

When models are forced to treat these noisy or filler tokens with the same weight as high-value visual tokens (such as specific object names or attributes), they waste capacity learning language priors rather than true cross-modal alignment. To address this, we propose Contrastive ALignment (CAL), a training-time re-weighting strategy designed to make the model "see" the image more effectively by prioritizing tokens that are grounded in the visual evidence.

Methodology: Contrastive Alignment (CAL)

The core intuition behind CAL is that if a model can predict a word just as accurately without the image as it can with the image, that word is likely not visually grounded. Conversely, if the prediction confidence increases significantly when the image is provided, that token is highly correlated with the visual input.

The CAL Workflow

CAL implements a dynamic re-weighting mechanism during the training phase through the following steps:

  1. Dual Forward Passes: For every training sample, the model performs two forward passes: one with the image input ($\tilde{o}$) and one without it ($o$), using a null or placeholder image.
  2. Logit Contrasting: The system calculates the difference between the prediction scores (logits) of the two passes: $\Delta o = \tilde{o} - o$. A high $\Delta o$ indicates the image was essential for predicting that specific token, while a low or negative value suggests the token is a filler or contradicts the image.
  3. Token Re-weighting: This difference is transformed into a weight for each token's loss. To ensure training stability, the weights are subjected to:
  4. Clamping: Bounds ($\alpha, \beta$) are applied to prevent extreme weight values.
  5. Smoothing: Average pooling is applied across a small window of tokens to maintain consistency within semantic phrases.
  6. Weighted Loss: The final training loss is the standard Maximum Likelihood Estimation (MLE), scaled by these dynamic, contrastive weights.

Crucially, CAL is a training-only intervention. At inference time, the model operates as a standard VLM, incurring zero additional computational cost for the end-user.

Experimental Setup

We evaluated CAL across several prominent VLM architectures, including LLaVA-1.5, LLaVA-NeXT, and Mini-Gemini, ranging from 7B to 13B parameters.

  • Training Data: Models were trained on popular mixtures such as LLaVA-665k, ShareGPT4V, and VQADoc.
  • Benchmarks: Performance was measured across a diverse suite of tasks, including Visual Question Answering (OCR-Bench, MMStar), Image Captioning (COCO, TextCaps), and Visual Grounding (RefCOCOg).

Key Results and Insights

Performance Gains

CAL consistently outperformed baseline models across all benchmarks. Notable improvements include:

  • OCR and Document Understanding: On the VQADoc benchmark, CAL improved LLaVA-NeXT-13B by 1.7 ANLS. On OCR-Bench, it provided a substantial boost of 21 points, demonstrating a superior ability to ground text in visual details.
  • Fine-Grained Captioning: The method achieved a +6.2 CIDEr score improvement on TextCaps, indicating that the model becomes more adept at describing specific details rather than relying on generic descriptions.
  • Denoising Capabilities: In experiments where training data was intentionally "polluted" (mismatching images and captions), CAL remained significantly more stable than the baseline. By assigning low weights to contradictory tokens, CAL acts as an automatic filter for low-quality or hallucinated data.

Efficiency

While CAL requires an additional forward pass during training—increasing training time by approximately 20%—it yields performance gains comparable to much more expensive strategies, such as increasing image resolution or drastically scaling the dataset size. This makes CAL a highly efficient alternative for improving model alignment.

Conclusion

Contrastive ALignment (CAL) offers a simple yet powerful shift in how we train Vision Language Models. By moving away from uniform token weighting and toward a strategy that prioritizes visual correlation, we can build models that are more grounded, less prone to hallucination, and more efficient at learning from complex, real-world data. Future work will explore adaptive hyperparameter settings to further refine the weighting logic across different stages of model pre-training and fine-tuning.

Summary updated

BibTeX
@inproceedings{xiao2024seeing,
  author = {Xin Xiao and Bohong Wu and Jiacong Wang and Chunyuan Li and Xun Zhou and Haoyuan Guo},
  title = {{Seeing the Image: Prioritizing Visual Correlation by Contrastive Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=NsxthTVpqA},
}
Figure