一项在 2,000 篇论文上通过的 RAG 搜索测试,在 2.68M 规模下每 100 个问题多漏掉 40 个答案
原题A RAG Search Test That Passed on 2,000 Papers Missed 40 More Answers per 100 at 2.68M
推荐理由从小语料到百万规模的 RAG 实验揭示召回率与同页干扰项问题,帮助团队避免把小规模检索效果直接当作线上能力。
读前速览
这项研究测试了不同规模语料库中的 RAG 检索表现,语料库范围从 2,000 篇 arXiv 论文到 268 万个 Wikipedia 段落;结果发现,BM25 的召回率在规模扩大后下降了 40 个百分点,而来自同一页面的干扰项会显著降低表现。
规模会显著影响 RAG 检索表现
BM25 的 Top 10 成功率从 10,000 个段落时的 86.8% 降至 268 万个段落时的 46.6%,下降了 40 个百分点;这使许多由作者自行构建的 RAG 基准测试失去说服力。
来自同一页面的干扰项会严重降低搜索表现
将 20 个填充段落替换为答案所在 Wikipedia 页面的内容后,成功率降低了 8.3 个百分点。这表明,干扰项可以利用 BM25 对标题赋予更高权重的优势。
小规模测试无法预测大规模表现
在 2,000 篇论文的测试中,性能没有显著下降;但当规模扩大到数百万条内容时,表现下降了 40 个百分点。这说明作者自行编写的评测会高估搜索质量,无法反映生产环境规模下的表现。
答案在上下文中的位置对检索质量至关重要
当来自同一页面的干扰项排名高于经过判定的段落时,它们会把正确答案挤出前 10 个结果,直接导致检索失败。
完整摘要
文章通过两项实证测试评估检索增强生成(RAG)的搜索质量。第一项测试在包含 100 至 1,801 篇 arXiv 论文的语料库中,针对 298 个问题评估 BM25 和基于嵌入的检索,发现性能仅下降 1-3.4 个百分点,未达到作者设定的显著性阈值。第二项测试使用 BM25,将规模扩大到 268 万个 Wikipedia 段落,发现成功率大幅下降:从 10,000 个段落时的 86.8% 降至全量语料时的 46.6%,相差 40 个百分点。第三项测试单独考察来自同一页面的干扰项,结果显示,将 20 个段落替换为答案所在 Wikipedia 页面的内容,会使成功率降低 8.3 个百分点。这些发现质疑了由作者自行编写的 RAG 评测对搜索性能的高估,并表明答案在上下文中的位置会对检索质量产生关键影响。
目录 · 13 节
On a collection of 100 research papers, BM25, a standard text search method, put a paper that answered the question in its top five results for 99.7 percent of questions. On 1,801 papers, that number was 98 percent. I built the test to find the threshold at which that number drops, and it barely moved.
That result looked like good news for anyone running retrieval augmented generation, or RAG, where an AI model answers a question using passages that a search step fetched first. If search stays good as the collection grows, the rest of the system has solid ground to stand on. Then I ran the same kind of test on 2.68 million Wikipedia passages, and the picture changed.
This article reports both tests as one story. The first test used questions from my earlier test of agentic retrieval. The second used public questions that nobody wrote for my setup.
The code, questions, labels, and results for every test are in a public repository.
Learn this step by step with the interactive AI Engineer roadmap.
What did I want to find out?
I wanted to know how often the search step of a RAG system, the part that finds documents, misses the right one as the collection grows. I also wanted to know whether it matters if the extra documents look like the right answer.
A distractor is a document that does not answer the question. Some distractors are random, and some are close in topic to the right document.
Each test asked the same plain question. If I add more distractors and change nothing else, does the search still find a document that answers the question?
Before running anything, I fixed a rule for what would count as a meaningful drop, so that I could not choose the bar after seeing the results. A size counted as a degradation point only if the score fell at least five points below the smallest collection. Five points means one more question in every 20 loses its answer, and a point here means one percentage point.
The rule also needed the drop to be clearly real and not luck. My tests use only some questions, so a different set of questions would give a slightly different drop. I checked this with the 95 percent range, which is the span where the true drop probably sits.
Think of a bathroom scale that can be wrong by about 2 kilograms either way. If it says you lost 1 kilogram, you cannot tell whether you lost anything. If it says you lost 8 kilograms, you really did.
My measured drop is the scale reading, and the 95 percent range is how jumpy the scale is. If that span includes zero, which means no change, the drop could be luck.
For example, a 6 point drop with a span from a 9 point drop to a 1 point gain does not count, because that span includes no change. A 6 point drop with a span from a 9 point drop to a 3 point drop counts, because every value in that span is a drop.
Three scores appear in this article: recall at 5, success at 10 and exact match. The first two ask whether search put a good passage near the top, and exact match asks whether the model's answer matched an accepted answer. I define each one where it first matters.
Test one, 2,000 arXiv papers
The first collection held 2,000 recent arXiv abstracts in machine learning, language, and search. I used 298 questions, each written from one paper and checked by hand, so every question had a known right paper. No paper was used twice, so the 298 questions came from 298 different papers.
For each question I built collections of 100, 250, 500, 1,000 and 1,801 papers, and each larger collection contained the smaller one. The right paper was always inside. The rest were distractors of two kinds.
Every other paper in the 2,000 could be used as a distractor. That included the 1,702 papers with no question and the 297 papers that belonged to other questions. For any one question, those papers were documents that should not answer it, and I checked that next.
Ordinary distractors were picked at random from papers that were not close to the right one. I made three separate random picks, which I call draws.
Look-alike distractors were the papers nearest to the right one, taken in order of similarity. I measured similarity with a separate small embedding model, a tool that turns text into lists of numbers. That way the collections were not built to fool the search methods I was testing.
I tried two search methods, BM25 and embeddings. Embeddings rank passages by how close their lists of numbers are to the question's list.
I ran each method in two ways, called flat chunks and parent documents, which makes four search setups. Flat chunks searched small windows of two sentences and returned the top five windows. Parent documents searched the same windows but returned the whole abstract for the top five distinct papers.
The four setups are BM25 with flat chunks, BM25 with parent documents, embeddings with flat chunks and embeddings with parent documents.
The score was recall at 5, which is the share of questions where a paper that answers the question appears in the top five results. A paper counted as an answer only if it passed a check I describe next.
How I checked that distractors did not answer the question
A look-alike paper can accidentally answer the question, which would make the search look worse than it is. So I used two AI models to screen the 50 closest papers for each question.
Claude Haiku 5.5 flagged papers that might answer the question, and Claude Sonnet 5.5 reviewed each flag. Haiku flagged 446 cases and Sonnet cleared 313 of them, but I removed every flagged paper to be safe.
Each removed paper was replaced by the next closest one, so collection sizes stayed exact. Removals used up part of the 2,000 papers, which is why the largest collection is 1,801 papers and not 2,000. One question was refused by one of the two AI models, so I checked its closest papers by hand.
Afterwards I read samples of the labels myself to check the models' labels, including 40 papers the models never looked at, and all 40 were clearly off topic. I did not read every pair, so I treat these labels as a rough range. The calls to the two AI models cost 1.81 US dollars in total.
What happened
No setup met my rule. The biggest drop was 3.4 points, for embeddings with flat chunks and ordinary distractors. That is below my bar of five points.
But 3.4 is only what I measured on my 298 questions. Say you want to know how tall adults in a city are, and you measure 298 people. Their average is 170 centimeters.
You would not say the whole city averages exactly 170, because a different 298 people would give a slightly different number. You would say it is probably between 168 and 172.
My drop works the same way. The 3.4 is my 170, and the 95 percent range is my 168 to 172. For this setup the range ran from 1.3 to 5.4 points.
The top of that range is above five, so I cannot rule out a true drop just past my bar. I can only say that the drop I measured never reached it.
Parent documents ended 0.3 points higher than flat chunks in all four comparisons at 1,801 papers, meaning BM25 and embeddings with each kind of distractor. The ranges overlap heavily, so I would not call that a win. They also did not clearly reduce the damage from growth, since the drop was smaller in two comparisons, larger in one and the same in one.
The result held when I removed only the 133 papers that both models flagged, and when I dropped three questions whose paper did not actually support them. It also held when I dropped the eight questions that need only one fact from a paper, because no paper can partly answer them. In every version the largest drop stayed between 3.1 and 3.4 points.
Taken together, the retrieval design choices I tested did not behave consistently as the collection grew. Those choices were the search method, BM25 or embeddings, and what the search returns, flat chunks or parent documents.
Embeddings lost more than BM25 with ordinary distractors, but not clearly with look-alike ones. Parent documents did not clearly beat flat chunks either. This is one test of two search methods, so treat it as a reason to test your own setup and not as a rule.
One detail matters. Look-alike collections started lower, at 96.0 to 98.3 for the smallest size, probably because even 99 look-alike papers already compete hard with the right one. Growing the collection cost only one or two more points.
Why did that test feel too easy?
The test left very little room to fall. The scores began near 100, the collection stopped at 2,000 papers, and the biggest collection I could build for both kinds of distractor was 1,801. A real document store can be far larger.
The questions were also written from the paper they ask about, so they may share words with it. A search method has an easy job when the question and the answer use the same vocabulary. That could hide how it behaves on questions that people really type.
I did not want to leave the result at "no breaking point found". So I looked for public questions that nobody had written from the answer, and a much larger collection.
Test two, 2.68 million Wikipedia passages
Natural Questions contains real, anonymized search queries, with answers marked on Wikipedia pages. BEIR packages 3,452 of those questions with 2,681,468 Wikipedia passages and human relevance judgments. A relevance judgment is a label saying a passage is known to help answer a question.
A passage that carries that label is what I call a judged passage. It works like the answer key at the back of a textbook. People marked these passages before I ran any search so that I could check the search against the key.
Passages without a label are not necessarily wrong. Nobody marked them either way, so an unlabeled passage can still contain an answer.
I set aside 40 questions for checking my code and used the other 3,412 for the size test, which compares collection sizes, each with at least one judged passage. I used BM25 only. The score was success at 10, which counts a question as a hit when at least one judged passage appears in the first ten results.
I built nested collections of 10,000, 100,000, 500,000 and 1,000,000 passages, so that each larger one contains the smaller ones. Each came from three random draws, and I ran the full 2,681,468 passages once. Every collection contained all the judged passages, and the rest were filled with passages that had no label.
The score fell at every size. The first size to meet my rule was 100,000 passages, with a drop of 11.1 points and a range from 10.2 to 12.1 points. At the full collection the score was about 40 points below the 10,000 passage result.
BM25 lost at most 2 points on the 2,000 papers and lost 40 points here. The two tests differ in many ways, including topic, question style, labels, and size, so I cannot say which difference mattered most. What I can say is that the first test did not predict the second.
Two things that make this number harder to read
First, the labels are positive only. A passage with no label might still answer the question, and a search that returns it counts as a miss. For a question about the tallest mountain, one passage may carry the label while several others also name Everest.
I saw this in the answer test described below. In 21 of the 210 ordinary question and draw pairs, no judged passage reached the first ten results. The answer model still got the right answer in 5 of them, about one case in four, so other passages must have carried it.
Second, my smallest collection is not a natural one. Every collection holds all 4,201 judged passages, which make up about 42 percent of a 10,000 passage collection and under 0.2 percent of the full one.
So part of the drop is the judged passages becoming a smaller share of the collection. That also happens in real life as a collection grows. My smallest collection starts with an unusually high share, though, and I did not run a version with a natural mix.
What happens when the extra passages look alike?
The size test changed millions of passages at once. So I ran a smaller test that changed exactly 20 passages per question. I sampled 100 questions at random from those that had at least 50 other passages from the same Wikipedia page as the judged passage.
AI screening helped sort the candidates, but I read all of the passages myself. For each question I labeled the 50 nearest same page passages as full support (answers the whole question), partial support (answers one part) or no support (answers none of it). I did this without seeing the similarity rank, and I finished before running any search, so the results could not shape my labels.
I used 50 passages per question because a pilot showed that 20 would leave too few with no support once the helpful ones were set aside.
That gave 5,006 labeled passages, of which 81 were full, 269 partial and 4,656 had no support. Only passages with no support were used as distractors. I was the only reviewer, so these labels have no second annotator.
For each question I built three pairs of 10,000 passage collections. In the ordinary collection, the filler was random, and never came from the 50 same page passages I had reviewed. In the hard collection, I swapped 20 of the filler passages for 20 passages from the answer's own page, so the two collections differed by exactly 20 passages.
The drop showed in every draw, from 90 to 81 percent, 92 to 84 percent and 90 to 82 percent. Across 300 question and draw pairs, 25 changed from a hit to a miss and none changed from a miss to a hit.
What I found when I read the swapped passages
As a second look at my own labels, I reread one swapped passage from each of 40 random questions. This was still my own judgment, not an independent reviewer. Of those 40, 38 clearly did not answer the question, and two were borderline.
Most of the swapped passages were short pieces of the same page, such as a line reading "League championships (5)", and they were not close in meaning. They ranked high because the search gives a title match twice the weight of a text match.
So any passage from a page such as Wake Island ranks high for a question about Wake Island.
That changes what this test shows. It shows that same page passages hurt BM25 with a doubled title weight. It does not show that passages with similar meaning would fool a search method, and I did not test embeddings here.
I also checked the 25 cases that changed from a hit to a miss. In 21, the swapped passages ranked above the judged passage and pushed it down.
In the other four, none of the 20 added passages reached the top ten, yet the judged passage still fell. BM25 ranks passages by a number that depends on how common each word is across the whole collection, so swapping 20 passages can nudge those numbers slightly. That is my guess, and I did not test it.
One question was borderline, "when did the US take over Wake Island". I labeled two swapped passages as no support, yet on a second look they describe the Navy resuming control in 1945 and the Army taking command in 1994.
That question changed in all three draws, so it may inflate the 8.3 point drop a little.
Did the answer model get worse?
Recall at 5 and success at 10 only show whether search found the right passage, not whether a model can still answer from the passages it gets. So I tested a small open model, Qwen3 4B, which I call the answer model. For the same 100 questions and three draws, I gave it the top ten results from the ordinary collection, and then the top ten from the hard collection.
I call the ten passages the answer model sees for one question and one draw a context. I used the same instructions every time and told the answer model to always pick its most likely next word, so its answers do not change between runs.
I ran the answer test on the Wikipedia questions, because the first test would have needed a paid judge for its answers. The answer model costs nothing per call.
I found public lists of accepted answers, called aliases, for 70 of the 100 questions by matching them to questions in a published Natural Questions answer file. That file comes from the Dense Passage Retrieval project. I scored those 70, and the other 30 had no accepted answers to score against.
Exact match counts an answer only when it matches an accepted answer word for word, after ignoring capital letters, punctuation and words such as "the". I averaged the three draws for each question, and the ranges come from resampling the questions many times.
With the real search results, the answer model scored 11.9 points lower. When I forced the judged passage to the front, the two conditions were almost equal. Scoring the answers by word overlap, which gives partial credit, gave a drop of 12.2 points, so the choice of scorer did not drive the result.
The score depended on where the judged passage sat, not on which collection it came from. When a judged passage came first, exact match was 65.8 percent in ordinary contexts and 68.3 percent in hard ones. When it came second to fifth, the figures were 41.9 and 42.6 percent, though that covers only 31 ordinary and 68 hard contexts.
So hard search hurt mainly because it more often pushed the judged passage down or out of the top ten. Each condition has 210 contexts, from 70 questions and three draws. A judged passage came first in 152 of the 210 ordinary contexts and 82 of the 210 hard ones.
Take the question about when Teenage Mutant Ninja Turtles came out. Ordinary search put the judged passage first and the answer model said 1984, but hard search moved that passage to eighth or ninth place and the answer model said 1989.
Exact match also marked reasonable answers wrong. A complete list of host countries counted as wrong because it matched no single alias, and "1954" scored below "June 27, 1954". The result with the judged passage placed first does not prove the answer model ignores distraction, because its range allows a loss of a few points.
What should you check in your own system?
This is a guess about practice, based on one search method and one small model.
If your questions are written from your documents, the search may look better than it will with real users. If you can, add questions written by people who have not seen the documents. Treat the position of the judged passage in the final context as something to measure, because the answer model did much better when the answer came first.
Sources
[1] Kwiatkowski et al., Natural Questions: a Benchmark for Question Answering Research, 2019 (CC BY-SA 3.0).
[2] Thakur et al., BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models, 2021.
[3] Google, Natural Questions data and license.
[4] Karpukhin et al., Dense Passage Retrieval test references for Natural Questions.
Written By
Abdullahi Dattijo
I'm a software and machine learning engineer working on information retrieval and search systems. My writing focuses on reproducing published retrieval methods, BM25, dense retrieval, and learned sparse retrieval, end to end, with the real numbers and real failures included rather than just the happy path official docs show. Code and reproduction logs at github.com/abduldattijo.