D-LEAF: Localizing and Correcting Hallucinations in Multimodal LLMs via Layer-to-head Attention Diagnostics

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

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.

Introduction

Multimodal Large Language Models (MLLMs) such as LLaVA and MiniGPT-4 have demonstrated remarkable capabilities in visual-linguistic tasks. However, a persistent challenge is the phenomenon of "hallucination," where the model generates factually incorrect statements about the image. This is often attributed to "textual inertia"—the model's tendency to rely on its internal language priors rather than the provided visual tokens.

Existing mitigation strategies often rely on "blanket" adjustments, such as globally boosting visual attention. However, these methods are often inefficient and can degrade model performance by suppressing correctly functioning attention heads. This paper introduces D-LEAF (Dynamic Layer-wise Entropy and Attention Fusion), a framework designed to surgically localize and correct hallucinations at the layer and head level during inference.

Methodology: The D-LEAF Framework

D-LEAF operates on a "localize-before-correct" principle, using two novel diagnostic metrics to identify where the model's attention is failing:

  1. Layer Image-Attention Entropy (LIAE): This metric monitors the "focus" of a layer. High entropy indicates that attention is too diffuse, suggesting the model is guessing rather than grounding its output in the image.
  2. Image Attention Focus (IAF): Once a layer is flagged, IAF identifies specific attention heads that are ignoring visual evidence.
Figure 1: The D-LEAF pipeline detects high entropy in specific layers and adjusts attention values by fusing patterns from high-focus heads to correct hallucinations.

When a hallucination is detected, D-LEAF applies a Mixed Attention Matrix Correction. Instead of simply muting "bad" heads, it fuses the attention patterns of the highest-performing heads into the underperforming ones. This steers the model back toward the visual evidence while maintaining the linguistic coherence of the generation. Crucially, the authors establish a theoretical link showing this adjustment is mathematically equivalent to the optimization direction used in Direct Preference Optimization (DPO).

Experimental Results

The effectiveness of D-LEAF was validated across five major MLLMs using benchmarks like CHAIR (for captioning) and POPE (for VQA).

Figure 2: Comparison of LLaVA's standard output and indiscriminate modification versus D-LEAF's selective modification. D-LEAF correctly identifies the dog's color as brown by intervening in specific layers.

Key results include:

  • Hallucination Reduction: A 53% relative reduction in sentence-level hallucinations on the CHAIR benchmark for MiniGPT-4 compared to the SPIN baseline.
  • Performance Gains: Improved accuracy and F1-scores in VQA tasks by approximately 4% across multiple architectures.
  • Efficiency: D-LEAF adds only 8% throughput overhead, making it significantly faster than alternative inference-time correction methods like HALC, which can slow decoding by over 2x.

Conclusion

D-LEAF demonstrates that hallucinations in MLLMs are not uniform across the model architecture but are often localized to specific layers and heads. By using LIAE and IAF to guide surgical interventions, D-LEAF effectively suppresses hallucinations while preserving the model's descriptive richness and computational efficiency. This "localize-before-correct" approach offers a promising path for making MLLMs more reliable in real-world applications.

Summary updated

BibTeX
@misc{yang2025d,
  author = {Tiancheng Yang and Lin Zhang and Jiaye Lin and Guimin Hu and Di Wang and Lijie Hu},
  title = {{D-LEAF: Localizing and Correcting Hallucinations in Multimodal LLMs via Layer-to-head Attention Diagnostics}},
  year = {2025},
  eprint = {2509.07864},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.07864},
}
Figure