Dynamic Attention-Guided Context Decoding for Mitigating Context Faithfulness Hallucinations in Large Language Models
Yanwen Huang, Yong Zhang, Ning Cheng, Zhitao Li, Shaojun Wang, Jing Xiao
TL;DR
This work tackles context-faithfulness hallucinations in retrieval-augmented LLMs by showing that token-level uncertainty strongly correlates with unfaithful outputs and that retrieved context is often recognized but not properly prioritized. It introduces Dynamic Attention-Guided Context Decoding (DAGCD), a single-pass decoding framework that leverages attention-utilization signals via a Context Utilization Detector and a top-K attention-head analysis to construct a utilization distribution, then adjusts token probabilities using $P' = P + \alpha H_{ ext{norm}}(P) \cdot U_{top}$ to bias generation toward contextually supported tokens. The approach is validated across seven open-book QA datasets and multiple model families, yielding substantial improvements in EM and F1 over greedy decoding and competitive baselines, with strong data-efficiency and real-time applicability. The work also shows that attention-head signals offer a robust, interpretable mechanism for understanding and extracting context-utilization patterns, suggesting a fundamental role for attention in controlling context integration in Transformer-based LLMs.
Abstract
Large language models (LLMs) often exhibit Context Faithfulness Hallucinations, where outputs deviate from retrieved information due to incomplete context integration. Our analysis reveals a strong correlation between token-level uncertainty and hallucinations. We hypothesize that attention mechanisms inherently encode context utilization signals, supported by probing analysis. Based on these insights, we propose Dynamic Attention-Guided Context Decoding (DAGCD), a lightweight framework that leverages attention distributions and uncertainty signals in a single-pass decoding. Experiments on open-book QA datasets demonstrate DAGCD's effectiveness, yielding significant improvements in faithfulness and robustness while preserving computational efficiency.
