Pico's News
Pico in glasses and a cardigan, hand on chin, thinking
Deep research · 23 November 2026

Put It Back in Order: Is DOS RAG the Baseline Long-Context Retrieval Was Missing?Put it back in order: a simple trick for AI that reads long books

Retrieve the best chunks, then put them back in the order the document had them. That one-line change beats tree-building and agentic readers on long-document benchmarks. The evidence is solid inside single-document reading comprehension. It thins out sharply once you leave it.An AI picks the best bits of a long book. Then it puts them back in the book's own order. That small trick beats much fancier systems on long-book tests. It is not a magic fix for everything, though.

20 min read38 sources20 peer-reviewed8 preprintsEvery excerpt verified

“Everyone's been shuffling the pages of the book and wondering why the model gets confused. What happens if you just put them back? Turns out: quite a lot, up to a point.”“Imagine reading the best pages of a book, but all mixed up. Hard, right? What if you put them back in order? It helps a lot! But only up to a point.” — Pico

Pico in a lab coat pointing ahead

Pico's TL;DR

  • Order matters once the budget is large. On ∞Bench En.MC with GPT-4o, re-sorting the same retrieved chunks into document order lifted accuracy from 87.8% to 93.1% at a 30K-token budget . OP-RAG found the same pattern with Llama 3.1 70B, and an independent re-implementation reproduced its gains over full long context . At about 1.5K tokens the effect vanishes . Evidence: Strong.
  • The simple baseline beats the complex pipelines it was tested against. At matched budgets, DOS RAG beat RAPTOR at every budget on all three benchmarks. It matched ReadAgent's best ∞Bench score with about a third of ReadAgent's tokens . Both baselines were re-run by the DOS authors, not tuned by their originators . Evidence: Moderate.
  • More context is not monotonically better. DOS RAG peaks and then dips as the budget grows: at 10K for GPT-4o-mini and 30K for GPT-4o . OP-RAG and Jin et al. report the same inverted U . Evidence: Strong.
  • Outside single long documents, the case is weak or negative. The authors limit their claim to single-document reading comprehension . In one independent multi-hop test at small budgets, DOS RAG trailed a stateful method by 7 to 16 F1 . When the full document fits in context, GPT-4o reading it whole still wins . Evidence: Emerging.
  • Your framework's "long-context reorder" is not DOS. LangChain, LlamaIndex and Haystack all ship a lost-in-the-middle ordering that puts the most relevant chunks at the ends . Document order has to be sorted from a chunk index yourself, which the reference code does in one line . Evidence: Strong.
  • Order helps when the AI reads a lot. In one long-book test, the AI read the same pieces in book order. Normally they come "best first". Its score went from 87.8% to 93.1% . Another team found the same thing with a different AI. A third team checked it . With only a few pieces, the trick did nothing . Evidence: Strong.
  • The simple trick beat the fancy ones it was tested against. It beat a "tree of summaries" system at every size . It tied a "reading helper" system while using about a third of the words . But the team ran those fancy systems themselves, without tuning them . Evidence: Moderate.
  • More text is not always better. Scores went up, then down a bit, as the AI read more . Other teams saw the same hill shape . Evidence: Strong.
  • It is less proven for other jobs. The team only tested one long book at a time . In one test with puzzle-like questions, the trick lost by 7 to 16 points . When the whole book fits, reading all of it still wins . Evidence: Emerging.
  • Popular tools do something different. Three well-known tools put the best pieces at the start and the end . To use book order, you sort the pieces yourself. It takes one line of code . Evidence: Strong.
Part 1

The question

Retrieval-augmented generation has a habit nobody chose on purpose. After retrieval, the chunks are pasted into the prompt in the order the retriever ranked them: most similar first. For a short top-5 list that hardly matters. Long-context models changed the arithmetic. It is now cheap to send 20,000 or 40,000 tokens of retrieved text, and at that size the prompt stops being a list of snippets. It becomes a patchwork of a document, stitched together in an order the author never wrote.

DOS RAG, short for "Document's Original Structure" RAG, is the proposal to undo that. Retrieve exactly as before, then sort the selected chunks back into document order . Laitenberger, Manning and Liu present it as a baseline, not a new method. They tested it against RAPTOR, which builds a tree of LLM summaries , and ReadAgent, an LLM that paginates and gists a book before looking things up . Their recommendation is that future work should beat DOS RAG before it claims progress .

So we asked:

  1. Where did the idea come from, and what does it build on?
  2. What exactly is DOS RAG, and how does it differ from vanilla RAG and OP-RAG?
  3. What do the benchmarks show, and at what token budgets?
  4. Why would document order help, given what we know about position bias?
  5. Where does it break?
  6. What should a practitioner actually do?

Scope. We cover foundations from 2023 and focus on work from mid-2024 to November 2026. Peer-reviewed papers, preprints and official documentation are all included and labelled. Vendor results are marked as self-reported.

Part 2

How we got here

Three threads meet in DOS RAG.

Position bias. "Lost in the Middle" showed a distinctive U-shaped curve in multi-document QA. Models used information at the start or end of the context far better than information in the middle . With 20 documents, GPT-3.5-Turbo answered 75.8% correctly when the gold passage came first and 53.8% when it sat in the middle. That is below the 56.1% it scored with no documents at all . The same paper found that retrieving more than about 20 documents barely helped readers, even though recall kept rising . The practical lesson most people drew was to keep contexts short and put the best evidence first.

The long-context-versus-RAG debate. Xu and colleagues found that a 4K-context model with simple retrieval roughly matched a 16K long-context model. They also found that adding more than the top 5 or 10 chunks did not help . Their chunks were ordered from most to least relevant . A year later, Li and colleagues reported the reverse headline. Given enough resources, feeding the whole document beat RAG on average: 48.67 versus 32.60 for GPT-4o across nine datasets . Their RAG used five 300-word chunks, again ordered by similarity score . Both papers, in other words, tested relevance-ordered RAG at small budgets.

Reordering by relevance. The common response to position bias was to move the best material to where the model looks. LongLLMLingua reorders compressed documents by a question-conditioned importance score, to exploit the model's preference for early material . Attention sorting decodes one step, then moves the documents that drew the most attention to the end, next to the question . Jin and colleagues proposed placing the top-scoring passages at both the start and the end of the prompt . Every one of these orders by relevance. None asks what order the text was written in.

The pivot: OP-RAG. In September 2024, Yu, Xu and Akkiraju tried the obvious alternative. They kept the same top-k chunks and sorted them by their position in the source . On ∞Bench, the gap grew with the number of chunks. At 128 chunks on En.QA, F1 rose from 38.40 to 44.43. At 192 chunks on En.MC, accuracy rose from 81.22% to 88.65% . With only a handful of chunks, the gap was small . That is exactly the regime earlier comparisons had tested.

Part 1

The question

Some AI systems answer questions about long texts. First they search the text for helpful pieces. These pieces are called "chunks". A chunk is just a short slice of text. Then the AI reads the chunks and answers.

There is a hidden habit here. The chunks are usually lined up "best match first". Nobody really chose that on purpose. With five chunks, it hardly matters. But today's AIs can read a lot. They can read 20,000 or 40,000 words of chunks at once. Then the chunks become a jumbled copy of the book.

DOS RAG is a fix for that. DOS stands for "Document's Original Structure". You pick chunks just like before. Then you put them back in book order . The team behind it says it is a "baseline". A baseline is the simple thing that new ideas must beat. They tested it against RAPTOR, which builds a tree of summaries . They also tested ReadAgent, an AI that skims a book and takes notes first . Their advice is clear. New systems should beat DOS RAG before anyone calls them better .

So we asked six things:

  1. Where did the idea come from?
  2. What exactly does DOS RAG do?
  3. What do the tests show, and how much text was used?
  4. Why would book order help?
  5. When does it stop working?
  6. What should builders do?

What we looked at. We looked at work from 2023 onwards. We focused on mid-2024 to November 2026. We used checked papers, unchecked papers and official guides. We label each kind. Company results are marked as the company's own claims.

Part 2

How we got here

Three ideas led to DOS RAG.

The middle gets forgotten. A 2023 study found a U shape . AIs used facts at the start or end of their reading well. They used facts in the middle badly. One AI got 75.8% right when the key fact came first. It got 53.8% when the fact was in the middle . That was worse than its 56.1% with no reading at all . Giving it more than about 20 pieces barely helped . So people learned a rule: keep it short, and put the best bit first.

Long reading versus picking pieces. One team tested picking a few pieces. It worked about as well as reading a long text . More than 5 or 10 pieces did not help . They lined pieces up "best first" . A later team found the opposite. Reading the whole text beat picking pieces: 48.67 versus 32.60 for one AI . But they only picked five pieces, again "best first" . So both teams tested small, "best first" piles.

Moving the best bits around. Many fixes moved the best pieces to where AIs look most. One sorted the pieces by how important they seemed . One moved the pieces the AI watched most to the end, next to the question . One put the top pieces at both the start and the end . All of these sort by "how good is this match". None asks what order the author wrote.

The big switch: OP-RAG. In 2024, one team tried book order instead . They kept the same chunks and just sorted them by place in the book. The more chunks they used, the more it helped. With 128 chunks, one score rose from 38.40 to 44.43. With 192 chunks, another rose from 81.22% to 88.65% . With only a few chunks, it barely helped . That was exactly the small setting older tests used.

From position bias to document orderTimeline: Lost in the Middle (2023), Retrieval meets long context (2023), RAPTOR and ReadAgent (2024), Self-Route (July 2024), OP-RAG (September 2024), inverted U and hard negatives (October 2024), DOS RAG at EMNLP (2025), independent baseline uses in 2026.From position bias to document orderMilestones are evenly spaced, not to scale in time2023: Lost in the Middle, U-shaped position bias2023Lost in the MiddleU-shaped position bias2023: Retrieval meets long context, relevance-ordered top-k2023Retrieval meets long contextrelevance-ordered top-k2024: RAPTOR · ReadAgent, trees and gist agents2024RAPTOR · ReadAgenttrees and gist agentsJul 2024: Self-Route, long context beats top-5 RAGJul 2024Self-Routelong context beats top-5 RAGSep 2024: OP-RAG, same chunks, document orderSep 2024OP-RAGsame chunks, document orderOct 2024: Inverted U, hard negatives, more passages can hurtOct 2024Inverted U, hard negativesmore passages can hurt2025: DOS RAG (EMNLP), matched-budget baseline2025DOS RAG (EMNLP)matched-budget baseline2026: Independent baselines, M-RAG, StateRAG2026Independent baselinesM-RAG, StateRAGOrder-preserving retrievalContext for the debate
Figure 1. How the field got from position bias to order-preserving retrieval. Milestones are evenly spaced, not to scale.The big steps on the way to the book-order trick. The gaps are not to scale. Source: SVG

There was a precedent, too. ReadAgent already reinserted the raw pages it looked up at their original positions, preserving the overall narrative flow . OP-RAG and DOS RAG take that instinct and drop the agent.

Part 3

What DOS RAG actually does

The method has three steps :

  1. Split the document into chunks of at most 100 tokens, without breaking sentences. Embed each with a small off-the-shelf model, Snowflake Arctic-embed-m 1.5.
  2. Rank the chunks by cosine similarity to the question and add them until a token budget is full. There is no fixed top-k.
  3. Sort the selected chunks by their position in the document, join them, and pass them to the reader with the question.

Vanilla RAG is the same pipeline without step 3, so the comparison is an exact ablation of ordering . In the released code, step 3 is a single line that sorts the selected nodes by index . There are no LLM calls before the question arrives: no summaries, no gists, no tree.

There was an earlier hint too. ReadAgent put the pages it looked up back where they belonged . DOS RAG keeps that idea but drops the helper.

Part 3

What DOS RAG actually does

It has three steps :

  1. Cut the book into small chunks of up to 100 tokens. A token is roughly a word. Never cut a sentence in half. Turn each chunk into numbers with a small, ready-made tool.
  2. Find the chunks that best match the question. Keep adding them until you hit a word limit. This limit is called the "budget".
  3. Sort the chosen chunks by their place in the book. Then give them to the AI with the question.

Normal RAG skips step 3. So comparing them shows exactly what the order does . In the team's code, step 3 is one line . Nothing extra runs before the question. There are no summaries, no notes and no tree.

Same chunks, different orderA 12-chunk document; chunks 8, 3, 11, 4 and 7 are retrieved in that similarity order. Vanilla RAG presents them as 8, 3, 11, 4, 7. DOS RAG re-sorts them by position as 3, 4, 7, 8, 11, keeping neighbouring chunks together.Same chunks, different orderIllustrative example: a document split into 12 chunks; 5 are retrievedDocument (chunks in written order)Chunk 1: not retrieved§1Chunk 2: not retrieved§2Chunk 3: retrieved, similarity rank 2§3rank 2Chunk 4: retrieved, similarity rank 4§4rank 4Chunk 5: not retrieved§5Chunk 6: not retrieved§6Chunk 7: retrieved, similarity rank 5§7rank 5Chunk 8: retrieved, similarity rank 1§8rank 1Chunk 9: not retrieved§9Chunk 10: not retrieved§10Chunk 11: retrieved, similarity rank 3§11rank 3Chunk 12: not retrieved§12Vanilla RAGsorted by similarityVanilla RAG: position 1 is chunk 8§8rank 1Vanilla RAG: position 2 is chunk 3§3rank 2Vanilla RAG: position 3 is chunk 11§11rank 3Vanilla RAG: position 4 is chunk 4§4rank 4Vanilla RAG: position 5 is chunk 7§7rank 5§3 and §4 are split up;the story jumps aroundDOS RAGsorted by positionDOS RAG: position 1 is chunk 3§3rank 2DOS RAG: position 2 is chunk 4§4rank 4DOS RAG: position 3 is chunk 7§7rank 5DOS RAG: position 4 is chunk 8§8rank 1DOS RAG: position 5 is chunk 11§11rank 3§3–§4 and §7–§8 sit together;the story reads in orderGreen bars mark chunks that are neighbours in the document. The question goes after the chunks in both cases.
Figure 2. Vanilla RAG and DOS RAG select the same chunks; DOS RAG only re-sorts them by position. Illustrative example, not real data.Both pick the same pieces. DOS RAG just puts them back in book order. This is a made-up example. Source: SVG

How does this differ from OP-RAG? In substance, very little. Both re-sort retrieved chunks into document order . DOS RAG uses smaller chunks, fills a token budget rather than a chunk count, and uses different readers and embedders . Its main contribution is the comparison, not the trick. OP-RAG was a single-benchmark preprint pitting an open model against other vendors' long-context runs . DOS RAG is a peer-reviewed EMNLP 2025 paper. It tests matched budgets against two multi-stage pipelines on three benchmarks, with five runs per setting .

Part 4

The benchmark record

The DOS RAG paper uses three single-document reading-comprehension benchmarks . ∞Bench En.MC has 229 multiple-choice questions over 58 books averaging about 184K tokens. QuALITY has 2,086 multiple-choice questions over stories of a few thousand tokens. NarrativeQA has more than 10,000 short-answer questions over books and scripts. The readers are GPT-4o and GPT-4o-mini .

∞Bench, the long-document case. With GPT-4o, DOS RAG beat vanilla RAG at every budget from 5K tokens up. The margin grew from 3.3 points at 5K to 5.3 points at 30K and 40K . Its best score was 93.1% at 30K, against 87.8% for vanilla RAG and 85.0% for RAPTOR at the same budget . ReadAgent scored 90.3% but used about 86K tokens per question . DOS RAG reached 90.0% at 10K. With GPT-4o-mini the pattern was the same and the gaps were larger: DOS RAG 84.1% at 10K against 76.0% for vanilla and 75.0% for RAPTOR. ReadAgent scored 76.2% .

How is this different from OP-RAG? Hardly at all. Both put chunks back in book order . DOS RAG uses smaller chunks. It fills a word budget instead of counting chunks. It also uses different AIs . The new part is the careful test, not the trick. OP-RAG was an unchecked paper with one set of tests . DOS RAG is a checked paper from a big 2025 meeting. It gave every system the same budget. It ran three tests, five times each .

Part 4

The test results

The team used three reading tests . ∞Bench has 229 multiple-choice questions about 58 very long books. Each book is about 184,000 tokens. QuALITY has 2,086 multiple-choice questions about short stories. NarrativeQA has over 10,000 short-answer questions about books and scripts. The readers were two OpenAI models, GPT-4o and the smaller GPT-4o-mini .

Very long books. With GPT-4o, book order beat "best first" every time from 5,000 tokens up. The gap grew from 3.3 points to 5.3 points . Its best score was 93.1% at 30,000 tokens. "Best first" got 87.8%, and RAPTOR got 85.0% . ReadAgent got 90.3%, but it read about 86,000 tokens per question . DOS RAG got 90.0% with just 10,000. With the smaller AI, the gaps were even bigger. DOS RAG got 84.1%. "Best first" got 76.0%, RAPTOR 75.0% and ReadAgent 76.2% .

Accuracy versus retrieval budget on ∞Bench En.MC with GPT-4oDOS RAG: 75.6, 85.9, 90.0, 91.4, 93.1, 91.9 at 1.5K to 40K tokens. Vanilla RAG: 76.2, 82.6, 86.0, 86.9, 87.8, 86.6. RAPTOR: 73.8, 79.0, 82.4, 84.4, 85.0, 85.9. ReadAgent 90.3 at about 86K tokens.Accuracy rises with budget, and order adds most at large budgets∞Bench En.MC accuracy (%), GPT-4o reader, by retrieval budget in tokens [1]DOS RAGVanilla RAGRAPTOR70%75%80%85%90%95%1.5K5K10K20K30K40KRetrieval budget (tokens)ReadAgent 90.3% (uses ~86K tokens)DOS RAG, 1.5K tokens: 75.6%DOS RAG, 5K tokens: 85.9%DOS RAG, 10K tokens: 90.0%DOS RAG, 20K tokens: 91.4%DOS RAG, 30K tokens: 93.1%DOS RAG, 40K tokens: 91.9%Vanilla RAG, 1.5K tokens: 76.2%Vanilla RAG, 5K tokens: 82.6%Vanilla RAG, 10K tokens: 86.0%Vanilla RAG, 20K tokens: 86.9%Vanilla RAG, 30K tokens: 87.8%Vanilla RAG, 40K tokens: 86.6%RAPTOR, 1.5K tokens: 73.8%RAPTOR, 5K tokens: 79.0%RAPTOR, 10K tokens: 82.4%RAPTOR, 20K tokens: 84.4%RAPTOR, 30K tokens: 85.0%RAPTOR, 40K tokens: 85.9%DOS RAG 91.9Vanilla 86.6RAPTOR 85.993.1 peakat 1.5K: DOS 75.6 vs Vanilla 76.2
Figure 3. ∞Bench En.MC with GPT-4o. Document order pulls ahead from 5K tokens and peaks at 30K; ReadAgent's score needs about 86K tokens per question.Scores on a very long book test. Book order pulls ahead once the AI reads more, and peaks at 30,000 tokens. Source: SVG

The small-budget exception. At 1.5K tokens, DOS RAG was slightly behind vanilla RAG on ∞Bench with both readers: 75.6% versus 76.2% for GPT-4o and 68.9% versus 69.9% for GPT-4o-mini . Those gaps are within run-to-run noise, but they are the right sign for the obvious explanation. With only 15 or so 100-token chunks scattered across a 184K-token book, there is little adjacency for document order to restore.

When the budget is tiny. At 1,500 tokens, book order was a tiny bit worse. It got 75.6% against 76.2%, and 68.9% against 69.9% . Those gaps are smaller than normal wobble between runs. It makes sense, though. Fifteen tiny chunks from a huge book are rarely next to each other. So there is little order to fix.

Gain from document order over similarity orderPanel A: DOS RAG minus Vanilla RAG on ∞Bench En.MC. GPT-4o: -0.6, +3.3, +4.0, +4.5, +5.3, +5.3 points at 1.5K to 40K tokens. GPT-4o-mini: -1.0, +5.0, +8.1, +6.6, +4.7, +4.4. Panel B: OP-RAG over vanilla with Llama 3.1 70B: +6.0 F1 on En.QA at 128 chunks; +7.4 accuracy points on En.MC at 192 chunks.What putting chunks back in order is worthPoints gained by document order over similarity order, same chunks and budgetA · DOS RAG minus Vanilla RAG, ∞Bench En.MC [1]-20+2+4+6+8GPT-4o, 1.5K tokens: -0.6 points-0.6GPT-4o-mini, 1.5K tokens: -1.0 points-1.01.5KGPT-4o, 5K tokens: +3.3 points+3.3GPT-4o-mini, 5K tokens: +5.0 points+5.05KGPT-4o, 10K tokens: +4.0 points+4.0GPT-4o-mini, 10K tokens: +8.1 points+8.110KGPT-4o, 20K tokens: +4.5 points+4.5GPT-4o-mini, 20K tokens: +6.6 points+6.620KGPT-4o, 30K tokens: +5.3 points+5.3GPT-4o-mini, 30K tokens: +4.7 points+4.730KGPT-4o, 40K tokens: +5.3 points+5.3GPT-4o-mini, 40K tokens: +4.4 points+4.440KRetrieval budget (tokens)GPT-4oGPT-4o-miniB · OP-RAG vs vanilla [2]Llama 3.1 70B, ∞BenchOP-RAG, En.QA F1 at 128 chunks: 38.40 → 44.43 F1+6.0En.QA F1128 chunksOP-RAG, En.MC acc. at 192 chunks: 81.22% → 88.65%+7.4En.MC acc.192 chunksLlama 3.1 70B
Figure 4. The gain from document order alone. It is near zero at tiny budgets and several points once many chunks fit. Panel B gains are computed from the paper's reported vanilla and OP-RAG scores.How much book order alone adds. Nothing with a tiny budget. Several points with a big one. Source: SVG

QuALITY, the short-document case. Here the documents average about 5.8K tokens, so an 8K budget is nearly the whole text. DOS RAG reached 90.4% with GPT-4o, ahead of vanilla RAG at 85.9% and RAPTOR at 84.9% . But GPT-4o reading the full document scored 91.2%, the best result in the table . With GPT-4o-mini, DOS RAG at 81.2% roughly tied the full document at 81.0% .

NarrativeQA. With GPT-4o-mini only, DOS RAG reached 22.1 F1 at 20K tokens. Vanilla RAG scored 19.2 and RAPTOR 17.3 at the same budget, and ReadAgent 21.0 with about 34K tokens . The margins are small, and n-gram metrics on free-form answers are a blunt instrument.

Independent evidence. No group has yet re-run DOS RAG on its own benchmarks with another model family. The closest replication is of OP-RAG. FB-RAG's authors re-implemented it with Llama 3.1 70B. At 16K and 24K tokens they got 47.87 and 48.27 F1 on ∞Bench En.QA, against 34.26 for the same model reading the full context . On En.MC, their figures were about three points lower than OP-RAG's own . On LongBench, whose tasks are often multi-document, order preservation added under one point over vanilla RAG, and full long context still won . LongBench v2 used document-order RAG as its baseline. For two open models, about 32K retrieved tokens scored higher than their full 128K context, by 4.1 points for Qwen2.5. GPT-4o still did slightly better reading everything .

Short stories. These stories are only about 5,800 tokens. So an 8,000-token budget holds nearly the whole story. DOS RAG got 90.4% with GPT-4o. "Best first" got 85.9%, and RAPTOR got 84.9% . But GPT-4o reading the whole story got 91.2%, the best score of all . With the smaller AI, it was about a tie. DOS RAG got 81.2%, and the whole story got 81.0% .

Short answers. Only the smaller AI was tested here. DOS RAG scored 22.1. "Best first" got 19.2, and RAPTOR got 17.3 . ReadAgent got 21.0 while reading more . These gaps are small. The scoring just counts matching words, which is a rough way to grade answers.

Checks by other teams. No other team has rerun DOS RAG's own tests yet. The closest check was of OP-RAG. A second team rebuilt OP-RAG with the same open AI. They scored 47.87 and 48.27, against 34.26 for reading the whole book . On one test, their scores were about three points lower than OP-RAG's own . On a mixed test called LongBench, book order added less than one point. Reading everything still won there . Another big test, LongBench v2, used book order as its simple method. For two open AIs, it beat reading everything, by up to 4.1 points. GPT-4o still did a little better reading it all .

Part 5

Why would document order help?

None of the papers isolates the mechanism. What follows is the most consistent reading of the evidence, not a tested result.

The lost-in-the-middle story predicts the opposite of DOS RAG. If position bias dominated, sorting by document position would scatter the best chunks into the middle, and relevance-first or ends-first orderings would win. Instead, document order beats relevance order once the budget is large . Two developments make this less surprising than it sounds.

First, position bias looks weaker than it did in 2023. Hsieh and colleagues traced lost-in-the-middle to a U-shaped attention bias and showed it can be calibrated away . LongPiBench found most current models more robust to the classic effect . Veseli and colleagues found it strongest when the input fills up to about half the context window, which DOS RAG's budgets rarely approach on a 128K model . In realistic open-domain RAG with 5 to 10 passages, Cuconasu and colleagues found random ordering statistically equivalent to clever rearrangement .

Second, what remains is sensitivity to distance between related pieces. LongPiBench reports noticeable bias from how far apart relevant items sit . In multi-hop QA, presenting supporting documents in the order of the reasoning chain matters by 10 F1 or more . A book is the extreme case of interlinked evidence: a pronoun resolves three sentences back, a clue pays off two chapters later. Document order keeps neighbouring chunks adjacent and the narrative's sequence intact. Relevance order shuffles them. That fits the budget pattern, too. With few chunks there are few neighbours to reunite, so order hardly matters .

One finding pulls the other way. Chroma's "context rot" report found that, across 18 models, needle-in-a-haystack retrieval did better on shuffled haystacks than coherent ones . That is a synthetic single-fact task, not reading comprehension, and the report is not peer-reviewed. But it is a reminder that coherence helps comprehension, not every task.

Part 6

Where it breaks

When the document fits. If the whole text fits comfortably, the strongest reader reading all of it still wins, as on QuALITY with GPT-4o . DOS RAG is a way to spend a budget well, not a reason to retrieve when you don't need to.

When the budget keeps growing. DOS RAG's accuracy rises, peaks and then falls: at 10K tokens for GPT-4o-mini and 30K for GPT-4o on ∞Bench . OP-RAG saw the same inverted U, peaking later for the larger model . Jin and colleagues traced the decline to hard negatives, passages that look relevant but mislead, which stronger retrievers return more of . The best budget is model-specific and has to be tuned.

When there is no single document. The authors say plainly that they tested single-document reading comprehension . Multi-document corpora have no natural global order. Jin and colleagues' edge-placement and Gabín and colleagues' finding that reverse score order wins at larger contexts on HotpotQA both come from that open-domain regime . Neither tested document order, because there was none to test.

When the questions need several hops. StateRAG used DOS RAG as one of ten baselines with a Qwen2.5-14B reader. It trailed the authors' stateful method by 6.9 F1 on HotpotQA, 16.2 on 2WikiMultihopQA and 12.9 on MuSiQue . DOS RAG used only about 1.0 to 1.4K tokens per query there, well below where it shines, and the comparison was run by the competing method's authors . M-RAG, another independent baseline study at even smaller budgets, found DOS RAG competitive: it led on 2WikiMultihopQA and trailed slightly on NarrativeQA . Banerjee and colleagues found that on a multi-hop benchmark, top-10 retrieval surfaced all the gold facts for only 19% of queries . No reordering can fix evidence that was never retrieved.

When the question is global. "What are the main themes across these 500 reports?" has no small set of supporting chunks. GraphRAG's community summaries beat vector RAG on comprehensiveness and diversity for such questions, judged by an LLM . DOS RAG was not tested there.

Part 5

Why would book order help?

No paper has proved why. This is our best guess from the evidence. It is not a tested fact.

The "middle gets forgotten" idea says book order should lose. Book order would bury the best chunks in the middle. But book order wins once the AI reads a lot . Two newer findings help explain this.

First, the middle problem seems smaller now. One team found it comes from a lopsided focus inside the AI, and fixed it . Another team found most new AIs handle the old problem better . A third found it is strongest when the AI's memory is up to half full . DOS RAG's budgets rarely fill that much. Normal search setups use 5 to 10 pieces. There, random order did just as well as clever order .

Second, distance still matters. AIs do worse when related facts sit far apart . Step-by-step puzzles were tested too. Putting clues in the right order changed scores by 10 points or more . A book is full of linked clues. A "she" points back to a name. A hint pays off two chapters later. Book order keeps neighbour chunks together, and the story flows. "Best first" shuffles them. This also explains the small-budget result. With few chunks, there are few neighbours to join up .

One finding points the other way. A company test found that AIs found a single hidden fact better in shuffled text . That test was made-up and about one fact, not about understanding a story. It was also not checked by outside experts. Still, it is a reminder. Neat order helps understanding. It may not help every task.

Part 6

When it stops working

When the whole book fits. If the AI can read everything, reading everything can still win. That happened with GPT-4o on short stories . DOS RAG helps you use a budget well. It is not a reason to skip reading the whole thing.

When you keep adding more. Scores go up, peak, then dip. The peak was at 10,000 tokens for the small AI and 30,000 for GPT-4o . OP-RAG saw the same hill, with the bigger AI peaking later . One team found why. Good search tools also find "tricky" pieces that look right but mislead . So the best budget is different for each AI. You have to test it.

When there is more than one book. The team only tested one book at a time . A pile of many documents has no single natural order. Other tips, like putting the best pieces at both ends, came from those mixed piles . They never tested book order, because there wasn't one.

When questions need several steps. One team used DOS RAG as a simple method to beat. Their own method won by 6.9, 16.2 and 12.9 points on three step-by-step puzzle tests . But DOS RAG only read about 1,000 to 1,400 tokens there. DOS RAG does best with much more. And that team was testing its own method . Another team used even smaller budgets. There, DOS RAG did well. It won on one test and lost slightly on another . A third team found a deeper problem. Search found all the needed facts for only 19% of questions . Sorting cannot fix facts that were never found.

When the question is about everything. "What are the main themes in these 500 reports?" No small set of chunks can answer that. A system called GraphRAG did better on such big-picture questions, judged by an AI . DOS RAG was not tested there.

Where the simple baseline stops winningPanel A: QuALITY with GPT-4o at 8K tokens: full document 91.2%, DOS RAG 90.4%, Vanilla RAG 85.9%, RAPTOR 84.9%. Panel B: multi-hop F1 with Qwen2.5-14B at about 1 to 1.4K tokens, DOS RAG versus StateRAG: HotpotQA 43.1 vs 50.0, 2WikiMultihopQA 43.1 vs 59.3, MuSiQue 21.1 vs 34.0.Where the simple baseline stops winningTwo panels with different measures, so each has its own axisA · QuALITY, GPT-4o, 8K budget (accuracy %) [1]0%25%50%75%Full documentFull document: 91.2%91.2DOS RAGDOS RAG: 90.4%90.4Vanilla RAGVanilla RAG: 85.9%85.9RAPTORRAPTOR: 84.9%84.9The document (~5.8K tokens) nearly fits the budget.B · Multi-hop QA, Qwen2.5-14B, ~1–1.4K tokens (F1) [5]0204060HotpotQA, DOS RAG: 43.1 F143.1HotpotQA, StateRAG: 50.0 F150.0HotpotQA2Wiki, DOS RAG: 43.1 F143.12Wiki, StateRAG: 59.3 F159.32WikiMuSiQue, DOS RAG: 21.1 F121.1MuSiQue, StateRAG: 34.0 F134.0MuSiQueDOS RAGStateRAG (authors' method)
Figure 5. Two settings where DOS RAG loses: the full document wins when it fits (A); a stateful multi-hop method wins at small budgets in a study by that method's authors (B). Separate panels because the measures differ.Two places the trick loses. Reading the whole short story wins. A puzzle-solving method wins on step-by-step questions. Source: SVG
Part 7

Where the evidence disagrees

Chunks or summaries? DOS RAG found raw chunks beat RAPTOR's summary tree at every budget . Li and colleagues' long-context revisit found summarisation-based retrieval comparable to full context, with chunk-based retrieval lagging . The settings differ in benchmarks, readers and ordering. DOS RAG also built RAPTOR's tree with the cheaper GPT-4o-mini , and Li and colleagues did not test order-preserving chunks . Neither result settles the other.

Long context or RAG? Self-Route said long context wins when resourced . OP-RAG and DOS RAG say budgeted, order-preserving RAG can match or beat it . LaRA's careful ICML 2025 benchmark says there is no universal winner: the answer depends on model, context length and task . Much of the old disagreement is configuration. Self-Route's RAG used five relevance-ordered chunks , a setting OP-RAG showed is where ordering matters least and budgets are too small .

Which order? Importance-first , ends-first , most-relevant-last and document order have each won somewhere. The cleanest reconciliation is that they won in different regimes. Relevance and edge orderings come from open-domain, multi-source passages with short contexts. Document order comes from long single documents at large budgets. We found no paper that tests all four on the same single-document benchmark.

Contamination. QuALITY and NarrativeQA draw heavily on public-domain fiction. GPT-4 has memorised many popular books, and models do better downstream on books they have memorised . On recently published novels designed to need whole-book reasoning, GPT-4o scored only 55.8% . None of this has been measured for DOS RAG's benchmarks specifically. It argues for caution in reading absolute numbers, though it should affect every method in a table roughly equally.

Part 8

What this means in practice

Make DOS RAG your baseline. It costs nothing to add. If you already store a chunk index, sorting by it after retrieval is one line, exactly as in the reference implementation . If a new pipeline cannot beat budgeted, order-preserving retrieval, its extra machinery isn't earning its keep .

Check what your framework's reorder does. LangChain's LongContextReorder and LlamaIndex's LongContextReorder both put the most relevant chunks at the two ends . Haystack's LostInTheMiddleRanker does the same . That is a lost-in-the-middle strategy, not document order. LlamaIndex's PrevNextNodePostprocessor splices neighbours in, but does not globally sort by position . Haystack's MetaFieldRanker can sort on a numeric position field, though its docs don't show that use . Store a position at ingestion time and sort on it explicitly.

Spend a real budget, then tune the peak. The ordering gain only appears once the budget holds many adjacent chunks: 5K tokens and up in the DOS RAG experiments . But more is not always better, so sweep budgets on your own data and pick the knee for your model .

Keep the rest of the prompt sensible. Vendor guidance agrees on documents first and question last for Anthropic and Google models . OpenAI's GPT-4.1 guide suggests instructions both before and after long context, and found XML-style delimiters worked better than JSON . None of these guides says anything about ordering chunks among themselves. DOS RAG fills that gap and sits comfortably inside all of them.

Improve selection and ordering separately. DOS RAG changes only what happens after selection. Anthropic reported that prepending generated context to each chunk cut top-20 retrieval failures by 35% to 67% depending on the stack . Late chunking and contextual embedding training attack the same lost-context problem at embedding time . These are complementary in principle, but nobody has published the combination.

For multi-document corpora, group then sort. The natural extension is to group retrieved chunks by source document and order each group internally. That extension is untested. Measure it against plain relevance order before you trust it.

Know what long context costs you. Pricing now varies more than the "long context is expensive" folklore suggests. Most current Claude models bill a 900K-token request at the same per-token rate as a short one . Gemini Pro-tier pricing doubles every token once input passes 200K . DOS RAG's 5K to 40K budgets sit below every such threshold. The DOS RAG paper itself did not measure end-to-end cost or latency .

Part 7

Where the evidence disagrees

Chunks or summaries? DOS RAG found raw chunks beat RAPTOR's summary tree every time . Another team found summaries did about as well as reading everything. Plain chunks did worse . Their tests, AIs and setups were different. DOS RAG also built RAPTOR's tree with the cheaper AI . The other team never tried book order . So neither result cancels the other.

Read everything, or pick pieces? One team said reading everything wins if you can afford it . OP-RAG and DOS RAG say picking pieces in book order can match or beat it . A careful 2025 study says there is no single winner. It depends on the AI, the length and the task . Much of the fight comes down to setup. The "read everything wins" team only picked five pieces, "best first" . OP-RAG showed that is where order matters least .

Which order is best? "Most important first" , "best at both ends" , "best last" and book order have each won somewhere. The simplest answer is that they won in different places. The first three won with short piles from many sources. Book order won with one long book and a big budget. We found no study that tests all four on the same one-book test.

Did the AI already know the books? Two of the tests use old, free books. AIs have memorised many popular books. They do better on books they remember . On brand-new novels that need whole-book thinking, GPT-4o scored only 55.8% . Nobody has measured this for DOS RAG's tests. So be careful with the exact scores. It should affect every system in the table about equally, though.

Part 8

What this means for builders

Use DOS RAG as your starting point. It is almost free to add. If you store each chunk's place in the book, sorting is one line . If a fancy new system can't beat it, the fancy parts aren't earning their keep .

Check what your tool's "reorder" does. Two popular tools both have a "LongContextReorder". It puts the best chunks at the two ends . A third tool does the same . That fixes the "middle gets forgotten" problem. It is not book order. One tool can add a chunk's neighbours, but it does not sort the whole pile . Another can sort by a number you store, though its guide does not show this . So save each chunk's place when you load it, and sort on that.

Use a real budget, then find the peak. Order only helps when many neighbour chunks fit. In the tests, that meant 5,000 tokens or more . But more is not always better. Try different budgets on your own data, and pick the best one .

Keep the rest of the prompt tidy. One AI company says to put the documents first and the question last . Another says to put instructions before and after the reading. It also found tags worked better than JSON . None of these guides says how to order the chunks themselves. DOS RAG fills that gap. It fits with all of their advice.

Improve finding and sorting separately. DOS RAG only changes what happens after the chunks are found. One company added a short note to each chunk about where it came from. That cut search misses by 35% to 67% . Other ideas help chunks remember their surroundings too . These could work together with DOS RAG. Nobody has tested that yet.

For many documents, group them, then sort. A natural idea is to group chunks by document. Then sort each group in its own order. Nobody has tested this. Check it against "best first" before you trust it.

Know what long reading costs. Prices are not always what people think. Most current Claude AIs charge the same rate per word for very long and short requests . Google's top Gemini AIs charge double per word past 200,000 tokens . DOS RAG's budgets stay well under those limits. The DOS RAG team did not measure full costs or speed .

Three things called reorderingFive chunks ranked 1 to 5 sit at document positions 8, 3, 11, 4 and 7. Relevance order: ranks 1 to 5. Ends-first: ranks 1, 3, 5, 4, 2, with the best at both ends. Document order: positions 3, 4, 7, 8, 11.Three things called “reordering”The same five retrieved chunks, as each strategy lays them out before the questionRelevance orderthe default in most retrieversRelevance order: slot 1 holds chunk 8 (rank 1)rank 1§8Relevance order: slot 2 holds chunk 3 (rank 2)rank 2§3Relevance order: slot 3 holds chunk 11 (rank 3)rank 3§11Relevance order: slot 4 holds chunk 4 (rank 4)rank 4§4Relevance order: slot 5 holds chunk 7 (rank 5)rank 5§7questionbest firstEnds-firstLangChain / LlamaIndex LongContextReorder, Haystack LostInTheMiddleRankerEnds-first: slot 1 holds chunk 8 (rank 1)rank 1§8Ends-first: slot 2 holds chunk 11 (rank 3)rank 3§11Ends-first: slot 3 holds chunk 7 (rank 5)rank 5§7Ends-first: slot 4 holds chunk 4 (rank 4)rank 4§4Ends-first: slot 5 holds chunk 3 (rank 2)rank 2§3questionbest at both endsDocument orderDOS RAG / OP-RAG: sort by chunk indexDocument order: slot 1 holds chunk 3 (rank 2)rank 2§3Document order: slot 2 holds chunk 4 (rank 4)rank 4§4Document order: slot 3 holds chunk 7 (rank 5)rank 5§7Document order: slot 4 holds chunk 8 (rank 1)rank 1§8Document order: slot 5 holds chunk 11 (rank 3)rank 3§11questionreads as written
Figure 6. Three orderings of the same retrieved chunks. The popular framework 'reorder' utilities implement the middle row, not the bottom one. Illustrative example.Three ways to line up the same pieces. Popular tools do the middle one. DOS RAG does the bottom one. Source: SVG
Part 9

Open questions & opportunities

Everything in this section is speculation or a proposed experiment, not a finding.

  • Isolate the mechanism. A shuffled-order arm, and an arm that keeps adjacent chunk pairs but shuffles the pairs, would separate "global narrative order" from "local adjacency". This experiment is cheap and has not been published.
  • Test across model families. Every DOS RAG number comes from two OpenAI readers and one embedder . Reproducing ∞Bench with open-weight readers, as FB-RAG did for OP-RAG , is the obvious next replication.
  • Test where order is ambiguous. Conversations, code repositories, legal bundles and email threads have partial orders: by time, by file, by thread. Which order should DOS use there?
  • Combine with better selection. DOS RAG plus contextual retrieval or late chunking is untested .
  • Predict the peak. Can the best budget be estimated from a model's effective context length, instead of swept? OP-RAG's observation that larger models peak later hints at a relationship .
Part 10

Limitations of this review

  • The core evidence is narrow. Most of the strongest numbers come from one peer-reviewed paper with two closed readers and one embedder, and from one preprint plus one re-implementation of its precursor .
  • The OP-RAG replication has a loose end. FB-RAG's re-implemented En.MC scores (81.22 and 85.59) coincide exactly with values that appear elsewhere in OP-RAG's own results . This may be coincidence. We report the En.QA replication with more confidence.
  • Independent use of DOS RAG is thin, recent and mixed. The two baseline studies we found are 2026 preprints with small budgets and authors comparing against their own methods .
  • Several cited sources were read at abstract level only. These include the attention-sorting, positional-shift and long-context-revisit papers. We used them only for their headline claims.
  • Vendor material is self-reported. The Chroma, Anthropic Contextual Retrieval and pricing sources are vendor documents. Prices are as retrieved on 23 November 2026 and will change.
  • Coverage gaps. We could not query Semantic Scholar's citation graph directly, so some 2025–2026 papers that use DOS RAG as a baseline may be missing.
  • Contamination is unmeasured. The memorisation concern for the book benchmarks is inferred from adjacent work, not measured for these benchmarks .
Part 11

Method

Date. Research conducted 23 November 2026.

Lines of inquiry. Five parallel lines: foundations (position bias, the long-context-versus-RAG debate, and the complex baselines); frontier (the DOS RAG paper and work citing it, 2024–2026); evidence and benchmarks (extracting every reported number); critique (failure modes, negative results, benchmark validity); and applied (code, frameworks, vendor guidance and pricing).

Sources searched. ACL Anthology, arXiv (abstract and HTML full text), OpenReview, PMLR, ICLR and EMNLP proceedings, GitHub source code, and official vendor documentation. Queries included "DOS RAG", "document original structure", "order-preserving RAG", "OP-RAG replication", "lost in the middle 2025", "positional bias RAG", "long context vs RAG", "LongContextReorder" and "LostInTheMiddleRanker".

Inclusion. We included primary research on chunk ordering, position bias and long-context-versus-RAG comparisons; the papers for the baselines DOS RAG was tested against; and official documentation for tooling and pricing. News and blogs were used only for leads. Roughly 190 items were screened (including about 70 papers citing OP-RAG, screened by title), and 38 were included.

Verification. An independent verification pass, separate from the drafting, re-opened every source. It checked bibliographic metadata, confirmed each excerpt verbatim at its locator, and checked every number against the source tables. It checked all 40 candidate sources. It corrected metadata, locators or claim wording for 23 of the 38 cited sources, found peer-reviewed versions of four preprints (LongBench v2, the multi-hop ordering study, LongPiBench and ConTEB), and dropped none. It caught two claims we had understated or blurred: LongBench v2's order-preserving RAG beat full context by 4.1 points for Qwen2.5, not 'slightly', and StateRAG's token figures mixed two methods. Two candidate sources were not needed and are not cited.

Grading. Strong: replicated or several independent peer-reviewed sources. Moderate: one solid peer-reviewed source or consistent preprints. Emerging: preprints or single studies. Contested: credible sources conflict.

Part 9

Open questions & opportunities

Everything here is a guess or an idea to test. None of it is a finding.

  • Find out why it works. Try a shuffled order. Also try keeping neighbour pairs together but shuffling the pairs. That would show whether the whole story order matters, or just neighbours. It would be cheap to do.
  • Try other AIs. Every DOS RAG score came from two OpenAI AIs and one search tool . Someone should rerun it with open AIs, like a team did for OP-RAG .
  • Try messy orders. Chats, code, legal files and email threads have more than one order. They can go by time, by file or by thread. Which order should DOS use?
  • Combine it with better finding. Nobody has tested DOS RAG with smarter chunk notes yet .
  • Guess the peak. Could we predict the best budget for each AI, instead of testing them all? Bigger AIs peaked later, which is a hint .
Part 10

Limitations of this review

  • The main proof is narrow. Most of the best numbers come from one checked paper. It used two closed AIs and one search tool. The rest come from one unchecked paper and one rebuild of it .
  • One check has a loose end. Some scores from the team that rebuilt OP-RAG match other OP-RAG numbers exactly . That might be chance. We trust their other scores more.
  • Outside checks are few and mixed. The two other teams we found are new, unchecked papers. They used small budgets and were testing their own methods .
  • Some papers we only read in summary. We used those only for their main claims.
  • Company sources speak for themselves. Some sources are company reports and price pages. Prices are from 23 November 2026 and will change.
  • We may have missed papers. One big paper search tool did not work for us. So some 2025–2026 papers may be missing.
  • The "already knew the books" worry is untested. It comes from nearby studies, not from these tests .
Part 11

Method

Date. We did this research on 23 November 2026.

Lines of inquiry. We followed five lines. One looked at the history. One looked at the newest work. One gathered every number. One hunted for problems and failures. One looked at code, tools, guides and prices.

Where we searched. We searched big research libraries, conference papers, code on GitHub and official company guides. Our searches included "DOS RAG", "order-preserving RAG", "lost in the middle" and "long context vs RAG".

What we kept. We kept research on chunk order, the middle problem, and reading everything versus picking pieces. We kept the papers for the systems DOS RAG was tested against. We also kept official guides for tools and prices. We only used news and blogs to find leads. We screened about 190 items and kept 38.

Checking. A separate checking pass reopened every source. It checked the paper details. It checked that each quote really appears where we say. It checked every number against the paper's tables. It checked all 40 sources we found. It fixed small details for 23 of the 38 we use. It found that four unchecked papers had since been checked and published. It threw nothing out. It also caught two places where we had a number a bit wrong, and we fixed them.

Grading. Strong means repeated, or backed by several checked papers. Moderate means one solid checked paper, or several unchecked papers that agree. Emerging means unchecked papers or single studies. Contested means good sources disagree.

Back matter

References

APA 7 style. Each entry gives its peer-review status, the claim it supports in this article, and a short verbatim excerpt with its location in the source. Select any [n] in the text to see the entry in a pop-up.

  1. Laitenberger, A., Manning, C. D., & Liu, N. F. (2025). Stronger baselines for retrieval-augmented generation with long-context language models. In Proceedings of EMNLP 2025 (Main), pp. 32559–32569. doi:10.18653/v1/2025.emnlp-main.1656. arXiv:2506.03989. https://aclanthology.org/2025.emnlp-main.1656/

    Peer-reviewed · conferenceEvidence: strong

    Supports: DOS RAG = vanilla retrieve-then-read (≤100-token sentence-respecting chunks, Snowflake Arctic-embed-m 1.5, cosine top chunks filled to a token budget) with selected chunks re-sorted into original document order. ∞Bench En.MC GPT-4o (Table 2): DOS 75.6/85.9/90.0/91.4/93.1/91.9 vs Vanilla 76.2/82.6/86.0/86.9/87.8/86.6 vs RAPTOR 73.8/79.0/82.4/84.4/85.0/85.9 at 1.5K/5K/10K/20K/30K/40K; ReadAgent 90.3 at ~86K tokens. GPT-4o-mini (Table 1): DOS 68.9/78.9/84.1/83.6/82.5/81.6; Vanilla 69.9/73.9/76.0/77.0/77.8/77.2; RAPTOR 65.6/71.6/75.0/75.2/75.6/75.3; ReadAgent 76.2. QuALITY GPT-4o (Table 4) at 8K: DOS 90.4, Vanilla 85.9, RAPTOR 84.9; full doc 91.2; ReadAgent 87.4 (~4.2K). QuALITY GPT-4o-mini (Table 3) 8K: DOS 81.2, Vanilla 76.6, RAPTOR 76.3, ReadAgent 79.7 (~4.8K), full doc 81.0. NarrativeQA GPT-4o-mini F1 (Table 5) at 20K: DOS 22.1, Vanilla 19.2, RAPTOR 17.3; ReadAgent 21.0 (~34K). Limitations: single-document MC/short-answer reading comprehension; no multi-document; no end-to-end cost measured. Readers GPT-4o-2024-11-20 and GPT-4o-mini-2024-07-18, greedy, mean±sd over 5 runs. Datasets: ∞Bench En.MC 229 Q / 58 docs avg ~184K tokens; QuALITY dev 2,086 Q; NarrativeQA test 10,391 Q.

    “we recommend establishing DOS RAG as a simple yet strong baseline”

    Abstract; Conclusion (excerpt); §2.1 (datasets); §2.3 (baselines, chunking, embedder); Tables 1–5; Limitations
  2. Yu, T., Xu, A., & Akkiraju, R. (2024). In defense of RAG in the era of long-context language models. arXiv:2409.01666. https://arxiv.org/abs/2409.01666

    Preprint · not peer-reviewedEvidence: moderate

    Supports: OP-RAG: same top-k chunks (128-token, BGE-large-en-v1.5) re-sorted into original order. ∞Bench Table 1: Llama3.1-70B long context 34.26 F1 En.QA / 71.62 En.MC at 117K; GPT-4o LC 32.36/78.42; Gemini-1.5-Pro LC 43.08/85.57; OP-RAG Llama3.1-70B 16K 44.43/84.72, 24K 45.45/88.65, 48K 47.25/85.59. Order ablation: En.QA at 128 chunks vanilla 38.40 vs OP 44.43; En.MC at 192 chunks 81.22 vs 88.65; small gap at few chunks. Inverted-U in chunk count.

    “We preserve the order of chunks in the original long context”

    §3; §4.3 (Fig. 4); Table 1
  3. Chawla, K., Samuel, A., Kumar, A., & Liu, D. (2025). FB-RAG: Improving RAG with forward and backward lookup. In Findings of the Association for Computational Linguistics: IJCNLP-AACL 2025, pp. 1055–1071. doi:10.18653/v1/2025.findings-ijcnlp.62. arXiv:2505.17206. https://aclanthology.org/2025.findings-ijcnlp.62

    Peer-reviewed · conferenceEvidence: moderate

    Supports: Independent OP-RAG re-implementation with Llama3.1-70B-Instruct on ∞Bench (Table 2): 16K 47.87 F1 En.QA / 81.22 acc En.MC; 24K 48.27 / 85.59, vs long context 34.26 / 71.62. On LongBench average (Table 1): OP 48.03 vs vanilla 47.09 at 3K; 48.75 vs 48.59 at 6K; full long context 49.28.

    “selected chunks from the retriever are first sorted in their original ordering”

    §3; Table 1 (LongBench); Table 2 (∞Bench)
  4. Jin, B., Yoon, J., Han, J., & Arik, S. O. (2025). Long-context LLMs meet RAG: Overcoming challenges for long inputs in RAG. In Proceedings of ICLR 2025. arXiv:2410.05983. https://arxiv.org/abs/2410.05983

    Peer-reviewed · conferenceEvidence: strong

    Supports: More retrieved passages first helps then hurts (inverted-U), especially with strong retriever (e5); hard negatives from stronger retrievers hurt more; training-free fix places highest-score passages at start and end; gains matter mainly when many passages retrieved. Open-domain NQ/PopQA.

    “LLMs struggle more with hard negatives from stronger retrievers”

    §3.1–3.3; §4 (Fig. 4)
  5. Niu, M., Liu, X., Zhao, R., Li, P., Zhu, J., & Xiao, T. (2026). StateRAG: Typed state contracts for complex retrieval-augmented generation. arXiv:2605.25379 (v4, 11 November 2026). https://arxiv.org/abs/2605.25379

    Preprint · not peer-reviewedEvidence: emerging

    Supports: DOS RAG as a baseline with a Qwen2.5-14B reader (mean ~1.0–1.4K reader-equivalent tokens per query for DOS RAG, ~1.1–1.8K for StateRAG): HotpotQA 43.1 vs 50.0, 2WikiMQA 43.1 vs 59.3, MuSiQue 21.1 vs 34.0 F1 against the authors' StateRAG (Table 2).

    “DOS RAG preserves the original document order of retrieved passages”

    Related work; Table 2
  6. LangChain. (2026). LongContextReorder (langchain_community/document_transformers/long_context_reorder.py) [Source code]. Retrieved 23 November 2026. https://github.com/langchain-ai/langchain-community/blob/main/libs/community/langchain_community/document_transformers/long_context_reorder.py

    Official documentationEvidence: strong

    Supports: LongContextReorder applies the lost-in-the-middle 'ends-first' ordering to a relevance-ranked list; it reads no position metadata.

    “less relevant documents will be at the middle of the list”

    _litm_reordering docstring
  7. LlamaIndex. (2026). Node postprocessor modules (llama_index/core/postprocessor/node.py). Retrieved 23 November 2026. https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/postprocessor/node.py

    Official documentationEvidence: strong

    Supports: LongContextReorder puts highest scores at the ends; PrevNextNodePostprocessor splices neighbour chunks; no built-in sort by document position.

    “best performance typically arises when crucial data is positioned at the start or conclusion”

    LongContextReorder docstring
  8. deepset. (2026). LostInTheMiddleRanker and MetaFieldRanker. Haystack documentation. Retrieved 23 November 2026. https://docs.haystack.deepset.ai/docs/lostinthemiddleranker

    Official documentationEvidence: moderate

    Supports: LostInTheMiddleRanker places the most relevant documents at the beginning and end; MetaFieldRanker can sort on any metadata field.

    “positions the most relevant documents at the beginning and at the end”

    LostInTheMiddleRanker overview
  9. Laitenberger, A. (2025–2026). dos-rag-eval and stronger-baselines-rag [Source code]. GitHub. Retrieved 23 November 2026. https://github.com/alex-laitenberger/dos-rag-eval

    Official documentationEvidence: strong

    Supports: Official code; the DOS step is a single sort of the budget-selected chunks by their index in the document. Selection stops at the first chunk that would exceed the budget.

    “sorted(selected_nodes, key=lambda node: node.index)”

    source/method/RAG.py, ~line 187
  10. Sarthi, P., Abdullah, S., Tuli, A., Khanna, S., Goldie, A., & Manning, C. D. (2024). RAPTOR: Recursive abstractive processing for tree-organized retrieval. In Proceedings of ICLR 2024. arXiv:2401.18059. https://arxiv.org/abs/2401.18059

    Peer-reviewed · conferenceEvidence: strong

    Supports: Clusters ~100-token chunks (UMAP + GMM), summarises clusters recursively into a tree; collapsed-tree retrieval pools all nodes to a 2,000-token budget; QuALITY test 82.6% with GPT-4.

    “The collapsed tree approach consistently performs better”

    §3; §4; Table 7
  11. Lee, K.-H., Chen, X., Furuta, H., Canny, J., & Fischer, I. (2024). A human-inspired reading agent with gist memory of very long contexts. In Proceedings of ICML 2024, PMLR 235:26396–26415. arXiv:2402.09727. https://proceedings.mlr.press/v235/lee24c.html

    Peer-reviewed · conferenceEvidence: strong

    Supports: LLM paginates text, writes a gist per page, then looks up raw pages; expanded pages reinserted in place. QuALITY dev with PaLM 2-L: ReadAgent-S 87.17 vs full text 85.83 vs top-4 neural retrieval 84.88.

    “preserving the overall narrative flow”

    §3.1–3.2; Table 1
  12. Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12, 157–173. doi:10.1162/tacl_a_00638. https://aclanthology.org/2024.tacl-1.9/

    Peer-reviewed · journalEvidence: strong

    Supports: U-shaped accuracy vs gold-passage position in multi-document QA; GPT-3.5-Turbo with 20 docs: 75.8% at position 1 vs 53.8% mid (below closed-book 56.1%); going from 20 to 50 retrieved docs adds only ~1.5% (GPT-3.5-Turbo) / ~1% (Claude-1.3).

    “distinctive U-shaped performance curve”

    Fig. 1; §2.3; §5
  13. Xu, P., Ping, W., Wu, X., McAfee, L., Zhu, C., Liu, Z., Subramanian, S., Bakhturina, E., Shoeybi, M., & Catanzaro, B. (2024). Retrieval meets long context large language models. In Proceedings of ICLR 2024. arXiv:2310.03025. https://arxiv.org/abs/2310.03025

    Peer-reviewed · conferenceEvidence: strong

    Supports: Retrieval-augmented 4K model ~matches 16K long-context model; retrieval helps at every context size; Llama2-70B-32k-ret 43.6 avg vs GPT-3.5-turbo-16k 42.8 (Table 3); chunks ordered most-to-least relevant; more than top-5/10 chunks did not help.

    “adding more chunks up to 20 is not helpful and will sometime hurt”

    §3.4; §4.4; Tables 2–3
  14. Li, Z., Li, C., Zhang, M., Mei, Q., & Bendersky, M. (2024). Retrieval augmented generation or long-context LLMs? A comprehensive study and hybrid approach. In Proceedings of EMNLP 2024: Industry Track, pp. 881–893. doi:10.18653/v1/2024.emnlp-industry.66. arXiv:2407.16833. https://aclanthology.org/2024.emnlp-industry.66/

    Peer-reviewed · conferenceEvidence: moderate

    Supports: With k=5 300-word chunks ordered by similarity, long context beats RAG on average (Table 1: Gemini-1.5-Pro 49.70 vs 37.33; GPT-4o 48.67 vs 32.60); Self-Route reaches 46.41 / 48.89 using 38.39% / 61.40% of LC tokens; 63% of queries get identical predictions; RAG failures: multi-step, general, long/complex, implicit queries.

    “The chunks are ordered by the similarity scores”

    §3.2; Table 1; §4.1; §5.2
  15. Jiang, H., Wu, Q., Luo, X., Li, D., Lin, C.-Y., Yang, Y., & Qiu, L. (2024). LongLLMLingua: Accelerating and enhancing LLMs in long context scenarios via prompt compression. In Proceedings of ACL 2024 (Vol. 1), pp. 1658–1677. doi:10.18653/v1/2024.acl-long.91. https://aclanthology.org/2024.acl-long.91

    Peer-reviewed · conferenceEvidence: moderate

    Supports: Compresses retrieved documents and reorders the surviving documents by a question-conditioned importance score, motivated by models performing best when relevant information comes first (lost in the middle).

    “reorder documents using their importance scores”

    §4.2
  16. Peysakhovich, A., & Lerer, A. (2023). Attention sorting combats recency bias in long context language models. arXiv:2310.01427. https://arxiv.org/abs/2310.01427

    Preprint · not peer-reviewedEvidence: emerging

    Supports: Decode one step, sort documents by attention received (most-attended last), repeat, then generate; improves long-context QA.

    “perform one step of decoding, sort documents by the attention they receive”

    Abstract
  17. Bai, Y., Tu, S., Zhang, J., Peng, H., Wang, X., Lv, X., Cao, S., Xu, J., Hou, L., Dong, Y., Tang, J., & Li, J. (2025). LongBench v2: Towards deeper understanding and reasoning on realistic long-context multitasks. In Proceedings of ACL 2025 (Vol. 1: Long Papers), pp. 3639–3664. doi:10.18653/v1/2025.acl-long.183. https://aclanthology.org/2025.acl-long.183/

    Peer-reviewed · conferenceEvidence: moderate

    Supports: Its RAG baseline concatenates retrieved 512-token chunks in original order; Qwen2.5 and GLM-4-Plus gain little beyond ~32K retrieved tokens and score higher there than with full 128K context (Qwen2.5 +4.1); GPT-4o still trails its no-RAG score (−0.6); questions cannot be solved solely through retrieval.

    “in their original order to form the context input”

    §4.2; Fig. 4
  18. Hsieh, C.-Y., Chuang, Y.-S., Li, C.-L., Wang, Z., Le, L., Kumar, A., Glass, J., Ratner, A., Lee, C.-Y., Krishna, R., & Pfister, T. (2024). Found in the middle: Calibrating positional attention bias improves long context utilization. In Findings of ACL 2024, pp. 14982–14995. doi:10.18653/v1/2024.findings-acl.890. https://aclanthology.org/2024.findings-acl.890/

    Peer-reviewed · conferenceEvidence: moderate

    Supports: Lost-in-the-middle tied to a U-shaped attention bias (beginning and end tokens get more attention regardless of relevance); calibrating it improves RAG, outperforming existing methods by up to 10 percentage points.

    “U-shaped attention bias”

    Abstract
  19. Tian, R., Li, Y., Fu, Y., Deng, S., Luo, Q., Qian, C., Wang, S., Cong, X., Zhang, Z., Wu, Y., Lin, Y., Wang, H., & Liu, X. (2025). Distance between relevant information pieces causes bias in long-context LLMs. In Findings of ACL 2025, pp. 521–533. doi:10.18653/v1/2025.findings-acl.28. arXiv:2410.14641. https://aclanthology.org/2025.findings-acl.28/

    Peer-reviewed · conferenceEvidence: emerging

    Supports: Most current models are more robust to classic lost-in-the-middle, but show noticeable biases related to the spacing between multiple relevant pieces (LongPiBench).

    “most current models are more robust against the "lost in the middle" issue”

    Abstract (ACL Findings version)
  20. Veseli, B., Chibane, J., Toneva, M., & Koller, A. (2025). Positional biases shift as inputs approach context window limits. In Proceedings of COLM 2025. arXiv:2508.07479. https://arxiv.org/abs/2508.07479

    Peer-reviewed · conferenceEvidence: moderate

    Supports: Lost-in-the-middle strongest when input fills up to ~50% of the window; beyond that primacy weakens, recency stays.

    “the LiM effect is strongest when inputs occupy up to 50%”

    Abstract
  21. Cuconasu, F., Filice, S., Horowitz, G., Maarek, Y., & Silvestri, F. (2025). Do RAG systems really suffer from positional bias? In Proceedings of EMNLP 2025 (Main), pp. 28022–28036. arXiv:2505.15561. https://aclanthology.org/2025.emnlp-main.1422/

    Peer-reviewed · conferenceEvidence: strong

    Supports: With real retrievers and k=5–10 open-domain passages, random ordering is statistically equivalent to relevance-aware rearrangement; >60% of queries have a highly distracting passage in the top 10.

    “random ordering of retrieved passages yields statistically equivalent accuracy”

    §5 (k=5 Tables 2–3; k=10 App. B.2); §6 Conclusions (excerpt); Abstract (>60%)
  22. Yu, S., Kim, I., Song, J., Lee, S., Park, J., & Yoon, S. (2025). Unleashing multi-hop reasoning potential in large language models through repetition of misordered context. In Findings of the ACL: NAACL 2025, pp. 6450–6470. doi:10.18653/v1/2025.findings-naacl.360. arXiv:2410.07103. https://aclanthology.org/2025.findings-naacl.360/

    Peer-reviewed · conferenceEvidence: emerging

    Supports: In multi-hop QA (MuSiQue, gold documents only), accuracy depends on whether supporting documents appear in reasoning-chain order; best-vs-worst order gap ≥10 F1, up to 26 with more hops (Llama-3.1-8B, Mistral-7B, Qwen2.5-7B, Phi-3.5-mini).

    “the performance gap between the best and worst cases is consistently pronounced”

    §3.1; Fig. 2
  23. Hong, K., Troynikov, A., & Huber, J. (2025, July 14). Context rot: How increasing input tokens impacts LLM performance. Chroma Research. https://www.trychroma.com/research/context-rot

    Vendor technical reportEvidence: emerging

    Supports: Across 18 models, needle retrieval did better on shuffled haystacks than logically coherent ones; performance degrades as input length grows.

    “structural coherence consistently hurts model performance”

    Haystack structure section
  24. Gabín, J., Perez, A., & Parapar, J. (2026). Lost in the evidence? Reproducing document position and context size effects in RAG. In Proceedings of SIGIR 2026. doi:10.1145/3805712.3808569. arXiv:2605.27105. https://arxiv.org/abs/2605.27105

    Peer-reviewed · conferenceEvidence: moderate

    Supports: Reproducibility study on open-domain QA (HotpotQA, NQ): ordering and context size matter; reverse score order (most relevant last) increasingly wins at larger contexts on HotpotQA, while NQ is order-stable; larger models more stable; strategies tested were standard, reverse and random (no document-order arm).

    “the reverse scheme increasingly outperforms other strategies at larger contexts”

    §5.1; Fig. 6
  25. Sun, X., Xu, T., Xie, B., Zhang, J., Huang, L., Gao, Q., & Zhang, K. (2026). M-RAG: Semantic key-value indexing for retrieval-augmented generation. arXiv:2603.26667. https://arxiv.org/abs/2603.26667

    Preprint · not peer-reviewedEvidence: emerging

    Supports: DOS RAG as a baseline (Qwen3-30B-A3B-Instruct-2507 generator, bge-m3 retriever, 128×5 tokens): 2WikiMQA 0.4110 F1 vs zero-shot M-RAG-P/-S 0.3494/0.3582; Qasper 0.2635 vs 0.2456/0.2655; NarrativeQA 0.1398 vs 0.1459/0.1476. With BM25, M-RAG-P beats DOS on 2WikiMQA.

    “preserving the original document structure can be a strong baseline”

    §I Introduction; Table II
  26. Banerjee, D., Aijaz, O., Tabassum, A., Xie, Z., Nakov, P., & Stoyanov, V. (2026). The bottleneck is retrieval, not reading: Diagnosing evidence-based generation with RAG for long context question answering. arXiv:2610.26951. https://arxiv.org/abs/2610.26951

    Preprint · not peer-reviewedEvidence: emerging

    Supports: On MultiHop-RAG at k=10, the retriever covers at least one gold fact for 82% of queries but all gold facts for only 19%.

    “covers all gold facts for only 19%”

    §5.2 (RQ1)
  27. Edge, D., Trinh, H., Cheng, N., Bradley, J., Chao, A., Mody, A., Truitt, S., Metropolitansky, D., Ness, R. O., & Larson, J. (2024). From local to global: A graph RAG approach to query-focused summarization. arXiv:2404.16130. https://arxiv.org/abs/2404.16130

    Preprint · not peer-reviewedEvidence: emerging

    Supports: On global sensemaking questions over two ~1M-token corpora, GraphRAG beats vector RAG on LLM-judged comprehensiveness (win rates 72–83% podcasts, 72–80% news) and diversity (75–82%, 62–71%); over a map-reduce source-text summarisation baseline its edge is small and not significant on claim-based metrics.

    “substantial improvements over a conventional RAG baseline”

    Abstract; §5.1–5.2
  28. Li, X., Cao, Y., Ma, Y., & Sun, A. (2024). Long context vs. RAG for LLMs: An evaluation and revisits. arXiv:2501.01880. https://arxiv.org/abs/2501.01880

    Preprint · not peer-reviewedEvidence: emerging

    Supports: LC generally beats RAG on QA, especially Wikipedia QA; summarisation-based retrieval comparable to LC while chunk-based retrieval lags.

    “chunk-based retrieval lags behind”

    Abstract
  29. Li, K., Zhang, L., Jiang, Y., Xie, P., Huang, F., Wang, S., & Cheng, M. (2025). LaRA: Benchmarking retrieval-augmented generation and long-context LLMs – No silver bullet for LC or RAG routing. In Proceedings of ICML 2025, PMLR 267:36846–36867. arXiv:2502.09977. https://proceedings.mlr.press/v267/li25dv.html

    Peer-reviewed · conferenceEvidence: strong

    Supports: Across 11 LLMs and 2,326 test cases, the better of RAG vs LC depends on model, length and task; LC ahead by 2.40 accuracy points on average at 32K, RAG ahead by 3.68 at 128K; RAG setup 5×600-token chunks.

    “the optimal choice between RAG and LC depends on a complex interplay of factors”

    Abstract; §1 Key Findings; Table 2 (Avg GAP)
  30. Chang, K. K., Cramer, M., Soni, S., & Bamman, D. (2023). Speak, memory: An archaeology of books known to ChatGPT/GPT-4. In Proceedings of EMNLP 2023, pp. 7312–7327. doi:10.18653/v1/2023.emnlp-main.453. https://aclanthology.org/2023.emnlp-main.453

    Peer-reviewed · conferenceEvidence: moderate

    Supports: OpenAI models have memorised many books, in proportion to their web frequency, and perform better downstream on memorised books.

    “degree of memorization is tied to the frequency with which passages”

    Abstract
  31. Karpinska, M., Thai, K., Lo, K., Goyal, T., & Iyyer, M. (2024). One thousand and one pairs: A "novel" challenge for long-context language models. In Proceedings of EMNLP 2024, pp. 17048–17085. doi:10.18653/v1/2024.emnlp-main.948. https://aclanthology.org/2024.emnlp-main.948

    Peer-reviewed · conferenceEvidence: strong

    Supports: On claim pairs about recently published novels, GPT-4o reached 55.8% pair accuracy; no open-weight model above chance; global reasoning claims harder.

    “no open-weight model performs above random chance”

    Abstract
  32. Anthropic. (2026). Prompting best practices: Long context prompting. Claude Platform documentation. Retrieved 23 November 2026. https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices

    Official documentationEvidence: moderate

    Supports: Put long documents at the top and the query at the end; wrap documents in tags with metadata; no guidance on ordering chunks among themselves.

    “Queries at the end can improve response quality by up to 30 percent”

    Long context prompting
  33. MacCallum, N., & Lee, J. (2025, April 14). GPT-4.1 prompting guide. OpenAI Cookbook (now archived). https://developers.openai.com/cookbook/examples/gpt4-1_prompting_guide

    Official documentationEvidence: moderate

    Supports: For long context, place instructions both before and after the context; if only once, above works better; XML-style delimiters worked well, JSON poorly.

    “JSON performed particularly poorly.”

    Long context section
  34. Anthropic. (2024, September 19). Introducing Contextual Retrieval. https://www.anthropic.com/news/contextual-retrieval

    Vendor technical reportEvidence: emerging

    Supports: Prepending 50–100 tokens of LLM-generated context per chunk cut top-20 retrieval failure by 35% (embeddings), 49% (+BM25), 67% (+reranking); recommends whole-corpus prompting under 200K tokens.

    “If your knowledge base is smaller than 200,000 tokens”

    Intro; results
  35. Günther, M., Mohr, I., Williams, D. J., Wang, B., & Xiao, H. (2024). Late chunking: Contextual chunk embeddings using long-context embedding models. arXiv:2409.04701. https://arxiv.org/abs/2409.04701

    Preprint · not peer-reviewedEvidence: emerging

    Supports: Embed the whole document with a long-context embedder, then pool per chunk, so chunk embeddings keep document context.

    “just before mean pooling”

    Abstract
  36. Conti, M., Faysse, M., Viaud, G., Bosselut, A., Hudelot, C., & Colombo, P. (2025). Context is gold to find the gold passage: Evaluating and training contextual document embeddings. In Proceedings of EMNLP 2025, pp. 22594–22608. doi:10.18653/v1/2025.emnlp-main.1150. arXiv:2505.24782. https://aclanthology.org/2025.emnlp-main.1150/

    Peer-reviewed · conferenceEvidence: emerging

    Supports: State-of-the-art embedders encode chunks independently and struggle when document-wide context is needed (ConTEB); contextual training helps.

    “encode passages (chunks) from the same documents independently”

    Abstract
  37. Anthropic. (2026). Pricing. Claude Platform documentation. Retrieved 23 November 2026. https://platform.claude.com/docs/en/about-claude/pricing

    Official documentationEvidence: strong

    Supports: Claude 4.6 and later models (except Haiku 5.5) bill the full 1M window at the same per-token rate; Haiku 5.5 charges more for prompts over 100K tokens. Cache reads cost 0.1× base input on most models (lower on some).

    “A 900k-token request is billed at the same per-token rate”

    Long context pricing
  38. Google Cloud. (2026). Vertex AI generative AI pricing. Retrieved 23 November 2026. https://cloud.google.com/vertex-ai/generative-ai/pricing

    Official documentationEvidence: strong

    Supports: Gemini Pro-tier pricing rises above 200K input tokens and then applies to all tokens of the request: input doubles (2.5 Pro $1.25 → $2.50 per million; 3.1 Pro Preview $2.00 → $4.00) and output rises 1.5×.

    “all tokens (input and output) are charged at long context rates”

    Gemini pricing table
Pico in pyjamas dozing, wrapped in her tails, holding a mug

That's the deep dive. Pico's putting her own notes back in order and then taking a nap. Every source is above, so go check her work.That's the deep dive! I'm putting my notes back in order, then taking a nap. All the sources are above, so go and check my work.