Devils in Middle Layers of Large Vision-Language Models: Interpreting, Detecting and Mitigating Object Hallucinations via Attention Lens
Zhangqi Jiang, Junkai Chen, Beier Zhu, Tingjin Luo, Yankun Shen, Xu Yang
TL;DR
Object hallucination in LVLMs is driven by visual information processing concentrated in middle layers, with a two-stage mechanism: visual information enrichment in layers $5\text{-}18$ and semantic refinement in layers $19\text{-}26$. By introducing Visual Attention Ratio (VAR) and a logit-lens analysis, the study shows real object tokens receive stronger image-token attention than hallucinations, enabling SVAR-based detection (AUROC up to $0.74$, mAP $0.88$) and a simple inference-time Heads Guided Attention Intervention that aggregates across heads to mitigate hallucinations without retraining. The method, validated across LLaVA-1.5 (7B/13B), Shikra-7B, and MiniGPT-4-7B, substantially reduces CHAIR$_S$ (up to $24.1$ points) and CHAIR$_I$ (up to $6.3$ points) while maintaining descriptive richness. These findings advocate internal-state calibration—specifically middle-layer attention—as a practical path to more reliable LVLMs, with implications for automatic hallucination detection and broader interpretability of multimodal reasoning.
Abstract
Hallucinations in Large Vision-Language Models (LVLMs) significantly undermine their reliability, motivating researchers to explore the causes of hallucination. However, most studies primarily focus on the language aspect rather than the visual. In this paper, we address how LVLMs process visual information and whether this process causes hallucination. Firstly, we use the attention lens to identify the stages at which LVLMs handle visual data, discovering that the middle layers are crucial. Moreover, we find that these layers can be further divided into two stages: ''visual information enrichment'' and ''semantic refinement'' which respectively propagate visual data to object tokens and interpret it through text. By analyzing attention patterns during the visual information enrichment stage, we find that real tokens consistently receive higher attention weights than hallucinated ones, serving as a strong indicator of hallucination. Further examination of multi-head attention maps reveals that hallucination tokens often result from heads interacting with inconsistent objects. Based on these insights, we propose a simple inference-time method that adjusts visual attention by integrating information across various heads. Extensive experiments demonstrate that this approach effectively mitigates hallucinations in mainstream LVLMs without additional training costs. Code is available at https://github.com/ZhangqiJiang07/middle_layers_indicating_hallucinations.
