Abstract
What does it take to let a language model answer from documents it was never trained on, and what does that do to accuracy and security? Retrieval-augmented generation (RAG) searches a document store at question time and conditions the model’s output on what it finds. The research line runs from REALM, dense passage retrieval (DPR), RAG, Fusion-in-Decoder and ColBERT in 2020 to Self-RAG, GraphRAG and search agents. DPR beat BM25 keyword search by 9 to 19 points of top-20 accuracy on four of its five datasets and lost on the fifth.1 Retrieval helps when the right passage is found and used. Failures remain: tested models lost accuracy when the answer sat mid-context,2 four generative search engines fully supported on average about half their sentences with citations,3 and a 2024 evaluation found three commercial legal research tools hallucinating on 17 to 33 percent of all queries under that study’s definition.4 The store is also an attack surface. In a controlled benchmark where the attacker could add text, five planted passages per question among 2.7 million gave a 97 percent attack success rate.5 Retrieved text can carry instructions, and an index with broader permissions than its user acts as a confused deputy.
Two kinds of memory
A language model trained on a large corpus stores what it learned in its weights. Ask a model the capital of France and the answer comes from billions of numbers adjusted during training; there is no file the model looks in. Researchers call this parametric memory. It has three awkward properties. The weights of a released checkpoint stay fixed while it answers questions, so they cannot acquire new knowledge from later material without an update, although at inference the model can still use facts supplied in its context or infer them from information it has. Its knowledge is hard to trace back to individual training documents. And adding knowledge tends to mean adding parameters: the REALM authors at Google describe knowledge as “stored implicitly in the parameters” and note that to “capture more world knowledge, one must train ever-larger networks”.6 The reader on large language models and the transformer covers how that memory is formed and what the context window is.
The alternative is non-parametric memory: a collection of documents held outside the model and searched when a question arrives. The 2020 paper that gave the technique its name describes the combination as a pre-trained sequence-to-sequence model for parametric memory and “a dense vector index of Wikipedia” for non-parametric memory.7 Retrieval-augmented generation is the umbrella term for systems built this way: a retriever finds passages, and a generator conditions its output on them. Conditioning can take several forms. One implementation option is to concatenate the passages with the question in the prompt.8 REALM and the original RAG model instead computed probabilities given each retrieved document separately and summed over documents, weighted by the retriever’s normalised retrieval probabilities: REALM did this for the masked spans it predicted during pre-training, and RAG for the probability of an output sequence (RAG-Sequence) or of each next token (RAG-Token).67
The appeal is concrete. A document store can be updated without retraining. It can hold private material, such as an organisation’s policies, tickets or code, that no public model saw. And because the passages are explicit, the system can show its sources. Each of these benefits has a matching failure mode, and those take up the second half of this reader.
Finding the passages
Sparse retrieval: counting words
For decades, document search meant matching words. BM25, the standard ranking function in this family, scores a passage by the query terms it contains. Repeated occurrences of a term add less and less (term-frequency saturation, set by a parameter k1), rare terms count for more than common ones, and scores are normalised for passage length (set by a parameter b); Lucene’s documentation describes k1 as controlling “non-linear term frequency normalization (saturation)” and b as controlling “to what degree document length normalizes tf values”.9 DPR’s Lucene baseline used k1 = 0.9 and b = 0.4, tuned on development data.1 Each passage is represented as a very long, mostly empty vector with one slot per vocabulary word, hence “sparse”. The dense passage retrieval paper describes the approach as one that “matches keywords efficiently with an inverted index”.1 An inverted index maps each word to the passages containing it, so a query touches only the lists for its own words, which makes BM25 fast and cheap to build.
Its weakness is vocabulary mismatch. The DPR authors give an example: the question “Who is the bad guy in lord of the rings?” should match a passage saying “Sala Baker is best known for portraying the villain Sauron”, but “bad guy” and “villain” share no tokens, so “a term-based system would have difficulty retrieving such a context”.1
Dense retrieval: comparing meanings
Dense retrieval replaces word counts with learned vectors. An encoder network maps a question to a vector of a few hundred numbers, another maps each passage to a vector of the same size, and relevance is the inner product of the two. Training pushes the inner product up for questions and passages that belong together, even when they share no words. The reader on tokenization and embeddings explains how such embeddings are trained and how cosine similarity works; what matters here is how they were made to beat BM25 at retrieval.
The DPR authors summarise the state of play before their work: learning good dense representations was “generally believed” to need many labelled question-passage pairs, and dense methods had not been shown to beat TF-IDF or BM25 for open-domain question answering before ORQA, which relied on an extra pre-training task.1 The paper that showed a simpler route was Dense Passage Retrieval for Open-Domain Question Answering by Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis and colleagues at Facebook AI, the University of Washington and Princeton, first posted on 10 April 2020 and published at EMNLP 2020.1 Its design is deliberately plain:
- Two independent BERT-base encoders, one for questions and one for passages, each producing a 768-dimensional vector taken from the
[CLS]token.1 - Similarity is the inner product of the two vectors. The authors tried alternatives and found that L2 distance performs comparably.
- The training loss is the negative log-likelihood of the correct passage under a softmax over the scores of that passage and a set of wrong ones.
- The knowledge source is the English Wikipedia dump of 20 December 2018, cut into disjoint 100-word blocks: 21,015,324 passages, each prefixed with its article title.
The important trick is where the wrong passages come from. With in-batch negatives, a mini-batch holds B questions, each paired with its correct passage. Multiply the B question vectors by the B passage vectors and you get a B by B matrix of scores; the diagonal holds the labelled pairs, and the off-diagonal passages are treated as training negatives, even though some of them may in fact be relevant to the question without being labelled so. One batch therefore trains on B² pairs for the cost of encoding 2B texts. Separately from that in-batch matrix, the best model added one extra “hard” negative per question: a passage ranked highly by BM25 that does not contain the answer, which pushes the encoder beyond word overlap. The ablations show accuracy rising with batch size, and a retriever trained on only 1,000 questions already outperforming BM25 on the Natural Questions development set.1
The headline result is top-20 retrieval accuracy: the share of test questions for which at least one of the top 20 passages contains the answer. Table 2 of the paper gives these figures for retrievers trained on each dataset separately:1
| Dataset | BM25 top-20 | DPR top-20 | Difference |
|---|---|---|---|
| Natural Questions | 59.1 | 78.4 | +19.3 |
| TriviaQA | 66.9 | 79.4 | +12.5 |
| WebQuestions | 55.0 | 73.2 | +18.2 |
| CuratedTREC | 70.9 | 79.8 | +8.9 |
| SQuAD | 68.8 | 63.2 | −5.6 |
The abstract’s claim of gains of “9%-19% absolute” is accurate for four of the five datasets. On SQuAD, BM25 wins. The authors explain why: SQuAD’s annotators wrote questions while looking at the passage, so the questions share many words with the answers, and the data comes from only about 500 Wikipedia articles.1 The observed result is four wins for the dense retriever and one loss, on the dataset whose questions were written with the answer passage in view; the paper does not break the gains down by how much questions paraphrase their answers. Whether a given corpus behaves more like SQuAD, for example a security knowledge base queried by exact identifiers, error strings, hostnames or CVE numbers, is a question to test on that corpus rather than assume.
The same caution came from a larger study a year later. BEIR, a benchmark of 18 retrieval datasets from different domains published at NeurIPS 2021, evaluated ten retrieval systems without training on the target domain. Its authors found “BM25 is a robust baseline”, with re-ranking and late-interaction models best on average in that zero-shot setting and dense retrievers often underperforming on domains they were not trained for.10 Running keyword and vector search side by side is one way to hedge against that, and its value on a particular corpus can be measured.
Searching millions of vectors
Comparing a query vector against 21 million passage vectors one at a time is slow. Systems instead use approximate nearest-neighbour search, which returns most of the true closest vectors much faster and accepts that it will sometimes miss one. The quality measure is recall: the fraction of the true K nearest neighbours that the search actually found.11
One index structure, implemented for example in Facebook’s FAISS library and in Microsoft’s Azure AI Search, is HNSW, Hierarchical Navigable Small World graphs, described by Yury Malkov and Dmitry Yashunin (first posted 30 March 2016). Every stored vector becomes a node linked to some of its near neighbours. The graph has several layers: each vector is assigned a top layer at random, with the probability falling off exponentially for higher layers, so the upper layers are sparse and hold long-range links while the bottom layer holds everyone. A search starts at the top, greedily walks towards the query, drops a layer, and repeats. The authors report that this allows “logarithmic complexity scaling” under the assumptions of their analysis.11 Several parameters set the trade-off. M is the number of new connections made when an element is inserted. Mmax caps how many links a node may keep in the upper layers, and a separate cap, Mmax0, applies in the bottom layer. efConstruction is the size of the candidate list used while building, and ef the size of the candidate list kept while searching. A larger search-time ef examines more candidates and holds a larger working list of them during the query, which tends to find more of the true neighbours at the cost of more work per query; denser graphs cost more memory.11
DPR used exactly this, through Facebook’s FAISS library with an HNSW index of 512 neighbours per node, construction depth 200 and search depth 128. On the authors’ server (an Intel Xeon E5-2698 v4 with 512GB of memory), the in-memory FAISS index answered 995 questions per second, returning 100 passages each, while BM25 in Lucene, implemented in Java with a file-based index, handled 23.7 questions per second per CPU thread. In that setup the cost moved to indexing: embedding 21 million passages took about 8.8 hours on 8 GPUs and building the FAISS index another 8.5 hours on a single server, against about 30 minutes for the Lucene inverted index.1 The approximate step also interacts with filtering. Microsoft’s documentation for the vector search in Azure AI Search, which uses HNSW, explains that when a filter is applied after the nearest-neighbour search rather than during it, “some matching documents that are less similar than the top-k unfiltered documents never appear in the search results”, and that this mode “can return fewer than k results”.12
Teaching the model to use what it finds
REALM: retrieval inside pre-training
Learning a retriever jointly with a reader was not new in 2020. ORQA, by Kenton Lee, Ming-Wei Chang and Kristina Toutanova (ACL 2019), had learned both “from question-answer string pairs and without any IR system”, treating evidence retrieval from all of Wikipedia as a latent variable, after pre-training the retriever with an Inverse Cloze Task.13 REALM (Retrieval-Augmented Language Model Pre-Training), by Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat and Ming-Wei Chang at Google Research, posted on 10 February 2020, moved the joint learning into masked-language-model pre-training over a large unlabelled corpus.6 Its question was whether a retriever could learn what is worth retrieving from unlabelled text alone.
REALM uses masked language modelling, the BERT objective: hide some words in a sentence and predict them. Before predicting, the model retrieves documents from Wikipedia and conditions on them. The retriever is never told which document is correct. It is rewarded through the prediction itself: the probability of the masked span is computed as a sum over the retrieved documents, each weighted by its normalised retrieval probability. The paper’s analysis of the gradient shows that a document’s relevance score is pushed up when conditioning on that document makes the correct prediction more likely than the model’s current marginal prediction, and pushed down otherwise. The abstract describes this as “backpropagating through a retrieval step that considers millions of documents”.6
The paper’s own example shows the effect. For the sentence “An equilateral triangle is easily constructed using a straightedge and compass, because 3 is a ___ prime”, BERT without retrieval assigns the answer “Fermat” a probability of 1.1 × 10⁻¹⁴. REALM retrieves a passage stating that 257 is a Fermat prime and that a 257-sided regular polygon is constructible, and the marginal probability of “Fermat” over its top eight documents rises to 0.129.6
Three engineering choices made it work. Because the document encoder changes during training, the stored document vectors go stale; REALM re-embeds the corpus and rebuilds the search index asynchronously, about once every 500 training steps, and the authors show that a staler index hurts. Salient span masking hides named entities and dates rather than random words, so that the masked tokens actually need world knowledge. And a null document is always among the candidates, giving the model somewhere to put its weight when no retrieval is needed.6
Fine-tuned for open-domain question answering, REALM with 330 million parameters scored 40.4, 40.7 and 42.9 exact match on Natural Questions, WebQuestions and CuratedTREC when pre-trained on news text (CC-News), and 39.2, 40.2 and 46.8 when pre-trained on Wikipedia. T5 with 11.3 billion parameters and no retrieval scored 34.5 and 37.4 on the first two, with about 34 times REALM’s parameter count.6
RAG: the name and the two variants
Three months later, on 22 May 2020, Patrick Lewis and eleven colleagues from Facebook AI Research, University College London and New York University posted Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, published at NeurIPS 2020.7 It joined a DPR retriever to BART-large, a pre-trained sequence-to-sequence generator with 400 million parameters, over the same 21 million 100-word Wikipedia passages from December 2018, indexed with FAISS and HNSW. Where DPR’s reader extracted an answer span, RAG writes the answer.
The paper treats the retrieved document as a hidden variable and defines two ways to sum over it:
- RAG-Sequence uses the same retrieved document for the whole answer. The model generates a complete answer conditioned on each of the top K documents, and the final probability of an answer is the retriever-weighted sum across documents.
- RAG-Token may draw on a different document for each token. At each step of generation, the next-token distribution is a retriever-weighted mixture over all K documents, so one answer can stitch together facts from several passages.
Training used K of 5 or 10. One simplification set a pattern for later systems: updating the document encoder would require periodically re-indexing the corpus, as REALM did, and the authors found this unnecessary, so they kept the document encoder and index fixed and fine-tuned only the query encoder and the generator.7
Results on open-domain question answering (exact match):
| Model | Natural Questions | WebQuestions | CuratedTREC |
|---|---|---|---|
| T5-11B, closed book | 34.5 | 37.4 | – |
| REALM (best of its two pre-training corpora) | 40.4 | 40.7 | 46.8 |
| DPR (retriever plus extractive reader) | 41.5 | 41.1 | 50.6 |
| RAG-Token | 44.1 | 45.5 | 50.0 |
| RAG-Sequence | 44.5 | 45.2 | 52.2 |
RAG’s REALM row combines REALM’s best result on each dataset across its two pre-training conditions. Because it generates rather than extracts, RAG could also answer correctly in 11.8 percent of the Natural Questions cases where no retrieved passage contained the answer string, where an extractive model would score zero.7 The authors describe clues in documents that do not contain the answer verbatim as a possible advantage of generation, then report the 11.8 percent; they did not determine why those particular answers were correct. Such clues and recall from parametric memory are both possibilities, and nothing in the output tells a reader which happened.
Two further experiments became the standard arguments for RAG. In a human evaluation of Jeopardy-style question generation over 452 pairs, evaluators judged BART more factual than RAG-Token in 7.1 percent of cases and RAG more factual in 42.7 percent. (The paper’s prose says both were factual in a further 17 percent, but its Table 4 gives 11.7 percent “both good” and 17.7 percent “both poor”.) And in an “index hot-swapping” test, the authors built a second index from a December 2016 Wikipedia dump and asked about 82 world leaders who had changed between 2016 and 2018. With the index matching the year, RAG answered 70 percent (2016) and 68 percent (2018) correctly; with mismatched indices, accuracy fell to 12 and 4 percent.7 In that setup, replacing the index changed the answers without touching a single weight. Read from the other side, the experiment shows that the contents of the index can determine what the model says.
Fusion-in-Decoder: read many, combine late
Gautier Izacard and Edouard Grave of Facebook AI Research and Inria asked how far the reader could be pushed by giving it more passages. Their paper, Leveraging Passage Retrieval with Generative Models for Open Domain Question Answering (posted 2 July 2020), introduced what they named Fusion-in-Decoder.14 A T5 encoder processes each retrieved passage separately, concatenated with the question; the decoder then attends over all the encoded passages at once. Because self-attention in the encoder runs over one passage at a time, the encoder’s computation grows linearly with the number of passages at a fixed passage length, rather than quadratically as it would for one long concatenation. That made 100 passages of 250 word pieces each practical.
Fusion-in-Decoder’s large model (770 million parameters) reached 51.4 exact match on Natural Questions and 67.6 on TriviaQA, well above RAG’s 44.5 and 56.1 as reported in the same table. Going from 10 to 100 passages added about 6 points on TriviaQA and 3.5 on Natural Questions, while, the authors note, extractive models tended to peak at 10 to 20 passages.14 They also made a point about memory: the closed-book T5 with 11 billion parameters scored 36.6 on Natural Questions, while their 770-million-parameter model with BM25 retrieval over Wikipedia scored 44.1, with both methods using, in their words, “roughly the same amount of memory to store information”.14
ColBERT: keep one vector per token
A single vector per passage throws away detail. BERT re-rankers of the kind ColBERT compared against read the query and passage together through the whole network; because each joint encoding depends on the query, it has to be computed for every candidate at query time and cannot be prepared in advance.15 Omar Khattab and Matei Zaharia of Stanford proposed a middle path in ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT (posted 27 April 2020, SIGIR 2020).15
ColBERT encodes the query and the passage separately, like a dual encoder, but keeps one 128-dimensional vector per token instead of pooling them. The score is computed by late interaction: for each query token vector, find its maximum similarity with any passage token vector, and sum those maxima. The authors call this the MaxSim operator. Passage token vectors can be computed offline; only the query is encoded at search time.
On the MS MARCO passage ranking task, re-ranking BM25’s top 1,000 results, ColBERT reached an MRR@10 of 34.9 with 61 milliseconds of re-ranking latency, against 34.7 for the published BERT-base re-ranker at 10,700 milliseconds. The paper summarises this as over 170 times faster with 14,000 times fewer FLOPs per query. Used for end-to-end retrieval over the 8.8 million passages, ColBERT reached 36.0 MRR@10 and 96.8% Recall@1000 over judged relevant passages, against 85.7 percent Recall@1000 for BM25; MS MARCO queries carry sparse relevance judgements, often with just one passage marked relevant.15 The cost is storage, a vector for every token of every passage. The paper’s Table 4 gives 154 GiB for the 128-dimensional end-to-end configuration at two bytes per dimension and 286 GiB for the 128-dimensional re-ranking configuration at four bytes; the smallest footprint, 27 GiB, came from cutting vectors to 24 dimensions at two bytes each, at an MRR@10 of 33.9.15
HyDE: search with a fake answer
Questions and answers look different. A question is short and interrogative; the passage that answers it is declarative and longer. Luyu Gao, Xueguang Ma, Jimmy Lin and Jamie Callan of Carnegie Mellon and Waterloo proposed bridging the gap without any relevance labels in Precise Zero-Shot Dense Retrieval without Relevance Labels (posted 20 December 2022), naming the method Hypothetical Document Embeddings, HyDE.16
HyDE asks an instruction-following model (InstructGPT, text-davinci-003) to write a passage that answers the question, embeds that passage with an unsupervised encoder (Contriever), and ranks real documents by the inner product of their embeddings with that vector. The generated passage, in the abstract’s words, “is unreal and may contain false details”. The authors’ hypothesis is that the encoder’s “dense bottleneck” filters out those details while keeping the shape of a relevant answer. In their formulation the search vector averages the embeddings of several sampled hypothetical documents (equations 6 and 7), and a variant includes the query’s own embedding as one more hypothesis (equation 8).16 On the TREC Deep Learning 2019 web search set, the retrieval metric nDCG@10 rose from 44.5 for Contriever alone to 61.3 with HyDE, above BM25’s 50.6 and close to the 62.1 of Contriever fine-tuned on MS MARCO labels. On the 2020 set the figures were 42.1, 57.9 and 48.0 for BM25.16
The cost is a model call before every search, and the model’s own beliefs now help steer what is retrieved. If a hypothetical answer is wrong in a way that resembles a wrong document, that document may rank higher than it otherwise would.
The practical pipeline
The research systems above mostly used fixed 100-word Wikipedia passages. Real deployments start from PDFs, wiki pages, tickets and code, and add stages around the retriever. A survey by Yunfan Gao and colleagues at Tongji and Fudan universities (first posted 18 December 2023) divides the field into “Naive RAG”, “Advanced RAG” and “Modular RAG”.8 The naive pipeline is index, retrieve, generate: clean and convert documents to text, split them into chunks, embed and store them, then at query time embed the question, take the top K chunks by similarity and put them in the prompt.
The advanced stages address the naive pipeline’s failures:
- Chunking. The survey notes the common practice of splitting on a fixed number of tokens, such as 100, 256 or 512, and the trade-off: larger chunks carry more context and more noise, smaller ones less noise and may lose meaning. Variants include sliding windows and “Small2Big”, where single sentences are the retrieval unit and the surrounding sentences are returned as context.8
- Metadata. The survey describes enriching chunks with page number, file name, author, timestamps and similar fields, which allows filtering.8
- Query rewriting and expansion, which the survey treats as query optimisation and which includes HyDE-style hypothetical documents.8
- Reranking. A first-stage retriever returns a generous candidate list cheaply; a slower model then reorders it. The survey lists cross-encoders, specialised reranking models and general LLMs for this job.8 Whether a second stage improves a given system is something to measure there.
A query through the pipeline
Take an internal assistant over a company’s security wiki, ticket system and policy documents, and the question: “After a contractor leaves, how quickly must we rotate the service-account keys they had access to?” The documents below are invented for illustration.
- Rewrite. The system expands “contractor leaves” with terms used in the policies, such as “offboarding” and “third-party personnel”, and may generate a hypothetical answer for dense search.
- Hybrid retrieval. BM25 finds chunks containing “service account” and “rotate”; the dense index finds a chunk headed “Credential hygiene for departing third parties” that never uses the word “contractor”. Each returns 50 candidates.
- Permission filter. Each chunk carries the access list of its source document. The filter keeps only chunks the asking user may read. A chunk from an incident report restricted to the security team is dropped here, before any model sees it.
- Rerank. A cross-encoder scores the remaining candidates against the original question. The policy chunk stating “within 24 hours of the offboarding ticket closing” rises to the top; a two-year-old wiki page saying “within 7 days” ranks third.
- Assemble. The top five chunks go into the prompt, each wrapped in delimiters, labelled with its source and date, with an instruction to answer only from them and cite each claim.
- Generate and check. The model answers “within 24 hours”, cites the policy, and notes that an older page says 7 days. A first automated check confirms that the cited chunk contains the cited figure. A second, sampled check asks whether the chunk actually supports the claim and whether the rule applies: that the policy covers contractors as well as employees, and that it is the current version.
Each step is a place where the answer can go wrong. If chunking split the policy so that “within 24 hours” landed in a different chunk from “service-account keys”, neither half ranks well. If the stale wiki page had been placed in the middle of a long context and the policy at the end, the model’s choice would depend partly on position. If the filter ran after the reranker took its top five, the user might get fewer than five chunks, or, in a careless implementation, the restricted chunk itself. And if someone with write access to the wiki had added a misleading page written to match questions about contractor offboarding, it could rank among the candidates and reach the model.
Letting the model decide
Self-RAG: retrieval on demand, with self-critique
The RAG baselines in the Self-RAG paper retrieve a fixed number of passages for every query, whether or not they help, and have no built-in check on whether their output is supported by them. Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil and Hannaneh Hajishirzi (University of Washington, Allen Institute for AI and IBM) addressed both in Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection, posted 17 October 2023.17
Self-RAG adds special reflection tokens to the model’s vocabulary and trains the model to emit them:
| Token | Question it answers | Values |
|---|---|---|
| Retrieve | Should I retrieve now? | yes, no, continue |
| IsRel | Is this passage relevant to the input? | relevant, irrelevant |
| IsSup | Is my output supported by the passage? | fully, partially, no support |
| IsUse | Is my output useful? | 5 to 1 |
The training data came from a critic model: the authors prompted GPT-4 to label examples with reflection tokens, distilled that into a Llama 2 7B critic, and used the critic to annotate 150,000 instruction-output pairs offline. They then trained Llama 2 7B and 13B generators on the annotated data. Appendix A.1 reports a check of GPT-4’s labels against the authors’ own manual assessments on 20 sampled items per category: agreement was 95 percent for relevance, 95 percent for retrieval necessity, 90 percent for support and 80 percent for usefulness. At inference, the model decides when to retrieve, generates candidate continuations for each passage, and ranks them using the probabilities of its own critique tokens.17
The result most relevant to practitioners is on citations. On the ASQA long-form question set, Self-RAG 13B reached citation precision of 70.3, against 65.1 for retrieval-augmented ChatGPT, and the same table gives one baseline, Llama 2 7B with retrieval, a citation precision of 2.9.17 The authors also sampled correct answers on PopQA and TriviaQA and checked whether the answer string appeared in the retrieved passages: it was absent for 2 percent of Self-RAG’s correct answers against 15 to 20 percent for the instruction-tuned baselines.17 That test is consistent with the baselines answering from memory more often, though string presence does not prove which source a model used. The critic is trained on GPT-4’s judgements of relevance and support, so it may inherit GPT-4’s biases, and its labels are model-based judgements rather than independent verification.
GraphRAG: questions about the whole corpus
Top-K retrieval suits questions whose answer lives in a few passages. It is a poor match for questions such as “What are the main themes in this collection?”, whose answer is spread across the corpus. Darren Edge, Ha Trinh and colleagues at Microsoft posted From Local to Global: A Graph RAG Approach to Query-Focused Summarization on 24 April 2024 (revised 19 February 2025).18
GraphRAG spends heavily at indexing time. An LLM reads every chunk and extracts entities and relationships, building a knowledge graph. The Leiden algorithm partitions the graph into a hierarchy of communities of closely related entities, and the LLM writes a summary of each community at each level. At query time, the community summaries at the chosen level are shuffled and grouped into chunks of fixed token size, and each chunk yields a partial answer with a helpfulness score from 0 to 100. Partial answers scored 0 are discarded; the rest are sorted by score and added to a final context until a token limit is reached, from which the global answer is written. It is a map-reduce over the corpus.18
The evaluation used two corpora: podcast transcripts of about 1 million tokens, and a news corpus of about 1.7 million tokens covering articles published from September 2013 to December 2023. It used GPT-4-turbo and judged answers by having an LLM compare pairs on comprehensiveness, diversity and empowerment, with directness as a control. Results are pairwise win scores on a 0 to 100 scale, with a win scored 100, a loss 0 and a tie 50, averaged over questions and runs (Table 6). Against conventional vector RAG, the four GraphRAG conditions had win scores of 72 to 79 on comprehensiveness on both the podcasts and the news set, and 75 to 81 and 62 to 71 on diversity; vector RAG gave the most direct answers throughout. The comparison that isolates the graph is with a graph-free baseline that applies the same map-reduce directly to the source text. That baseline had a win score of 83 against vector RAG on podcast comprehensiveness, higher than any graph condition, and 80 on news. Head to head, the intermediate and low-level graph conditions beat it modestly (comprehensiveness win scores of 57 on podcasts and 64 on news), while root-level summaries were roughly level with it but needed over 97 percent fewer context tokens.18 The caveats are in the paper: only two corpora, judgements made by an LLM, and, the authors write, a comparison of “fabrication rates” would “strengthen the current analysis”.18 In the reported setup, graph indexing of the podcast set took 281 minutes of elapsed time on a virtual machine calling a GPT-4-turbo endpoint, and every community summary is model-written text that later answers treat as source material.18
Agentic retrieval
A newer direction hands the retrieval loop to the model. Instead of one search followed by one answer, an agent plans, issues a search, reads the results, decides whether they suffice, reformulates and searches again, possibly across several tools and stores. A survey by Aditi Singh, Abul Ehtesham, Saket Kumar, Tala Talaei Khoei and Athanasios Vasilakos (first posted 15 January 2025, revised 1 April 2026) describes agents that use the “agentic design patterns reflection, planning, tool use, and multi-agent collaboration” to manage retrieval, and organises architectures by “agent cardinality, control structure, autonomy, and knowledge representation”, from single-agent routers to multi-agent and graph-based systems.19
What agentic retrieval changes for security is scope. In a single-call pipeline like the worked example above, retrieved text reaches the model once and the output is an answer. Where an application lets the model issue further searches, call tools or write to memory, retrieved text can also influence those actions. Greshake and colleagues demonstrated retrieved prompts that could “control how and if other APIs are called” in LLM-integrated applications; how far that reaches in a given system depends on which capabilities the application grants.20
When retrieval helps, and when it moves the failure
Retrieval misses
If the right passage is not retrieved, the generator cannot read it. DPR’s top-20 accuracy, which measures whether the answer string appears in any of the top 20 passages, was 78.4 on Natural Questions, so for roughly one test question in five no top-20 passage contained the answer string.1 The generator then can say it does not know, answer from parametric memory, or build an answer from irrelevant passages. Where a product promises answers grounded in its sources, declining is the appropriate behaviour when the retrieved evidence is insufficient. RAG still answered correctly in 11.8 percent of the Natural Questions cases where no retrieved passage contained the answer string, which shows that such models do produce answers in that situation.7 An answer delivered in a retrieval interface looks grounded whether or not it is.
Position effects: lost in the middle
Putting the right passage in the context is not enough. Nelson Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni and Percy Liang tested this directly in Lost in the Middle: How Language Models Use Long Contexts (posted 6 July 2023, published in TACL volume 12 in 2024).2 They took 2,655 Natural Questions queries, gave each model one passage containing the answer and a set of distractor passages retrieved for the same question, and placed the answer-bearing passage at selected positions in contexts of 10, 20 and 30 documents.
Accuracy formed a U-shape: highest when the relevant passage came first or last, lowest in the middle. With 20 documents, GPT-3.5-Turbo scored 75.8 percent with the answer first, 53.8 percent with it tenth and 63.2 percent with it last, a fall of 22 percentage points from first to tenth. The 53.8 percent is below that model’s closed-book accuracy of 56.1 percent, the score it achieved with no documents at all. With 30 documents, reported only for the 16K-context variant of GPT-3.5-Turbo, the lowest score was 50.5 percent, against that variant’s closed-book 56.0 percent.2 In a separate retrieval study, distinct from the position experiment, using 50 retrieved documents instead of 20 improved accuracy by only about 1.5 percentage points for GPT-3.5-Turbo and about 1 percentage point for Claude 1.3, although retriever recall kept rising. Where the same input fit both, extended-context versions of a model performed much like the shorter-context versions.2 These are 2023 models and later ones may behave differently, so ordering and context length are worth testing on the model actually deployed.
Conflicts between context and memory
When a retrieved passage contradicts what the model learned in training, which wins? Jian Xie, Kai Zhang, Jiangjie Chen, Renze Lou and Yu Su studied this in Adaptive Chameleon or Stubborn Sloth, presented at ICLR 2024.21 They first elicited each model’s own belief about a question, then constructed “counter-memory” evidence contradicting it. The findings point in two directions. Models “can be highly receptive to external evidence even when that conflicts with their parametric memory, given that the external evidence is coherent and convincing”. But they also “demonstrate a strong confirmation bias” when the evidence offered includes some material agreeing with what they already believe.21
Both halves matter. In these experiments the tested models sometimes adopted coherent counter-memory, which is what makes RAG useful for updating knowledge and also what poisoning relies on. And when given conflicting evidence, they showed confirmation bias towards the side that matched their prior, which is a reason to be wary of mixing stale and current versions of a document in one context.
Citations that do not support the claim
A citation is only useful if the cited source says what the answer claims. Nelson Liu, Tianyi Zhang and Percy Liang audited four generative search engines (Bing Chat, NeevaAI, perplexity.ai and YouChat) in Evaluating Verifiability in Generative Search Engines (posted 19 April 2023, Findings of EMNLP 2023).3 Human annotators checked every sentence and citation. On average, “a mere 51.5% of generated sentences are fully supported by citations” and “only 74.5% of citations support their associated sentence”. Across the four engines, citation precision was inversely correlated with perceived utility (r = −0.96): the engines whose answers seemed more helpful tended to have less accurate citations.3
The ALCE benchmark from Tianyu Gao, Howard Yen, Jiatong Yu and Danqi Chen at Princeton (EMNLP 2023) automated this kind of check, using a natural-language-inference model to judge whether the cited passages entail each statement, and found that on the ELI5 dataset “even the best models lack complete citation support 50% of the time”.22 Entailment by the cited text is one property. Whether the statement is true, and whether the cited source is the one that governs the question, are separate properties that such a metric does not measure.
Legal research is a domain where vendors made explicit promises. Varun Magesh, Faiz Surani, Matthew Dahl, Mirac Suzgun, Christopher Manning and Daniel Ho at Stanford ran a preregistered evaluation of three commercial legal research tools built on RAG, Lexis+ AI, Westlaw AI-Assisted Research and Ask Practical Law AI, posted on 30 May 2024.4 They quote LexisNexis marketing that its tool “delivers 100% hallucination-free linked legal citations”. The study counts a response as hallucinated if it is incorrect or misgrounded, meaning that it cites a source that does not support the claim or that is inapplicable to the question. Across 202 queries, the tools’ hallucination rates as a percentage of all queries were lower than that of GPT-4, a general-purpose product tested on the same queries, yet each tool hallucinated “between 17% and 33% of the time” by that definition. The study’s Figure 4 also gives rates among direct responses only, and notes that Westlaw AI-Assisted Research and Ask Practical Law AI respond to fewer queries than GPT-4 but that the responses they do produce “are not significantly more trustworthy”.4 The comparison is between different products and does not isolate the effect of retrieval itself. The authors note a terminological point that matters for anyone assessing a RAG product: in the machine-learning literature “grounded” usually means faithful to the retrieved documents, whatever those are, while a user needs answers grounded in the documents that actually govern the question.
What the evidence supports
Put together, the papers support bounded claims. In specific comparisons, retrieval-augmented systems did better: human raters preferred RAG-Token’s Jeopardy questions over BART’s on factuality, and the index swap changed answers to match the index.7 Self-RAG beat the specific comparison systems in its Table 2 on the tasks reported, though its generator training differs from theirs, so that comparison does not isolate the effect of adding retrieval.17 In other measured settings, systems with retrieval still answered without supporting passages,7 lost accuracy when the answer sat mid-context,2 leaned towards their priors under conflicting evidence,21 and cited sources that did not support their claims.34 Retrieval adds the retriever and the document store to the list of places where an answer can go wrong, and that is where the security problems start.
The document store as an attack surface
Knowledge poisoning: PoisonedRAG
If a RAG system tends to adopt coherent passages, an attacker who can add passages may be able to steer its answers. Wei Zou, Runpeng Geng, Binghui Wang and Jinyuan Jia measured how few are needed in PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models, first posted on 12 February 2024 and accepted at USENIX Security 2025.5
The threat model assumes the attacker can add text to the knowledge base but cannot change the retriever, the model or the system prompt. The attacker picks a target question and a target answer and writes a few passages. Each must satisfy two conditions: the retrieval condition, that it ranks in the top K for the target question, and the generation condition, that once retrieved it leads the model to produce the target answer. The paper studies a black-box setting, where the attacker knows nothing about the retriever, and a white-box setting, where it does.5
The default setup used the Natural Questions knowledge base of 2,681,468 passages, the Contriever retriever returning the top five passages, and PaLM 2 as the generator. Targets were close-ended factual questions: ten per dataset in each of ten trials, 100 in all. Injecting five passages per question gave the following attack success rates (the fraction of target questions answered with the attacker’s answer) in the black-box setting (Table 1):
| Knowledge base | Size (passages) | PaLM 2 | GPT-4 | Llama 2 7B |
|---|---|---|---|---|
| Natural Questions | 2,681,468 | 0.97 | 0.97 | 0.97 |
| HotpotQA | 5,233,329 | 0.99 | 0.93 | 0.98 |
| MS MARCO | 8,841,823 | 0.91 | 0.92 | 0.96 |
Five baseline attacks adapted from earlier work stayed below 70 percent on Natural Questions. The attack also worked against more advanced pipelines: against Self-RAG and CRAG on Natural Questions it still reached 0.77 and 0.78. On a store of the full 21,015,324-passage Wikipedia dump it reached 0.95.5 The authors also sampled 1,000 non-target Natural Questions queries. In the black-box setting, the malicious passages appeared in the retrieved results for 0.3 percent of them, and the measured effect on generated answers was 0 percent.5
These are controlled benchmark results on selected questions with assumed write access. Whether an attacker can add text to a real store depends on what the application ingests: a public web index, a shared wiki, a ticketing system that takes customer email or a repository that accepts outside contributions would each offer a route if they are indexed.
Indirect prompt injection
PoisonedRAG plants false facts. A related attack plants instructions. Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz and Mario Fritz named this indirect prompt injection in a paper posted on 23 February 2023: adversaries can exploit LLM-integrated applications “by strategically injecting prompts into data likely to be retrieved”.20 They demonstrated it against Bing’s GPT-4-powered chat and code-completion tools, and argued that such applications “blur the line between data and instructions”.20 In a RAG system the user’s question, the retrieved passages and the outputs of any tools the model may call all arrive as text in one context, although only the first comes from the user. The library’s article The confused deputy at scale: prompt injection and the agent attack surface covers the attack and its defences in depth, and MITRE ATLAS: what the AI attack matrix knows, and how it knows it discusses case studies in which poisoned retrieval results and retrieval-triggered injection appear as attack steps.
For RAG the point is that retrieval chooses which untrusted text reaches the model, and it chooses by relevance to the question. Text that is relevant to common questions is more likely to be retrieved, though neither study shows that relevance guarantees retrieval or that a retrieved injection will be obeyed.
The confused deputy: permissions at retrieval time
In 1988 Norm Hardy published what he called “a nearly true story (inessential details have been changed)” about a compiler at Tymshare that had been given permission to write files in its own directory so that it could record usage statistics. A user named the billing file as the destination for debugging output, and the compiler, using its own permission on the user’s behalf, overwrote it. Hardy’s analysis is that the code was correct until the extra authority was added: “it became wrong when we added home files license”.23 A program that holds authority on behalf of several parties, and acts on requests from one of them, can be tricked into using authority that party does not have.
An enterprise RAG assistant can be a deputy in exactly this sense. If its ingestion job has broad read access, so that it can index a whole wiki, file share or mailbox, and the index does not record who may read each chunk or the query path does not enforce it, then disclosure becomes possible: restricted content can reach an answer, or another component outside the caller’s authorisation boundary, for a user who could not open the source documents. Whether a particular question retrieves or reveals restricted text is not guaranteed, and indirect prompt injection adds a further route, because a planted instruction can ask the model to repeat retrieved context into an answer.
The remedy is to authorise each request against the identity of the person asking, before retrieved content or anything derived from it leaves the boundary that person is entitled to see. Microsoft’s documentation for its search service, updated on 23 November 2026, illustrates both the method and the trap. Besides built-in access-control-list support, the service documents a “security filter pattern” for applications that cannot use it. The pattern stores a list of group identifiers on each indexed document and applies a filter on every query so that only documents matching the caller’s groups are returned. The page warns that “There’s no authentication or authorization through the security principal. The principal is just a string”, and that the application “must authenticate users, obtain trusted principal and grant values, apply filters to every query, and prevent bypasses”.24 Three design points follow, the last two as architectural guidance rather than findings from the cited sources. The access list has to come from the source system at ingestion and be kept in sync when permissions change. Unauthorised content should be removed before it reaches any less-trusted component or recipient, such as an external reranker, model or cache. Filtering inside the search can improve recall and isolation, but documented postfiltering also satisfies that rule as long as unfiltered candidates stay inside the trusted boundary; where the filter runs is then a trade-off. Microsoft’s vector-filter documentation describes a workload-dependent choice among prefiltering, per-shard postfiltering and global strict postfiltering: postfiltering can lose authorised matches, while prefiltering can raise CPU use and latency for highly selective filters.12 And material derived from restricted documents, such as summaries, GraphRAG community reports and cached answers, needs a policy that stops it reaching people who could not read the sources, which is easy to forget because the derived text has no obvious owner.
The OWASP Top 10 for LLM applications lists this among its 2025 risks as “LLM08:2025 Vector and Embedding Weaknesses”, recommending “permission-aware vector and embedding stores” and “strict logical and access partitioning of datasets in the vector database”, and describing a scenario in which, in a multi-tenant vector database, one group’s embeddings are retrieved for another group’s queries.25
Leakage from the vectors themselves
Embeddings are sometimes treated as a one-way hash of text, but they can be inverted. John Morris, Volodymyr Kuleshov, Vitaly Shmatikov and Alexander Rush showed in Text Embeddings Reveal (Almost) As Much As Text (EMNLP 2023) that a model which iteratively guesses text, re-embeds the guess and corrects it, a method they call Vec2Text, can “recover 92% of 32-token text inputs exactly”, an in-domain result on Wikipedia passages embedded with the GTR-base encoder. In a case study on MIMIC-III clinical notes, using a version in which fake names had been inserted in place of the de-identified ones, with notes truncated to 32 tokens and filtered to contain at least one name, it recovered 89.2 percent of full names.26 The threat model assumes the attacker can query the same embedding model, once per refinement step, and the results are for short texts. Within those limits, a vector store built from sensitive documents should be treated as a copy of sensitive data, with the same access controls, encryption and retention rules as the documents.
Defences and their limits
The defences tested so far are partial.
- Paraphrasing the query before retrieval reduced PoisonedRAG’s success on Natural Questions only from 0.97 to 0.87 in the black-box setting.5
- Perplexity filtering, flagging passages that look statistically unnatural, discriminated poorly between malicious and clean passages in the study; the authors suggest this is because the attack text is generated by a capable model and reads normally.5
- Removing duplicate passages made no difference, because each malicious passage was generated separately.5
- Retrieving more passages so that five poisoned ones are outnumbered helped but did not suffice: with 50 passages retrieved on HotpotQA, the attack still succeeded 41 percent of the time in the black-box setting, and more injected passages pushed that back up.5
- Isolate-then-aggregate. RobustRAG, by Chong Xiang, Tong Wu, Zexuan Zhong, David Wagner, Danqi Chen and Prateek Mittal (posted 24 May 2024), answers from separate groups of passages and combines the answers with a secure aggregation step. For certain queries in its evaluation, it can formally certify a lower bound on response quality against an adaptive attacker who can inject a bounded number of malicious passages.27 The certificate holds only for those inputs, quality metrics and corruption budgets under its threat model, and the method costs several model calls per question.
- Marking provenance in the prompt. Spotlighting, from Keegan Hines and colleagues at Microsoft (posted 20 March 2024), transforms untrusted input, for example by interleaving a marker character or encoding it, so the model can tell data from instructions. The abstract reports attack success falling “from greater than 50% to below 2%” with GPT-family models. The detailed results vary by mode, model and task: delimiters alone roughly halved success for GPT-3.5-Turbo, datamarking brought it to 3.1 percent on summarisation and 8.0 percent on question answering for that model, and encoding brought it to 0.0 and 1.8 percent.28 It addresses injected instructions, not false facts written as plain statements, which is what PoisonedRAG uses.
None of these replaces control over what enters the store. Limiting who can write to each source is a preventive control against poisoning; recording provenance per chunk supports tracing and investigation after the fact; enforcing read permissions per user at query time limits disclosure; limiting what the model can do with what it reads limits the damage from injection. Each addresses a different risk, and none guarantees that an answer is correct.25
What a practitioner should do differently
Treat write access to the document store as a risk of influence over answers. Anyone who can write to an indexed source may be able to influence answers, depending on what is ingested, what is retrieved and how the system uses it. Inventory every source the indexer reads, who can write to each, and whether external parties (customers, applicants, vendors, the public web) can get text into it. In the PoisonedRAG benchmark, five passages per target question were enough.5
Authorise per caller before exposure. Carry the source system’s access list onto every chunk at ingestion, keep it synchronised, and authorise by the asking user’s identity before content reaches any less-trusted component or recipient, such as an external reranker, model or cache. Filtering inside the search can improve recall and isolation; postfiltering is acceptable where unfiltered candidates stay inside the trusted boundary, at the recall cost Microsoft documents.12 Apply a matching policy to summaries, graph community reports, caches and conversation memory. Test it by asking, as a low-privilege user, for content you know exists only in restricted documents.24
Protect the vectors like the documents. Short texts have been recovered from embeddings by an attacker able to query the embedding model, so a vector database built from sensitive documents should be handled as sensitive data, with its own backups, logs and retention.26
Measure retrieval separately from generation. Build a test set from real questions, label it by question type (identifiers and error strings, paraphrased questions, broad questions), and record retrieval recall at the K you actually use. If the right passage is rarely in the top K, prompt changes in a single-call pipeline cannot supply it. Compare keyword, dense and hybrid retrieval on that set, since in published tests BM25 beat a dense retriever on one dataset with high question-passage word overlap and was a strong zero-shot baseline across BEIR.110
Test context length and order. Vary the number of passages, their order and the model on your test set and keep the settings that score best. In the position-effect experiments, more passages added little and mid-context placement cost accuracy for the 2023 models tested.2 Avoid mixing outdated and current versions of a document in one context.
Check citations at three levels. Use literal presence of the cited figure or phrase as a cheap first check on every answer. On a sample, judge separately whether the cited passage entails the claim and whether it is the authoritative, applicable source, as the worked example’s second check does. Report each rate. The four-engine audit found about three citations in four supporting their sentence and about half of sentences fully supported.3224 Make “the documents do not answer this” an allowed, tested output.
Separate data from instructions and limit consequences. Mark retrieved text, preferring the stronger spotlighting modes to delimiters alone, but assume injected instructions will sometimes be followed.28 Where the model can call tools, do not let a retrieved passage trigger a privileged tool call or a write to memory without a check that does not depend on the model’s judgement.20
When assessing a vendor, ask for the numbers. Ask what “grounded” means in their evaluation, what the misgrounded-citation rate is, how permissions are enforced at query time, and how quickly a permission change reaches the index. In the 2024 legal evaluation, LexisNexis had claimed “100% hallucination-free linked legal citations” for its tool, and all three tools tested showed measured failures, incorrect responses or misgrounded citations, under the study’s definition.4
Conclusion
Retrieval-augmented generation gives a model an open book. Building on ORQA in 2019, the papers of 2020 (REALM, dense passage retrieval, RAG, Fusion-in-Decoder and ColBERT) established the method: learned retrievers over a vector index, readers that condition on many passages, and an index that can be swapped to change what the model says. Later work added self-critique (Self-RAG), corpus-wide summaries (GraphRAG) and agents that decide when to search. The evidence supports retrieval as a way to supply facts the model lacks, in the settings tested, when the right passage is found, placed where the model will use it, and not contradicted by stale material. It does not support claims that retrieval removes fabrication. Measured systems still answered without supporting passages, lost accuracy mid-context, and cited sources that did not support the claim; four generative search engines fully supported on average about half their sentences,3 and three legal research tools hallucinated on 17 to 33 percent of all queries in a 2024 evaluation under that study’s definition.4 The tendency to adopt coherent text that makes RAG useful also makes the document store an attack surface: in a controlled benchmark in which the attacker was assumed able to add text to the store, five planted passages per question steered most target answers,5 retrieved text can carry instructions, and an index with broader permissions than its user can disclose what that user should not see. A RAG system is a search engine, a database and a language model joined together, and each part needs its own access control, testing and threat model.
Footnotes
- Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen and Wen-tau Yih, “Dense Passage Retrieval for Open-Domain Question Answering”, arXiv:2004.04906, first submitted April 10, 2020, revised September 30, 2020 (EMNLP 2020). Sections 1, 3.2, 4.1, 4.2, 5.1, 5.2 and 5.4, Tables 2 and 3, notes 9 and 10. https://arxiv.org/abs/2004.04906 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13
- Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni and Percy Liang, “Lost in the Middle: How Language Models Use Long Contexts”, arXiv:2307.03172, first submitted July 6, 2023, revised November 20, 2023; published in Transactions of the Association for Computational Linguistics, volume 12, pages 157 to 173, 2024. Sections 1, 2 and 5, Table 1, Figure 11, Appendix G Tables 5 to 7. https://arxiv.org/abs/2307.03172 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Nelson F. Liu, Tianyi Zhang and Percy Liang, “Evaluating Verifiability in Generative Search Engines”, arXiv:2304.09848, first submitted April 19, 2023, revised October 23, 2023 (Findings of EMNLP 2023). Abstract and sections 4.2 and 4.3. https://arxiv.org/abs/2304.09848 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Varun Magesh, Faiz Surani, Matthew Dahl, Mirac Suzgun, Christopher D. Manning and Daniel E. Ho, “Hallucination-Free? Assessing the Reliability of Leading AI Legal Research Tools”, arXiv:2405.20362, submitted May 30, 2024. Abstract, sections 1, 4.2, 4.3 and 6.1, Table 1, Figure 4. https://arxiv.org/abs/2405.20362 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
- Wei Zou, Runpeng Geng, Binghui Wang and Jinyuan Jia, “PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models”, arXiv:2402.07867, first submitted February 12, 2024, revised August 13, 2024 (USENIX Security Symposium 2025). Sections 1, 3, 4, 5.1, 7.1 to 7.4 and 8 (impact on non-target questions), Tables 1, 10, 11, 12 and 13. https://arxiv.org/abs/2402.07867 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11
- Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat and Ming-Wei Chang, “REALM: Retrieval-Augmented Language Model Pre-Training”, arXiv:2002.08909, submitted February 10, 2020. Sections 1, 2, 3.1, 3.3 (including “What does the retriever learn?”), 3.4, 4.3 to 4.5, Tables 1 to 3. https://arxiv.org/abs/2002.08909 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
- Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel and Douwe Kiela, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”, arXiv:2005.11401, first submitted May 22, 2020, revised April 12, 2021 (NeurIPS 2020). Sections 2, 4.1 (no-answer-string result), 4.3 (Jeopardy human evaluation) and 4.5 (index hot-swapping), Tables 1, 2 and 4. https://arxiv.org/abs/2005.11401 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
- Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi and others, “Retrieval-Augmented Generation for Large Language Models: A Survey”, arXiv:2312.10997, first submitted December 18, 2023, revised March 27, 2024. Sections II, IV and V. https://arxiv.org/abs/2312.10997 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Apache Lucene, “BM25Similarity (Lucene 9.12.3 core API)”, class documentation, which cites Robertson and colleagues, “Okapi at TREC-3”, TREC 1994. Constructor and method details for k1, b and idf. https://lucene.apache.org/core/9_12_3/core/org/apache/lucene/search/similarities/BM25Similarity.html (opens in a new tab) ↩
- Nandan Thakur, Nils Reimers, Andreas Rücklé, Abhishek Srivastava and Iryna Gurevych, “BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models”, arXiv:2104.08663, first submitted April 17, 2021 (NeurIPS 2021 Datasets and Benchmarks Track). Abstract and sections 2 and 5. https://arxiv.org/abs/2104.08663 (opens in a new tab) ↩1 ↩2
- Yu. A. Malkov and D. A. Yashunin, “Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs”, arXiv:1603.09320, first submitted March 30, 2016, revised August 14, 2018. Abstract, sections 1 and 4, Algorithms 1 to 5. https://arxiv.org/abs/1603.09320 (opens in a new tab) ↩1 ↩2 ↩3
- Microsoft, “Vector Query Filters - Foundry IQ (Azure AI Search)”, Microsoft Learn, dated April 27, 2026. Sections “How filtering works in vector queries”, “Set the filter mode” and the comparison table. https://learn.microsoft.com/en-us/azure/search/vector-search-filters (opens in a new tab) ↩1 ↩2 ↩3
- Kenton Lee, Ming-Wei Chang and Kristina Toutanova, “Latent Retrieval for Weakly Supervised Open Domain Question Answering”, Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, July 2019, pages 6086 to 6096. Abstract. https://aclanthology.org/P19-1612/ (opens in a new tab) ↩
- Gautier Izacard and Edouard Grave, “Leveraging Passage Retrieval with Generative Models for Open Domain Question Answering”, arXiv:2007.01282, first submitted July 2, 2020, revised February 3, 2021. Sections 2 to 4, Tables 1 and 2. https://arxiv.org/abs/2007.01282 (opens in a new tab) ↩1 ↩2 ↩3
- Omar Khattab and Matei Zaharia, “ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT”, arXiv:2004.12832, first submitted April 27, 2020, revised June 4, 2020 (SIGIR 2020). Sections 1, 3, 4.1.1 and 4.2 to 4.5, Tables 1, 2 and 4. https://arxiv.org/abs/2004.12832 (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- Luyu Gao, Xueguang Ma, Jimmy Lin and Jamie Callan, “Precise Zero-Shot Dense Retrieval without Relevance Labels”, arXiv:2212.10496, submitted December 20, 2022. Abstract, section 3 (equations 6 to 8), section 4, Table 1. https://arxiv.org/abs/2212.10496 (opens in a new tab) ↩1 ↩2 ↩3
- Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil and Hannaneh Hajishirzi, “Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection”, arXiv:2310.11511, submitted October 17, 2023. Sections 3 to 5, Tables 1 and 2, Appendix A.1 (manual assessment of GPT-4 labels) and Appendix C (reliance on parametric and non-parametric memory). https://arxiv.org/abs/2310.11511 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley, Alex Chao, Apurva Mody, Steven Truitt, Dasha Metropolitansky, Robert Osazuwa Ness and Jonathan Larson, “From Local to Global: A Graph RAG Approach to Query-Focused Summarization”, arXiv:2404.16130, first submitted April 24, 2024, revised February 19, 2025. Sections 3.1.6, 4.1.1, 4.1.3, 5.1 and 6.1, Table 2, Figure 2, Table 6. https://arxiv.org/abs/2404.16130 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- Aditi Singh, Abul Ehtesham, Saket Kumar, Tala Talaei Khoei and Athanasios V. Vasilakos, “Agentic Retrieval-Augmented Generation: A Survey on Agentic RAG”, arXiv:2501.09136, first submitted January 15, 2025, revised April 1, 2026. Abstract and sections 3 and 5. https://arxiv.org/abs/2501.09136 (opens in a new tab) ↩
- Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz and Mario Fritz, “Not what you’ve signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection”, arXiv:2302.12173, first submitted February 23, 2023, revised May 5, 2023. Abstract and sections 2 to 4. https://arxiv.org/abs/2302.12173 (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- Jian Xie, Kai Zhang, Jiangjie Chen, Renze Lou and Yu Su, “Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflicts”, arXiv:2305.13300, first submitted May 22, 2023, revised February 27, 2024 (ICLR 2024). Abstract and sections 4 and 5. https://arxiv.org/abs/2305.13300 (opens in a new tab) ↩1 ↩2 ↩3
- Tianyu Gao, Howard Yen, Jiatong Yu and Danqi Chen, “Enabling Large Language Models to Generate Text with Citations”, arXiv:2305.14627, first submitted May 24, 2023, revised October 31, 2023 (EMNLP 2023). Abstract and section 2. https://arxiv.org/abs/2305.14627 (opens in a new tab) ↩1 ↩2
- Norm Hardy, “The Confused Deputy (or why capabilities might have been invented)”, originally published in Operating Systems Review, Vol. 22, No. 4, 1988; reproduced at cap-lore.com. http://cap-lore.com/CapTheory/ConfusedDeputy.html (opens in a new tab) ↩
- Microsoft, “Security Filter Pattern - Foundry IQ (Azure AI Search)”, Microsoft Learn, updated November 23, 2026. https://learn.microsoft.com/en-us/azure/search/search-security-trimming-for-azure-search (opens in a new tab) ↩1 ↩2
- OWASP Gen AI Security Project, “LLM08:2025 Vector and Embedding Weaknesses”, OWASP Top 10 for LLM Applications 2025. https://genai.owasp.org/llmrisk/llm082025-vector-and-embedding-weaknesses/ (opens in a new tab) ↩1 ↩2
- John X. Morris, Volodymyr Kuleshov, Vitaly Shmatikov and Alexander M. Rush, “Text Embeddings Reveal (Almost) As Much As Text”, arXiv:2310.06816, submitted October 10, 2023 (EMNLP 2023). Abstract, sections 2, 4 and 5, Tables 1 and 3, Limitations. https://arxiv.org/abs/2310.06816 (opens in a new tab) ↩1 ↩2
- Chong Xiang, Tong Wu, Zexuan Zhong, David Wagner, Danqi Chen and Prateek Mittal, “Certifiably Robust RAG against Retrieval Corruption”, arXiv:2405.15556, first submitted May 24, 2024, revised April 1, 2026 (v2). Abstract and section I. https://arxiv.org/abs/2405.15556 (opens in a new tab) ↩
- Keegan Hines, Gary Lopez, Matthew Hall, Federico Zarfati, Yonatan Zunger and Emre Kiciman, “Defending Against Indirect Prompt Injection Attacks With Spotlighting”, arXiv:2403.14720, submitted March 20, 2024. Abstract, section 5, Figures 3 to 6. https://arxiv.org/abs/2403.14720 (opens in a new tab) ↩1 ↩2

SecSIG