Abstract
Large Language Models (LLMs) frequently prioritize internal pre-trained knowledge over provided context, leading to "faithfulness hallucinations" in tasks like Retrieval-Augmented Generation (RAG). We present CANOE, a post-training framework that leverages synthetic data and a novel reinforcement learning approach, Dual-GRPO, to enforce contextual faithfulness. By training on diverse synthetic tasks—including counterfactual scenarios—and employing a proxy reward system for long-form generation, CANOE allows smaller open-source models (e.g., 7B-14B parameters) to surpass the faithfulness performance of massive state-of-the-art models like GPT-4o and OpenAI o1.
Introduction
A critical requirement for LLMs in production environments is the ability to adhere strictly to user-provided documents, especially when those documents contradict the model's internal knowledge. This "knowledge conflict" often results in the model defaulting to its pre-training data. Paradoxically, as models scale, their increased memorization of facts makes them more prone to these hallucinations. Existing solutions often rely on expensive human-annotated preference data, which is difficult to scale for complex, long-form tasks.
The CANOE Framework
The CANOE framework addresses these challenges through a two-stage process: synthetic data generation and rule-based reinforcement learning.
Synthetic Data Synthesis
To avoid the cost of human labeling, CANOE generates 10,000 short-form Question-Answering (QA) pairs using Wikidata triples. These pairs are embedded into four distinct context types designed to test different facets of faithfulness:
- Straightforward: Direct mapping of facts.
- Reasoning-required: Requires multi-step logic within the context.
- Inconsistent: Contains noisy or irrelevant information.
- Counterfactual: Explicitly contradicts real-world facts (e.g., "The capital of France is London"). This category is vital for breaking the model's reliance on internal priors.
Dual-GRPO Training
Standard reinforcement learning (RL) often suffers from "reward hacking," where models learn to produce short, repetitive answers to maximize accuracy scores at the expense of linguistic quality. CANOE introduces Dual-GRPO (Group Relative Policy Optimization), which requires the model to generate a structured response containing a reasoning process (<think>), a detailed long answer (<long_answer>), and a concise short answer (<short_answer>).
The training is guided by three automated rewards:
- Accuracy Reward: Validates the
<short_answer>against the ground truth. - Proxy Reward: Evaluates the faithfulness of the
<long_answer>by using it as a source document for a secondary LLM-based QA test. If the long-form text contains the information needed to answer the original question, it is deemed faithful. - Format Reward: Ensures adherence to the required XML structure.
Experimental Results
The authors evaluated CANOE across 11 downstream tasks, including RAG benchmarks, summarization, and multilingual datasets.
Performance and Efficiency
CANOE-enhanced models demonstrated significant improvements in faithfulness. For instance, LLaMA-3-8B-Instruct saw a 22.6% increase in average faithfulness scores. Most notably, CANOE allows smaller models to achieve an optimal performance-to-parameter ratio.
As shown in Figure 1, CANOE-Qwen-14B and CANOE-LLaMA-8B outperform proprietary giants like GPT-4o and Claude 3.7 Sonnet on faithfulness benchmarks. This suggests that specialized post-training can compensate for the lack of raw parameter scale in context-dependent tasks.
Robustness and Generalization
Crucially, the "counterfactual" training does not degrade the model's general knowledge; the models retained their performance on closed-book QA tasks. Furthermore, despite being trained solely on English data, the models showed improved faithfulness on Chinese benchmarks, indicating a cross-lingual transfer of the "faithfulness" behavior.
Conclusion
CANOE demonstrates that contextual faithfulness is a learnable behavior that can be instilled via targeted synthetic data and structured reinforcement learning. By decoupling faithfulness from model size, CANOE provides a scalable path for deploying reliable, small-footprint LLMs in knowledge-intensive applications.
Summary updated