Retrieval-Augmented Generation as Noisy In-Context Learning: A Unified Theory and Risk Bounds

Yang Guo, Yutian Tao, Yifei Ming, Robert D. Nowak, Yingyu Liang
6/3/2025
cs.LGcs.AIcs.CL

No confident code implementation found for this paper.

Abstract

Retrieval-augmented generation (RAG) has seen many empirical successes in recent years by aiding the LLM with external knowledge. However, its theoretical aspect has remained mostly unexplored. In this paper, we propose the first finite-sample generalization bound for RAG in in-context linear regression and derive an exact bias-variance tradeoff. Our framework views the retrieved texts as query-dependent noisy in-context examples and recovers the classical in-context learning (ICL) and standard RAG as the limit cases. Our analysis suggests that an intrinsic ceiling on generalization error exists on RAG as opposed to the ICL. Furthermore, our framework is able to model retrieval both from the training data and from external corpora by introducing uniform and non-uniform RAG noise. In line with our theory, we show the sample efficiency of ICL and RAG empirically with experiments on common QA benchmarks, such as Natural Questions and TriviaQA.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{guo2025retrievalaugmented,
  title  = {Retrieval-Augmented Generation as Noisy In-Context Learning: A Unified Theory and Risk Bounds},
  author = {Yang Guo and Yutian Tao and Yifei Ming and Robert D. Nowak and Yingyu Liang},
  year   = {2025},
  eprint = {2506.03100},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.03100v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.03100.svg)](https://codeofpaper.com/paper/2506.03100)

Discussion