A Theory for Token-Level Harmonization in Retrieval-Augmented Generation
On the map: Retrieval-augmented generation → RAG pipeline design and evaluation
Abstract (arXiv)
Retrieval-augmented generation (RAG) utilizes retrieved texts to enhance large language models (LLMs). Studies show that while RAG provides valuable external information (benefit), it may also mislead LLMs (detriment) with noisy or incorrect retrieved texts. Although many existing methods attempt to preserve benefit and avoid detriment, they lack a theoretical explanation for RAG. The benefit and detriment in the next token prediction of RAG remain a black box that cannot be quantified or compared in an explainable manner, so existing methods are data-driven, need additional utility evaluators or post-hoc. This paper takes the first step towards providing a theory to explain and trade off the benefit and detriment in RAG. First, we model RAG as the fusion between distribution of LLMs knowledge and distribution of retrieved texts. Then, we formalize the trade-off between the value of external knowledge (benefit) and its potential risk of misleading LLMs (detriment) in next token prediction of RAG by distribution difference in this fusion. Finally, we prove that the actual effect of RAG on the token, which is the comparison between benefit and detriment, can be predicted without any training or accessing the utility of retrieval. Based on our theory, we propose a practical novel method, Tok-RAG, which achieves collaborative generation between the pure LLM and RAG at token level to preserve benefit and avoid detriment. Experiments in real-world tasks using LLMs such as OPT, LLaMA-2, and Mistral show the effectiveness of our method and support our theoretical findings.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Placed in RAG pipeline design and evaluation, one of 15 directions in Retrieval-augmented generation. Builds on 46 of its 59 references that are in the map. First posted on arXiv 3 Jun 2024.
Builds on
46 of 59 references.
Closest ancestors · 2
Same direction, newest first
- 2024Unsupervised Information Refinement Training of Large Language Models for Retrieval-Augmented Generation28 Feb
- 2024Corrective Retrieval Augmented Generation29 Jan
Other references · 44
- 2017Attention Is All You Needcited by 59,932
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2016Pointer Sentinel Mixture Modelscited by 2,992
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
- 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,800
- 2023FActScore: Fine-grained Atomic Evaluation of Factual Precision in Long Form Text Generationcited by 1,259
- 2022When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memoriescited by 1,103
32 more
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,046
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2023Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generationcited by 795
- 2023REPLUG: Retrieval-Augmented Black-Box Language Modelscited by 786
- 2022Transformers learn in-context by gradient descentcited by 714
- 2023In-Context Retrieval-Augmented Language Modelscited by 694
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2020KILT: a Benchmark for Knowledge Intensive Language Taskscited by 571
- 2019ELI5: Long Form Question Answeringcited by 567
- 2018Wizard of Wikipedia: Knowledge-Powered Conversational agentscited by 530
- 2023Active Retrieval Augmented Generationcited by 506
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2021ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interactioncited by 464
- 2023DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Modelscited by 367
- 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Contextcited by 364
- 2023Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflictscited by 333
- 2024INSIDE: LLMs' Internal States Retain the Power of Hallucination Detectioncited by 317
- 2022Confident Adaptive Language Modelingcited by 297
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
- 2023Investigating the Factual Knowledge Boundary of Large Language Models with Retrieval Augmentationcited by 146
- 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 112
- 2018Mapping Language to Code in Programmatic Contextcited by 104
- 2024Tug-of-War Between Knowledge: Exploring and Resolving Knowledge Conflicts in Retrieval-Augmented Language Modelscited by 93
- 2024Cutting Off the Head Ends the Conflict: A Mechanism for Interpreting and Mitigating Knowledge Conflicts in Language Modelscited by 87
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2020Knowledge-Aware Language Model Pretrainingcited by 52
- 2023Knowledge Card: Filling LLMs' Knowledge Gaps with Plug-in Specialized Language Modelscited by 46
- 2022The Dual Form of Neural Networks Revisited: Connecting Test Time Predictions to Training Patterns via Spotlights of Attentioncited by 45
- 2024Rowen: Adaptive Retrieval-Augmented Generation for Hallucination Mitigation in LLMscited by 27
- 2023RegaVAE: A Retrieval-Augmented Gaussian Mixture Variational Auto-Encoder for Language Modelingcited by 12
- 2024List-aware Reranking-Truncation Joint Model for Search and Retrieval-augmented Generationcited by 7
Built on by
Citing papers per year: 2024: 3; 2025: 2; 2026: 2.
7 papers.
- 2024Retrieval-Augmented Generation with Graphs (GraphRAG)cited by 170
- 2024How Much Can RAG Help the Reasoning of LLM?cited by 31
- 2024Cross-Modal Safety Mechanism Transfer in Large Vision-Language Modelscited by 18
- 2025RLKD: Distilling LLMs' Reasoning via Reinforcement Learningcited by 10
- 2026Predicting Retrieval Utility and Answer Quality in Retrieval-Augmented Generationcited by 2
- 2025Reverse Physician-AI Relationship: Full-process Clinical Diagnosis Driven by a Large Language Modelcited by 1
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Modelscited by 0
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Models9 Feb 2026
- 2026Predicting Retrieval Utility and Answer Quality in Retrieval-Augmented Generation20 Jan 2026
- 2025Reverse Physician-AI Relationship: Full-process Clinical Diagnosis Driven by a Large Language Model14 Aug 2025
- 2025RLKD: Distilling LLMs' Reasoning via Reinforcement Learning22 May 2025
- 2024Retrieval-Augmented Generation with Graphs (GraphRAG)31 Dec 2024
- 2024Cross-Modal Safety Mechanism Transfer in Large Vision-Language Models16 Oct 2024
- 2024How Much Can RAG Help the Reasoning of LLM?3 Oct 2024
Similar, not cited
Close in wording, no citation either way
- 2023Retrieval-Augmented Generation for Large Language Models: A Survey
- 2024Astute RAG: Overcoming Imperfect Retrieval Augmentation and Knowledge Conflicts for Large Language Models
- 2025Retrieval Augmented Generation Evaluation in the Era of Large Language Models: A Comprehensive Survey
- 2025When Retrieval Succeeds and Fails: Rethinking Retrieval-Augmented Generation for LLMs
- 2025Dynamic and Parametric Retrieval-Augmented Generation
- 2024Semantic Tokens in Retrieval Augmented Generation
- 2024Evaluation of Retrieval-Augmented Generation: A Survey
- 2024A Survey on Retrieval-Augmented Text Generation for Large Language Models