Table of Contents
Fetching ...

Tracing and Mitigating Hallucinations in Multimodal LLMs via Dynamic Attention Localization

Tiancheng Yang, Lin Zhang, Jiaye Lin, Guimin Hu, Di Wang, Lijie Hu

TL;DR

This work tackles hallucinations in multimodal LLMs by localizing errors to specific attention components during inference. It introduces two diagnostics, Layer Image Attention Entropy (LIAE) and Image Attention Focus (IAF), to identify unreliable layers and heads, and presents Dynamic Layer-wise Entropy and Attention Fusion (D-LEAF) to apply selective corrections. The approach is theoretically connected to Direct Preference Optimization (DPO), providing a principled justification for the corrective updates. Empirically, D-LEAF delivers substantial hallucination reductions (up to about 53%–57% on key metrics) with minimal throughput overhead and demonstrates strong generalization across models and benchmarks, enhancing reliability for vision-language tasks.

Abstract

Multimodal Large Language Models (MLLMs) achieve strong performance on tasks like image captioning and visual question answering, but remain prone to hallucinations, where generated text conflicts with the visual input. Prior work links this partly to insufficient visual attention, but existing attention-based detectors and mitigation typically apply uniform adjustments across layers and heads, obscuring where errors originate. In this paper, we first show these methods fail to accurately localize problematic layers. Then, we introduce two diagnostics: Layer Image Attention Entropy (LIAE) which flags anomalous layers, and Image Attention Focus (IAF) which scores attention heads within those layers. Analysis shows that LIAE pinpoints faulty layers and IAF reliably ranks heads that warrant correction. Guided by these signals, we propose Dynamic Layer-wise Entropy and Attention Fusion (D-LEAF), a task-agnostic, attention-guided method that dynamically localizes and corrects errors during inference with negligible overhead. Furthermore, by establishing a connection between D-LEAF and DPO, we provide theoretical justification for the effectiveness of D-LEAF. Results show our D-LEAF delivers a 53\% relative improvement on standard captioning benchmarks, and on VQA both accuracy and F1-score improve by approximately 4\%, substantially suppressing hallucinations while preserving efficiency.

Tracing and Mitigating Hallucinations in Multimodal LLMs via Dynamic Attention Localization

TL;DR

This work tackles hallucinations in multimodal LLMs by localizing errors to specific attention components during inference. It introduces two diagnostics, Layer Image Attention Entropy (LIAE) and Image Attention Focus (IAF), to identify unreliable layers and heads, and presents Dynamic Layer-wise Entropy and Attention Fusion (D-LEAF) to apply selective corrections. The approach is theoretically connected to Direct Preference Optimization (DPO), providing a principled justification for the corrective updates. Empirically, D-LEAF delivers substantial hallucination reductions (up to about 53%–57% on key metrics) with minimal throughput overhead and demonstrates strong generalization across models and benchmarks, enhancing reliability for vision-language tasks.

Abstract

Multimodal Large Language Models (MLLMs) achieve strong performance on tasks like image captioning and visual question answering, but remain prone to hallucinations, where generated text conflicts with the visual input. Prior work links this partly to insufficient visual attention, but existing attention-based detectors and mitigation typically apply uniform adjustments across layers and heads, obscuring where errors originate. In this paper, we first show these methods fail to accurately localize problematic layers. Then, we introduce two diagnostics: Layer Image Attention Entropy (LIAE) which flags anomalous layers, and Image Attention Focus (IAF) which scores attention heads within those layers. Analysis shows that LIAE pinpoints faulty layers and IAF reliably ranks heads that warrant correction. Guided by these signals, we propose Dynamic Layer-wise Entropy and Attention Fusion (D-LEAF), a task-agnostic, attention-guided method that dynamically localizes and corrects errors during inference with negligible overhead. Furthermore, by establishing a connection between D-LEAF and DPO, we provide theoretical justification for the effectiveness of D-LEAF. Results show our D-LEAF delivers a 53\% relative improvement on standard captioning benchmarks, and on VQA both accuracy and F1-score improve by approximately 4\%, substantially suppressing hallucinations while preserving efficiency.

Paper Structure

This paper contains 54 sections, 1 theorem, 30 equations, 27 figures, 5 tables, 1 algorithm.

Key Result

Theorem 1

Let $x_i^+$ and $x_i^-$ denote the hallucinated and preferred embeddings at any layer of an MLLM, respectively. The gradient of the DPO objective satisfies Thus, DPO reduces the feature difference $x_i^+ - x_i^-$ by pushing the hallucinated embedding toward the preferred one. In D-LEAF, attention-head fusion modifies the attention matrix so that the updated embedding decreases the same feature d

Figures (27)

  • Figure 1: The workflow of D-LEAF. During inference, when a layer’s attention-module entropy exceeds a dynamic threshold, D-LEAF then corrects the attention heads exhibiting insufficient visual focus, suppressing hallucinations (e.g., the phrase “dining table”).
  • Figure 2: A motivating example of using selective attention correction in a visually ambiguous scenario.
  • Figure 3: Distribution of abnormal attention heads across layers.
  • Figure 4: The impact of different suppression methods in LLaVA.
  • Figure 5: LIAE Distribution across object token types in MiniGPT-4.
  • ...and 22 more figures

Theorems & Definitions (2)

  • Theorem 1: Equivalence of Optimization Directions in DPO and D-LEAF
  • Remark 1