When Context Misleads: Intent-Guided Decoding for Robust Retrieval-Augmented Generation
Organizations: School of Electrical and Computer Engineering The University of Sydney Sydney, NSW, Australia
Abstract
Retrieval-augmented generation (RAG) improves large language models by grounding generation in external evidence, but it also introduces a source trust problem: retrieved context may be useful, irrelevant, or even misleading. Existing RAG systems often apply a fixed trust policy toward retrieved evidence, which can either over-trust incorrect context or underuse context when the user explicitly asks for context-following behavior. Therefore, we propose Intent-Guided Decoding (IGD), a framework that arbitrates between retrieved context and parametric memory according to user intent. IGD uses answer-level filtering and token-level correction to steer the final decoding trajectory between retrieved context and parametric memory. We evaluate IGD on three faithful QA benchmarks and three factual-conflict benchmarks across five LLMs, IGD substantially improves factual recovery, achieving gains of up to 65.4 percentage points on factual-conflict benchmarks over Direct RAG, while preserving or improving strict context-following behavior, this findings highlight the importance of balancing factuality and faithfulness in RAG.
Figures & tables
| Model | Method | IA | Faithful benchmarks | Factual-conflict benchmarks | ||||
| KILT-NQ | TriviaQA | SQuAD | ConflictBank | NQ-Swap | CounterFact | |||
| Qwen3-32B | Closed-book Q-only † | 56.8 | 35.4 | 62.0 | 32.4 | 56.4 | 70.0 | 84.6 |
| Direct RAG | 51.0 | 74.8 | 88.8 | 90.4 | 15.0 | 27.0 | 10.0 | |
| ExplicitSCR | 12.9 | 16.0 | 18.4 | 15.8 | 4.0 | 3.0 | 20.2 | |
| RCR-InternalEval | 62.1 | 58.2 | 74.6 | 47.8 | 47.8 | 70.5 | 73.6 | |
| RCR-ContextEval | 53.6 | 68.8 | 80.0 | 83.2 | 21.0 | 37.0 | 31.4 | |
| Model | Method | IA | Faithful benchmarks | Factual-conflict benchmarks | ||||
| KILT-NQ | TriviaQA | SQuAD | ConflictBank | NQ-Swap | CounterFact | |||
| Qwen3-32B | Direct RAG | 83.0 | 72.6 | 89.4 | 91.0 | 83.2 | 63.0 | 99.0 |
| IGD | 84.3 | 69.4 3.2 | 86.8 2.6 | 90.0 1.0 | 87.2 4.0 | 72.5 9.5 | 99.6 0.6 | |
| Qwen2.5-14B | Direct RAG | 84.2 | 74.6 | 89.2 | 94.0 | 84.4 | 63.0 | 100.0 |
| IGD | 88.1 | 76.4 1.8 | 88.6 0.6 | 93.6 0.4 | 89.2 4.8 | 81.0 18.0 | 100.0 0.0 | |
| Llama-3-8B | Direct RAG | 80.8 | 73.0 | 88.0 | 88.4 | 85.4 | 50.0 | 99.8 |