FDEInterviews logo
EMNLP 2024

Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach

The 2024 Google DeepMind study that found long context beats RAG on quality, RAG wins on cost, and a model that says when it cannot answer can route between them.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2024
AUTHORS
Li, Li, Zhang, Mei, Bendersky
FROM
Google DeepMind, University of Michigan
PUBLISHED
Jul 2024 · EMNLP 2024
CITED BY
193Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 19% of this breakdown.

01

The paper in one minute

When Gemini 1.5 accepted a million tokens and GPT-4o 128,000, a real question opened up: why build retrieval at all? Earlier comparisons had found retrieval winning, but they used weaker models and shorter contexts.

Google DeepMind and the University of Michigan reran the comparison with Gemini-1.5-Pro, GPT-4o and GPT-3.5-Turbo on nine long-document tasks from LongBench and ∞Bench: question answering over stories, papers and Wikipedia, multi-hop questions, and meeting summarization. Long context (LC) meant sending the whole document. RAG meant splitting it into 300-word chunks and sending the five most similar to the question.

Long context won on quality, by 7.6 points on average for Gemini, 13.1 for GPT-4o and 3.6 for GPT-3.5-Turbo. But two other observations shaped the paper. RAG costs a fraction of the tokens. And for 63% of queries the two methods produced exactly the same answer, right or wrong.

So the authors proposed Self-Route. First, answer with RAG, but let the model reply "unanswerable" if the retrieved chunks are not enough. Only for those queries, send the full context. Most queries stopped at the first step, and the overall score landed close to long context at well under the cost: 38% of the tokens for Gemini, 61% for GPT-4o, with GPT-3.5-Turbo actually scoring higher than either method alone.

THE IDEA, VISUALLY
SELF-ROUTE: TRY CHEAP FIRST, ESCALATE WHEN THE MODEL SAYS IT CANNOT Query Retrieve top 5 ~300-word chunks Answer, or reply “unanswerable” answerable: 57 to 77% of queries RAG answer unanswerable Full context long call Most queries never pay for the long context. RAG and long-context answers were identical on 63% of queries. AVERAGE SCORE, NINE DATASETS Table 1, Contriever retriever 46.4 38% tok Gemini-1.5-Pro 48.9 61% tok GPT-4o 35.3 39% tok GPT-3.5-Turbo long context RAG Self-Route
Try the cheap path, escalate on doubt. Retrieval answers most queries; the model's own admission that it cannot answer from the chunks decides when to pay for the full context.
Research notes: the problem, approach and results
63%

of queries where RAG and long context gave exactly the same answer

38%

of long-context tokens used by Self-Route on Gemini-1.5-Pro, scoring 46.4 against 49.7

80% → 5%

RAG accuracy on a hidden-passkey test when the question was reworded, while long context stayed near 70%

THE PROBLEM

With context windows of 128K to a million tokens, teams had to decide: retrieve a few passages, or send the whole document every time?

THE IDEA

Benchmark both on the same tasks with current models, then route: answer from retrieved chunks, let the model say "unanswerable", and only then send the full context.

THE RESULT

Long context scored higher on average, RAG cost far less, and routing kept most of the quality at 38% to 61% of the tokens.

02

Why it matters to an FDE

"Should we just put the whole document in the prompt?" comes up on every document-heavy project. This paper gives you a measured answer to bring to the conversation.

Quality and cost pull in opposite directions. Long context was better on average with strong models. RAG was dramatically cheaper because pricing follows input tokens. Neither is "right"; the choice is a budget decision.

You do not have to choose once. The routing idea is simple to build: give the model the retrieved chunks and permission to say it cannot answer. Escalate only those queries. On the paper's tasks, 57% to 77% of queries never needed the long call. That is the kind of design that makes a pilot's unit economics work in production.

Retrieval is fragile to wording. The most striking result is small. On a test where a passkey is hidden in long filler text, RAG found it 80% of the time when asked "What is the passkey?" Reword the question as "What is the special token hidden inside the texts?" and RAG dropped to under 5%, while long context barely moved. Retrieval depends on the question sharing words or meaning with the passage. Users rarely phrase questions the way documents are written.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 49 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦3 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The ideas to keep, why RAG fails, the cost arithmetic and the misreadings to avoid

    Free account
  2. 04How it works

    The benchmark setup, the routing prompt, the k trade-off and the synthetic-data trap, with a diagram

    Premium
  3. 05The numbers that matter

    The comparison by model, routing rates, token savings and two figures the paper contradicts

    Premium
  4. 06Try it yourself

    The routing rule and a calculator for what it saves at your document sizes

    Premium
  5. 07Where it breaks

    The study's limits and what to watch when you deploy routing

    Premium
  6. 08Using it on a deployment

    Deciding between retrieval, long context and routing for a customer's documents

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →