See Only When Needed: Context-Aware Attention Intervention for Mitigating Hallucinations in LVLMs

Yuqing Lei, Wenbo Lyu, Yingjun Du, Xiantong Zhen, Cees G. M. Snoek +1 more
6/29/2026
1 citation
cs.CV

Official code: Iris1946/CAI (7 stars, Python, MIT, last commit 2026-07-01).

Abstract

Large Vision-Language Models (LVLMs) excel at multimodal tasks but remain prone to object hallucinations. Prior training-free remedies often uniformly strengthen visual signals, which may also amplify irrelevant regions and introduce spurious evidence, harming fluency.

Show full abstract

We propose Context-aware Attention Intervention (CAI), a training-free inference-time mechanism that enforces a see only when needed principle via two-axis selectivity: where to look and when to intervene. At each decoding step, CAI derives token-specific visual relevance from early-layer representations to localize semantically aligned regions, and applies a conservative, entropy- and depth-gated attention tilt only for uncertainty-spiking tokens in deeper layers where visual grounding degrades, leaving confident tokens and irrelevant regions largely unchanged. This targeted intervention strengthens visual grounding while preserving linguistic fluency, and it yields consistent improvements even without contrastive decoding, which remains optional as an auxiliary bias-suppression module. Extensive experiments across multiple LVLM backbones and benchmarks show that CAI achieves state-of-the-art hallucination mitigation, and our analysis characterizes CAI as a KL-minimal attention reweighting with bounded interference under inactive gates or small tilts. Code is available at https://github.com/Iris1946/CAI.

View on arXivView PDF

Code Implementations(1)

Iris1946/CAIOfficial100%
MIT
70Python, CudaJun 28, 20265 months agoMIT

Similar Papers

Cite this paper

@article{lei2026only,
  title  = {See Only When Needed: Context-Aware Attention Intervention for Mitigating Hallucinations in LVLMs},
  author = {Yuqing Lei and Wenbo Lyu and Yingjun Du and Xiantong Zhen and Cees G. M. Snoek and Ling Shao},
  year   = {2026},
  eprint = {2606.29847},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.29847v1},
  journal = {ECCV 2026 2026}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.29847.svg)](https://codeofpaper.com/paper/2606.29847)

Discussion