Why Calibrated BM25 Filtering Barely Reduced Context on LongMemEval

John Knight, Erchin Serpedin, Hasan KurbanarXiv 2026

Imagine it’s late, you’ve been debugging RAG pipelines all day, and you’re wondering: “Do I really need this retrieval filter, or is it just adding latency for no reason?”

A new paper from researchers at Texas A&M and Hamad Bin Khalifa University suggests that in some common scenarios, your carefully calibrated filter might be doing exactly nothing. Specifically, when you’re dealing with long-context models and a "packer" that fills the prompt window anyway, the filter often becomes a redundant ghost in the machine.

TL;DR

In long-context retrieval tasks, we often use filters (like BM25) to save tokens. However, this paper shows that if your context window is large enough to hold most of your relevant data, a "safe" filter (calibrated not to lose the right answers) saves a negligible amount of tokens—just 0.096% in their tests—because the window itself acts as the primary filter.

What Problem Does This Paper Address?

When an AI assistant summarizes a long chat history to save space, it eventually misses a detail. To fix this, we "restore" original passages (called folds) back into the prompt.

The standard move is to use a retrieval score (like BM25) to rank these folds and apply a cutoff—a "recall gate"—to keep only the "relevant" ones. But there’s a catch: we also have a fixed context window (e.g., 32k tokens). A packer then takes the eligible folds and tries to fit them into that window.

The authors asked a simple but pointed question: Does the filter actually save any tokens once the context window limit is already in place? If the window is already full of high-scoring passages, does the filter ever get a chance to reject anything that would have actually fit?

Methods

The researchers built a system called CertFold to test this. Here’s the setup:

  1. The Folds: They broke chat histories into chunks (folds) of up to 8k tokens.
  2. The Reader: A Qwen3-14B model tasked with answering questions based on summaries and restored folds.
  3. Calibration: This is the clever bit. They identified "beneficial" folds—chunks that, when added individually, turned a wrong answer into a right one. They then set a BM25 score cutoff designed to catch 90% of these beneficial folds.
  4. The Comparison: They compared a Recall Gate policy (only use folds above the cutoff) against an All-that-fits policy (try to pack every fold in chronological order until the window is full).

They also introduced an Exact Test for engineers: To see if a filter matters, run your packer without the filter. If every passage the packer admits is already above your filter's cutoff, the filter is literally doing nothing.

Datasets

The study used the LongMemEval-S dataset, focusing on 75 development questions. This dataset simulates long-term memory in chat assistants, involving histories spread across multiple sessions.

Key Insights and Ideas

  • The Window is the Real Filter: At a 32k token window, the "All-that-fits" policy and the "Recall Gate" produced identical prompts for 74 out of 75 questions. The window was already doing the filtering.
  • The "Beneficial" Paradox: Some passages that are essential for answering a question have surprisingly low BM25 scores. To avoid losing these "diamonds in the rough," your filter has to be very permissive. Once it’s that permissive, it stops being a useful filter.
  • Retrieved vs. Delivered: There is a massive difference between what a retriever thinks is relevant and what actually gets delivered to the model after packing.
Figure 1: The third-lowest positive sets the re-graded cutoff. Only 9.23% of all candidates score strictly below it. The vertical axis ranks positive folds by BM25 score. Open circles are unresolved folds, shown as positive. Excluding either shifts higher ranks down by one and leaves the cutoff unchanged. Under the original grades, 8.05% scored below the cutoff.

As seen in Figure 1, the cutoff required to maintain high recall is so low that only about 9% of all candidate passages were actually rejected by the filter.

Key Results

  • Token Savings: The BM25 filter saved a measly 0.096% of input tokens. For a 32k window, that’s essentially rounding error.
  • Accuracy: Both the filtered and unfiltered policies resulted in the same number of correct answers (50 out of 75).
  • Scaling Effects: As shown in Figure 2, the filter only starts saving significant tokens when the context window is very large (e.g., "Unlimited") or the archive is much bigger than the window. At the 32k "sweet spot" for many current models, the benefit vanishes.
Figure 2: Input tokens saved by a recall gate against all-that-fits as the context window grows, for cutoff ranks k; rank 3 is α = 0.1. Token accounting from saved scores and the packer of the executed run. Shading covers the unresolved calibration labels. Both panels pack in BM25 order. The dotted line marks the executed window.
Table 1: Filtering removed one passage from the final prompts across 75 questions. Selected and Delivered count folds across questions. Correct counts questions under the re-graded labels. Recovery counts corrections among 52 summaries-only errors, and Damage counts new errors among 23 summaries-only successes. Input is mean prompt tokens per question.

Limitations and Future Work

The authors acknowledge a few boundaries:

  • Sample Size: The study was limited to 75 questions from one benchmark.
  • Score Choice: While they tested BGE (a dense embedding model) and found it saved slightly more tokens (1.27%), the core "window-as-filter" effect remained.
  • Archive Size: If your archive is millions of tokens long, a filter becomes mandatory. But for personal chat histories (the "LongMem" use case), the archive is often small enough that the window can "swallow" most of the potentially relevant chunks.

The takeaway for the weary engineer? Before you spend weeks fine-tuning a retrieval threshold, run the "Exact Test." You might find that your context window is already doing your job for you.

Summary updated

Abstract

An assistant that summarizes old conversations may later need a detail from the original exchange. It can score archived passages against the question, but only passages that fit in the prompt reach the answering model. We tested whether a BM25 filter saves input tokens once that limit is taken into account. We calibrated the filter on passages that individually corrected an answer the model got wrong from the summaries alone. Across 75 LongMemEval questions, filtering changed one prompt and saved 0.096% of input tokens. With and without the filter, the model answered the same questions correctly under a second automated grading. On a random sample, two human graders' settled judgments agreed with the automated grades in 92.9% of definite comparisons (Cohen's kappa = 0.805). Building on earlier work that distinguishes retrieved evidence from delivered evidence, we give an exact test for packers that try whole passages in a fixed order and skip any that do not fit. Run the packer without the filter. The prompt changes exactly when an admitted passage scores below the cutoff. Code and data: https://github.com/KurbanIntelligenceLab/Certfold
BibTeX
@misc{knight2026why,
  author = {John Knight and Erchin Serpedin and Hasan Kurban},
  title = {{Why Calibrated BM25 Filtering Barely Reduced Context on LongMemEval}},
  year = {2026},
  eprint = {2611.30500},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.30500},
}
Figure