Gradient-guided Attention Map Editing: Towards Efficient Contextual Hallucination Mitigation

Yu Wang, Kamalika Das, Xiang Gao, Wendi Cui, Peng Li +1 more
3/11/2025
cs.CLcs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

In tasks like summarization and open-book question answering (QA), Large Language Models (LLMs) often encounter "contextual hallucination", where they produce irrelevant or incorrect responses despite having access to accurate source information. This typically occurs because these models tend to prioritize self-generated content over the input context, causing them to disregard pertinent details. To address this challenge, we introduce a novel method called "Guided Attention Map Editing" (GAME), which dynamically adjusts attention maps to improve contextual relevance. During inference, GAME employs a trained classifier to identify attention maps prone to inducing hallucinations and executes targeted interventions. These interventions, guided by gradient-informed "edit directions'', strategically redistribute attention weights across various heads to effectively reduce hallucination. Comprehensive evaluations on challenging summarization and open-book QA tasks show that GAME consistently reduces hallucinations across a variety of open-source models. Specifically, GAME reduces hallucinations by 10% in the XSum summarization task while achieving a 7X speed-up in computational efficiency compared to the state-of-the-art baselines.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2025gradientguided,
  title  = {Gradient-guided Attention Map Editing: Towards Efficient Contextual Hallucination Mitigation},
  author = {Yu Wang and Kamalika Das and Xiang Gao and Wendi Cui and Peng Li and Jiaxin Zhang},
  year   = {2025},
  eprint = {2503.08963},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.08963v2}
}

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/2503.08963.svg)](https://codeofpaper.com/paper/2503.08963)

Discussion