New Tool Radar

AI Concepts

How to Measure Where Extra Retrieved Context Stops Helping RAG

Find the context size where adding more retrieved chunks stops improving answers, so you stop paying for context that hurts.

Schematic illustration with three step boxes: fix the question set, vary the context budget, and plot quality against size.

More context is not always better. A systematic study found a context cliff: quality fell beyond about 2,500 tokens of retrieved context, with semantic quality peaking at small contexts and exact match peaking at larger ones. The right budget depends on the goal, so measure it on your own questions instead of copying a number.

Before you start

A RAG pipeline where you can set the total context budget, and a fixed test question set with known answers.

Fix the question set and the judge

Use the same 20 questions and the same scoring rule at every budget, or the comparison is meaningless. Score each answer as correct, wrong, or abstained, and keep the counts separate.

Include questions whose answers sit in the middle of the retrieved set: long-context studies show information in the middle is used less well than at the start or end.

Vary the context budget in steps

Run the set at 500, 1,000, 2,500, 5,000 and 10,000 tokens of retrieved context. Keep the chunk size, the retriever and the model fixed; only the budget changes.

Record the token count actually sent, not the budget setting: a budget of 5,000 tokens with only 3,000 tokens of chunks retrieved is a 3,000-token run.

Find the cliff and set the budget below it

Plot correct answers against budget. The budget where correct answers stop rising, or start falling, is your cliff. Set the production budget at or below the best point, not above it.

If the best point differs between question types, set the budget per type or use the budget that is best for your largest group.

Practice check: fictional Maple Corner help set, 20 questions

The table below is fictional practice material, worked out by hand from the stated budgets. It is the expected result for the practice set, not a run of any RAG system.

Context budget Correct Wrong Abstained Reading
500 tokens 11 6 3 Too little context
1,000 tokens 14 4 2 Improving
2,500 tokens 16 3 1 Best point
5,000 tokens 14 5 1 Cliff – falling
10,000 tokens 12 7 1 Worse – distractors win

Correct answers peak at 16 of 20 with a 2,500-token budget and fall to 12 at 10,000 tokens. More context past the cliff adds distractors faster than it adds answers.

Expected result. UNTESTED: the scores in the practice table are worked out by hand, not measured by running a RAG system. Run your own fixed question set at 500, 1,000, 2,500, 5,000 and 10,000 tokens and find where correct answers peak.

Limits

  • The cliff position depends on the model, the chunk size and the question type; the cited study found it near 2,500 tokens in its own setup.
  • Abstentions are not failures: an answer that says the context is insufficient is better than a confident wrong answer.

Sources

See all