Summaries and Search Match 200K Context Windows at Fraction of Cost

The lazy pitch was to dump entire codebases into 200k-token prompts. Nvidia ran the test everyone avoided: does a simple summary plus keyword search actually match it?

Summaries and Search Match 200K Context Windows at Fraction of Cost

Nvidia researchers tested simple retrieval against full-context RAG and found performance parity at dramatically lower cost, if you know which tasks need which approach.

The pitch was always seductive in its laziness: stop building a retrieval pipeline, just paste the whole codebase into the prompt. Why chunk, embed, rank, and re-rank when the model will “read” all 200,000 tokens for you? Dump the docs in, ask your question, go to lunch.

A group of Nvidia researchers ran the obvious experiment anyway, and the result confirms what you suspected but kept paying to avoid testing. They pitted an agent that keeps a periodic running summary plus a targeted keyword search against the brute-force approach of shoving the full corpus into a long context window. On retrieval-style tasks the two tied. The cheap one cost a fraction as much. That’s the whole story, and it’s enough to change how you build.

Before anyone forwards this to their VP as “long context is dead,” two caveats that the headline won’t carry. First, Nvidia sells inference hardware whose economics look better when you’re running more, smaller requests instead of one enormous one, read their framing with that in mind, then notice the test still reproduces on anyone’s hardware. Second, “dead end” is the-decoder’s phrasing doing some work. The finding isn’t that long context is useless. It’s that bigger is not free, not always better, and frequently not even as good. Those are different claims and the gap between them is where your architecture lives.

So here’s the order I’d actually work through it, and what breaks if you skip a step.

1. Measure what your context is costing you right now

Nobody does this first, which is why nobody believes the bill. Pull a week of real traffic and count input tokens per request, not averages, the p95. A full-context agent has a wonderfully flat token profile: every query costs the same enormous amount whether the user asked for one function signature or a cross-module refactor. That’s the tell. You are paying whole-corpus prices for questions that touch three lines.

snippet.pyPython
import tiktoken
​
enc = tiktoken.get_encoding("cl100k_base")
​
def context_cost(prompt_tokens, output_tokens, in_rate, out_rate):
    # rates in $ per 1M tokens, taken from your provider's pricing page
    return (prompt_tokens / 1e6) * in_rate + (output_tokens / 1e6) * out_rate
​
# a single 180k-token full-context call vs. a 6k-token summary+search call
full = context_cost(180_000, 800, in_rate=3.0, out_rate=15.0)
lean = context_cost(6_000,  800, in_rate=3.0, out_rate=15.0)
print(f"full: ${full:.4f}  lean: ${lean:.4f}  ratio: {full/lean:.0f}x")

Multiply by your request volume. The number is usually rude. You need it before step two, because the rest of this is a cost-benefit argument and right now you only have the cost.

2. Split your tasks into “retrieval” and “reasoning across the whole corpus”

This is the load-bearing step and the one teams rush. The Nvidia parity result holds on tasks where the answer lives in a findable region of the corpus: look up this policy, find where this symbol is defined, summarise this ticket thread. It does not hold when the question genuinely requires synthesising scattered evidence, “which of these forty contracts contradict each other,” “trace this data flow across every service.” For those, the model needs all the pieces in view at once, and a keyword search that returns the top eight passages will quietly drop the ninth that mattered.

Go through your actual query logs and tag them. Most teams discover the split is lopsided, the overwhelming majority are retrieval, a thin tail is true cross-corpus reasoning. You’ve been buying the full window to serve the tail and eating the cost on the body.

3. Build the cheap baseline before you optimise the expensive one

The lean setup is unglamorous on purpose: keep a rolling summary of what the agent has seen, and give it a plain keyword or BM25 search over the source. Not a vector database with a reranking cascade, start with the boring version, because the boring version is what Nvidia tested and it’s what lets you isolate the variable.

snippet.pyPython
from rank_bm25 import BM25Okapi
​
corpus = [doc.split() for doc in documents]
bm25 = BM25Okapi(corpus)
​
def retrieve(query, k=8):
    scores = bm25.get_scores(query.split())
    top = sorted(range(len(scores)), key=lambda i: scores[i], reverse=True)[:k]
    return [documents[i] for i in top]
​
def answer(query, running_summary):
    passages = retrieve(query)
    prompt = (
        f"Running summary of prior context:\n{running_summary}\n\n"
        f"Relevant passages:\n" + "\n---\n".join(passages) +
        f"\n\nQuestion: {query}"
    )
    return call_model(prompt)  # your provider's chat/completions call

Skip this and build the fancy RAG stack first, and when the numbers come in you won’t know whether your gains came from the architecture or the reranker. Keep it dumb until the comparison is honest.

4. Benchmark the two head to head on your data, not a leaderboard

Nvidia’s numbers are Nvidia’s workload. Yours will differ, and the only benchmark that pays your bills is the one built from your own queries. Take fifty to a hundred real questions with known-good answers, run both pipelines, and score them with the same grader, an LLM judge is fine if you pin the rubric and spot-check it.

snippet.pyPython
import statistics
​
def evaluate(pipeline, questions):
    results = []
    for q in questions:
        out = pipeline(q["query"])
        results.append({
            "correct": grade(out, q["gold"]),   # 1/0 from your judge
            "in_tokens": len(enc.encode(pipeline.last_prompt)),
            "latency_s": pipeline.last_latency,
        })
    acc = statistics.mean(r["correct"] for r in results)
    tok = statistics.mean(r["in_tokens"] for r in results)
    lat = statistics.mean(r["latency_s"] for r in results)
    return {"accuracy": acc, "avg_in_tokens": tok, "avg_latency_s": lat}
​
print("lean:", evaluate(lean_pipeline, questions))
print("full:", evaluate(full_pipeline, questions))

If the lean pipeline ties on accuracy, and for retrieval tasks it usually will, the decision makes itself. If it loses by a few points, now you have a real tradeoff to price instead of a vibe.

5. Track error rate and latency, not just accuracy

Here’s the part the “just use the big window” crowd never mentions: long context doesn’t fail gracefully, it fails in the middle. The well-documented “lost in the middle” effect means a fact buried at token 90,000 gets ignored while the same fact near the edges gets found. So your full-context pipeline can post a decent average accuracy while being silently unreliable on exactly the inputs where the key detail sits in the dead zone. Bucket your errors by where the answer lived in the context. And watch latency, a 180K-token prefill is seconds of wall-clock time before the first token appears, which your users feel even when the answer is right.

6. Keep the full window for the tasks that actually earned it

Don’t rip out long context entirely; that’s the overcorrection, and in six months you’ll be the person who refactored it back in. Route to it. Retrieval questions go to the lean pipeline; genuine whole-corpus reasoning goes to the expensive one. A cheap classifier or even a keyword heuristic on the incoming query does the routing. The point was never to pick a side, it was to stop paying the premium on every request to serve the minority that needs it.

7. Put a token budget in production and alert on it

Whatever you decide today rots. New document sets grow, someone raises the k on retrieval “just to be safe,” a prompt template balloons during a debugging session and never gets trimmed. Set a per-request input-token ceiling, log every call that blows past it, and review the overflows weekly. This is the step that keeps the savings from quietly leaking back out, which they will, because they always do.

If you do only one thing: tag a hundred real queries as retrieval or whole-corpus reasoning, then run both pipelines against them and look at the token ratio. The result will either justify the big context window you’re paying for or quietly end the argument. Either way you’ll stop guessing, which is more than the vendors racing to a million tokens can say for you.