Improving Contextual Faithfulness of Large Language Models via Retrieval Heads-Induced Optimization

Lei Huang, Xiaocheng Feng, Weitao Ma, Yuchun Fan, Xiachong Feng, Yangfan Ye, Weihong Zhong, Yuxuan Gu, Baoxin Wang, Dayong Wu, Guoping Hu, Bing Qin · DOI

Introduction

Retrieval-Augmented Generation (RAG) has become the standard approach for mitigating hallucinations in Large Language Models (LLMs). However, even with access to relevant context, models frequently generate "unfaithful" responses—claims unsupported by the provided documents. This is particularly challenging in Long-Form Question Answering (LFQA), where synthesis across multiple sources is required.

Existing solutions often rely on external filters or self-critique, which act as compensatory layers rather than improving the model's intrinsic ability to distinguish between faithful and unfaithful generation. Furthermore, training models to be more faithful is hindered by the difficulty of generating realistic negative examples that mimic the subtle, intrinsic errors models actually make.

The RHIO Framework

The researchers introduce Retrieval Heads-Induced Optimization (RHIO), a novel framework designed to teach models an intrinsic mechanism for faithfulness. RHIO operates in three distinct stages:

The three stages of the RHIO framework: Unfaithful Data Augmentation, Faithfulness-Aware Tuning, and Self-Induced Decoding.

1. Unfaithful Data Augmentation

The core of RHIO lies in the discovery of "retrieval heads"—specific attention heads within the transformer architecture responsible for transferring information from the context to the generated output. By identifying and masking these heads, the model is forced to rely on its internal parametric memory, inducing realistic hallucinations that mirror real-world model errors.

Impact of masking retrieval heads on FaithScore across different Llama-2 model sizes.

As shown in the figure above, increasing the number of masked retrieval heads leads to a significant drop in FaithScore, effectively generating the "unfaithful" responses needed for training.

2. Faithfulness-Aware Tuning (FAT)

The model undergoes supervised fine-tuning on both faithful (gold) samples and the newly induced unfaithful samples. By using special control tokens—[POS] for faithful and [NEG] for unfaithful—the model learns to explicitly categorize and perceive the difference between grounded and hallucinatory generation.

3. Self-Induced Decoding (SID)

During inference, RHIO employs a contrastive decoding strategy. The model calculates the difference between the probability distributions (logits) generated when prompted with [POS] versus [NEG]. This strategy amplifies the "faithful" signal while suppressing the "hallucinatory" one, leading to more grounded outputs.

Evaluation and Results

To rigorously test RHIO, the authors introduced GroundBench, a comprehensive benchmark compiled from five LFQA datasets (ELI5-WebGPT, ExpertQA, HAGRID, CLAPNQ, and QuoteSum). GroundBench is manually curated to ensure that the provided documents contain all necessary information, creating a clean environment to measure faithfulness.

The results demonstrate the effectiveness of the RHIO approach:

  • Outperforming GPT-4o: RHIO-13B achieved an average FaithScore of 83.77% on GroundBench, surpassing both GPT-4o (82.33%) and GPT-4o-mini (80.97%).
  • Significant Improvements: Compared to standard Supervised Fine-Tuning (SFT), RHIO improved faithfulness by 12.84% for the 7B model and 12.59% for the 13B model.
  • Ablation Insights: The Self-Induced Decoding (SID) step alone contributed a 3-4% boost in faithfulness, highlighting the power of contrastive logit manipulation at inference time.

Key Insights

A major takeaway is that faithfulness is a mechanistically identifiable property. Masking retrieval heads produces error patterns (fabricated facts, incomplete info, inconsistencies) that almost perfectly mirror natural LLM errors. Furthermore, using the model's own induced errors for training (self-induced negatives) provides a more precise learning boundary than traditional synthetic errors like random entity swapping.

Limitations and Future Work

While highly effective on the Llama-2 series, the framework requires validation on other architectures like Mistral or Falcon. Additionally, GroundBench focuses on scenarios where the answer is present in the text; future research should address "open-book" scenarios where the retriever might fail. Finally, isolating specific heads for different error types (e.g., numerical vs. entity) could allow for even more granular control over model behavior.

Summary updated

Abstract

Ensuring contextual faithfulness in retrieval-augmented large language models (LLMs) is crucial for building trustworthy information-seeking systems, particularly in long-form question-answering (LFQA) scenarios. In this work, we identify a salient correlation between LFQA faithfulness and retrieval heads, a set of attention heads responsible for retrieving contextual information. Leveraging this insight, we propose RHIO, a framework designed to teach LLMs to explicitly discriminate between faithful and unfaithful generations. RHIO first augments unfaithful samples that simulate realistic model-intrinsic errors by selectively masking retrieval heads. Then, these samples are incorporated into joint training, enabling the model to distinguish unfaithful outputs from faithful ones conditioned on control tokens. Furthermore, these control tokens are leveraged to self-induce contrastive outputs, amplifying their difference through contrastive decoding. Additionally, to facilitate the evaluation of contextual faithfulness, we also introduce GroundBench, a comprehensive benchmark compiled from five existing LFQA datasets. Extensive experimental results on GroundBench demonstrate that RHIO significantly improves faithfulness, even outperforming GPT-4o.
BibTeX
@inproceedings{huang2025improving,
  author = {Lei Huang and Xiaocheng Feng and Weitao Ma and Yuchun Fan and Xiachong Feng and Yangfan Ye and Weihong Zhong and Yuxuan Gu and Baoxin Wang and Dayong Wu and Guoping Hu and Bing Qin},
  title = {{Improving Contextual Faithfulness of Large Language Models via Retrieval Heads-Induced Optimization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure