Abstract
Retrieval-Augmented Generation (RAG) systems require Large Language Models (LLMs) to generate responses that are faithful to the retrieved context. However, faithfulness hallucination remains a critical challenge, as existing methods often require costly supervision and post-training or significant inference burdens. To overcome these limitations, we introduce Self-Supervised Faithfulness Optimization (SSFO), the first self-supervised alignment approach for enhancing RAG faithfulness. SSFO constructs preference data pairs by contrasting the model's outputs generated with and without the context. Leveraging Direct Preference Optimization (DPO), SSFO aligns model faithfulness without incurring labeling costs or additional inference burden. Comprehensive evaluations show that SSFO significantly outperforms existing methods, achieving state-of-the-art faithfulness on multiple context-based question-answering datasets.
Introduction: The Challenge of Faithfulness Hallucination
Retrieval-Augmented Generation (RAG) has become the standard for grounding Large Language Models (LLMs) in external, up-to-date information. Despite this, LLMs frequently exhibit "faithfulness hallucination," where they prioritize internal parametric knowledge—often outdated or incorrect—over the provided context.
Current solutions typically fall into two categories:
- Post-training methods that rely on extensive human-labeled or GPT-4-generated "gold" datasets (often 5k–30k examples).
- Decoding-time methods that contrast probabilities during inference, which significantly increases computational latency.
SSFO addresses these issues by providing a label-free, lightweight alignment method that maintains standard inference speeds.
Methodology: Self-Supervised Faithfulness Optimization
The core innovation of SSFO is its ability to use the model's own behavior as a training signal. The process involves three primary stages:
1. Self-Supervised Data Construction
For any given query, the model generates two distinct responses:
- Preferred Response ($y'_c$): Generated using both the query and the retrieved context.
- Dispreferred Response ($y_p$): Generated using the query alone, forcing the model to rely on its internal parametric memory.
2. Preference Alignment via DPO
The model is fine-tuned using Direct Preference Optimization (DPO). By contrasting $y'_c$ and $y_p$, the model learns to prioritize external context over its internal "gut feelings." This alignment encourages the model to widen the probability gap between context-grounded and parametric-based tokens.
3. Enhancing Likelihood Displacement (SSFO-$λ$)
Analysis of the DPO gradient flow revealed a phenomenon termed "likelihood displacement," where probability mass is shifted away from parametric tokens. To amplify this effect, the authors introduced a scaling factor ($λ > 1$) in the loss function for the dispreferred response, more aggressively suppressing the tendency to hallucinate from internal memory.
Experimental Evaluation
SSFO was evaluated across a diverse set of benchmarks to test robustness and quality:
- Knowledge Conflicts: MemoTrap and NQ-Swap were used to test if models could overcome internal biases (e.g., common proverbs or swapped entities).
- Response Quality: Performance was measured on NQ-Open, SQuAD, ELI5, and WikiQA.
- Generalization: Cross-lingual transfer was tested on DuReader (Chinese) and XQuAD (Spanish).
- Instruction Following: FollowBench ensured that the alignment process did not degrade the model's general capabilities.
The training utilized a remarkably small dataset of approximately 800 (query, context) pairs sampled from the MS MARCO corpus.
Key Insights and Results
- State-of-the-Art Performance: SSFO-$λ$ outperformed both expensive supervised methods and slow decoding-time strategies. On Mistral-7B, SSFO improved faithfulness by an average of 27%, while Llama-3-8B saw a 12% boost.
- Extreme Data Efficiency: Training on as few as 400–500 self-generated examples captured over 85% of the total performance gain, suggesting that faithfulness is a fundamental principle models can learn rapidly.
- Cross-Lingual Transfer: English-only training improved faithfulness in Spanish and Chinese, indicating that contextual adherence is a language-agnostic reasoning skill.
- Zero Inference Penalty: Unlike decoding-based methods, SSFO produces a standard model that operates at baseline speeds.
Conclusion and Future Work
SSFO demonstrates that models can effectively serve as their own teachers for faithfulness alignment. By leveraging the contrast between context-aware and context-free generation, SSFO achieves high faithfulness with minimal data and no inference overhead. Future research will explore scaling SSFO to long-context scenarios and complex multi-step reasoning tasks where logical errors may supersede simple knowledge conflicts.
Summary updated