When Context Misleads: Intent-Guided Decoding for Robust Retrieval-Augmented Generation
The paper proposes Intent-Guided Decoding (IGD), a framework that dynamically arbitrates between retrieved context and parametric memory based on user intent to significantly improve factual recovery in retrieval-augmented generation while preserving strict context-following behavior.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Large language models are powerful tools that can write stories, answer questions, and solve problems by drawing on the vast amount of information they have memorized during training. However, these models are not perfect; they sometimes forget facts or invent details that sound plausible but are wrong. To fix this, researchers developed a method called retrieval-augmented generation. This approach acts like a librarian for the model: when a question is asked, the system first searches a database of external documents to find relevant evidence, then feeds that evidence to the model along with the question. The hope is that the model will use this fresh information to give a more accurate answer. Yet, this system has a hidden flaw. Sometimes the documents it finds are misleading, outdated, or even deliberately false. If the model blindly trusts these documents, it will repeat their errors. Conversely, if the model ignores the documents entirely, it might miss out on helpful information or fail to answer questions that require specific details from a provided text. The core challenge is knowing when to trust the external evidence and when to rely on the model's own internal knowledge.
A team of researchers from the University of Sydney has proposed a new way to solve this dilemma, called Intent-Guided Decoding. Instead of forcing the model to always trust the documents or always ignore them, their system relies on explicit user instructions to determine the strategy. In some situations, a user might be reading a specific report and wants the model to answer strictly based on what that report says, even if the report contains a mistake. In other situations, a user might be asking a general fact-checking question and wants the model to ignore a misleading document in favor of the truth. The researchers built a framework that adapts to these specific instructions. It works by having the model generate three different potential answers at the same time: one based on the user's original question, one based strictly on the provided documents, and one based solely on its own internal memory. The system then compares these three streams of thought. If the documents and the internal memory disagree, the system checks the user's instructions to decide which path to follow. If the user explicitly asked for strict adherence to the text, the system leans toward the document. If the user explicitly asked for the truth, the system leans toward the internal memory, effectively filtering out the misleading information.
The researchers tested this approach on a wide variety of questions and different types of language models. They created scenarios where the provided documents were correct and scenarios where they were deliberately wrong. In the cases where the documents were misleading, standard systems that blindly followed the text often gave wrong answers. The new system, however, was able to recognize the conflict and switch to its internal knowledge, recovering the correct answer in many instances. On benchmarks where the documents were misleading, the new method improved the accuracy of the answers by as much as 65.4 percentage points compared to the standard approach. Crucially, this improvement did not come at the cost of ignoring helpful information. When the user explicitly asked the model to follow the provided text, the system continued to do so accurately, even when the text was correct. This suggests that the system successfully balances two competing needs: being faithful to the source material when required, and being factually correct when the source material is untrustworthy.
The study also revealed that simply telling a model to "be careful" or "check the facts" is not enough to stop it from being misled by bad documents. The researchers found that models often fail to correct themselves unless there is a specific mechanism in place to weigh the evidence against the user's intent. Their method does not require retraining the model or changing how it searches for information; instead, it acts as a smart filter during the final step of generating an answer. By analyzing how confident the model is in its different potential answers and scaling the influence of the documents based on their reliability, the system can make fine-grained adjustments. For example, if the internal memory is very confident and the document is shaky, the system gently steers the answer toward the truth. If the document is strong and the user wants to follow it, the system lets the document guide the answer. This nuanced approach allows the model to handle complex situations where the right answer depends entirely on what the user is trying to achieve.
Ultimately, the work highlights that the relationship between a language model and its external knowledge is not a simple matter of trust or distrust. It is a dynamic negotiation that depends on the context of the conversation. The researchers demonstrated that by making the model aware of the user's intent, it is possible to create a system that is both reliable and flexible. This means that in the future, these tools could be more useful for tasks ranging from strict legal document analysis, where following the text is paramount, to general knowledge queries, where avoiding misinformation is the priority. The findings suggest that the future of artificial intelligence may lie not just in making models smarter, but in making them better at understanding when to listen and when to speak for themselves.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.