TL;DR
OpenDecoder improves Retrieval-Augmented Generation (RAG) by directly injecting explicit document quality scores (such as retriever relevance) into an LLM's internal attention mechanism during decoding. By modulating token-level attention probabilities based on external quality indicators, it makes the model significantly more robust to noisy or irrelevant context, outperforming standard prompting and fine-tuning baselines across multiple question-answering benchmarks.
What Problem Does This Paper Address?
Retrieval-Augmented Generation (RAG) is the go-to framework for grounding Large Language Models (LLMs) in external knowledge and reducing hallucinations. However, RAG systems have a glaring Achilles' heel: retrievers are imperfect. They frequently pull in noisy, distracting, or entirely irrelevant documents.
Standard RAG approaches rely entirely on the LLM's internal attention mechanism and prompt instructions (e.g., "Ignore irrelevant documents") to filter out this noise. The authors point out two major flaws with this:
- Position Bias: LLMs naturally over-attend to information at the very beginning or end of a long prompt, regardless of its actual relevance.
- Implicit Failure: LLMs often struggle to implicitly judge document quality, meaning that bad data easily corrupts the final answer.
OpenDecoder addresses this by asking: Why ignore the explicit relevance scores already calculated by our retrievers and rankers? Instead of hiding these scores, OpenDecoder uses them to directly alter how the LLM processes information at the decoding level.
Methods
OpenDecoder introduces a decoding-level intervention that moves away from pure prompt engineering. Its architecture consists of three core components:
- Quality Indicator Construction: For every retrieved document, the system extracts explicit quality features. The authors experiment with three types:
- Relevance Score ($S^{\text{Ret}}$): The raw similarity score from the initial retriever.
- Ranking Score ($S^{\text{Rank}}$): A semantic similarity logit produced by a secondary LLM-based re-ranker.
- Query Performance Prediction Score ($S^{\text{QPP}}$): A metric estimating query difficulty and potential retrieval noise.
- Attention Modulation: Rather than appending these scores as text in the prompt, OpenDecoder normalizes them and injects them directly into the LLM's internal attention network. The standard attention calculation is modified so that the normalized quality scores ($S_{\text{norm}}$) scale the attention matrix:
$$\theta^{\text{attn}}_{\text{open}} \sim \text{Attn}(Q, K, V, S_{\text{norm}}) = \text{softmax}\left(\frac{S_{\text{norm}} \cdot QK^\top}{\sqrt{d_k}}\right)V$$
This mathematically forces the model to discount tokens originating from low-quality or irrelevant documents.
- Robustness Training: To teach the model how to effectively use these external indicators, the authors implement a robust training pipeline. During training, they intentionally corrupt the top-$k$ context by replacing documents with partially relevant or completely random text and shuffling their positions to break any inherent position bias.
Datasets
The authors evaluated OpenDecoder across five diverse question-answering (QA) benchmarks, using a unified training set merging the training data of NQ and HotpotQA:
- General/Factoid QA: NaturalQuestions (NQ), TriviaQA, and PopQA.
- Multi-Hop QA (Complex Reasoning): HotpotQA and 2WikiMultihopQA.
Key Insights and Ideas
- Math Beats Prompting: Instructing an LLM to ignore noise via text prompts is fragile. Modulating the actual attention weights provides a hard mathematical constraint that prevents irrelevant tokens from dominating the generation phase.
- Task Complexity Dictates Indicator Needs: For straightforward factoid datasets (like NQ or TriviaQA), the retriever's raw relevance score ($S^{\text{Ret}}$) is usually sufficient. However, for complex multi-hop reasoning (like HotpotQA), aggregating multiple indicators (retriever + ranker + QPP) yields the best results, showing that complex reasoning paths require multi-faceted quality signals.
- Parametric Fallback: In extreme cases where all retrieved documents are flagged as low quality, the attention modulation naturally shifts the model's focus back to the query and instruction tokens, forcing the LLM to rely safely on its own internal parametric knowledge rather than hallucinating based on bad context.
Key Results
OpenDecoder was evaluated across three environments: Normal (standard retrieval), Noisy (50% noise injected), and Extreme Noisy (100% irrelevant documents).
- Consistent Superiority: OpenDecoder consistently outperformed vanilla RAG, standard Supervised Fine-Tuning (SFT), and state-of-the-art robustness baselines (like RobustRAG and RbFT) across almost all settings.
- Extreme Noise Resilience: In the Extreme Noisy setting on the NQ dataset, vanilla RAG plummeted to a dismal 3.33 F1 score. OpenDecoder maintained a robust 22.50 F1 score, proving its ability to successfully ignore total noise and fall back on internal knowledge.
- Mitigating Position Bias: By shuffling document order during robustness training and tying attention to explicit external indicators, the model successfully overcame the "lost in the middle" phenomenon common to long-context LLMs.
Limitations and Future Work
- Model Size Constraints: The authors noted that smaller models (e.g., 1.5B parameters) do not consistently benefit from OpenDecoder. Effectively integrating external quality signals with internal reasoning requires a baseline level of model capacity (3B+ parameters in their tests).
- Normalization Sensitivity: Performance is highly sensitive to how the quality scores are normalized (e.g., Max vs. Min-Max normalization). An inappropriate normalization strategy can cause performance drops.
- Future Directions: The authors plan to explore larger backbone models and develop more sophisticated, learnable normalization functions that can dynamically adapt to different datasets and retrieval qualities.
Summary updated