Evaluating Language Model Context Windows: A "Working Memory" Test and Inference-time Correction
Not on the map. Why?
Abstract (arXiv)
Large language models are prominently used in real-world applications, often tasked with reasoning over large volumes of documents. An exciting development in this space is models boasting extended context capabilities, with some accommodating over 2 million tokens. Such long context model capabilities remain uncertain in production systems, motivating the need to benchmark their performance on real world use cases. We address this challenge by proposing SWiM, an evaluation framework that addresses the limitations of standard tests. Testing the framework on eight long context models, we find that even strong models such as GPT-4 and Claude 3 Opus degrade in performance when information is present in the middle of the context window (lost-in-the-middle effect). Next, in addition to our benchmark, we propose medoid voting, a simple, but effective training-free approach that helps alleviate this effect, by generating responses a few times, each time randomly permuting documents in the context, and selecting the medoid answer. We evaluate medoid voting on single document QA tasks, achieving up to a 24% lift in accuracy. Our code is available at https://github.com/snorkel-ai/long-context-eval.
Key facts. Cited by 3 papers in the map (data through 13 Oct 2026). Builds on 6 of its 11 references that are in the map. First posted on arXiv 4 Jul 2024.
Builds on
6 of 11 references.
References · 6
- 2020Language Models are Few-Shot Learnerscited by 32,320
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,412
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,386
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,302
- 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 697
- 2024∞Bench: Extending Long Context Evaluation Beyond 100K Tokenscited by 361
Built on by
Citing papers per year: 2025: 2; 2026: 1.
3 papers.
- 2025Mitigating Posterior Salience Attenuation in Long-Context LLMs with Positional Contrastive Decodingcited by 0
- 2025Mass-Scale Analysis of In-the-Wild Conversations Reveals Complexity Bounds on LLM Jailbreakingcited by 0
- 2026Not All Needles Are Found: How Fact Distribution and Don't Make It Up Prompts Shape Retrieval, Reasoning, and Hallucination in Long-Context LLMscited by 0
- 2026Not All Needles Are Found: How Fact Distribution and Don't Make It Up Prompts Shape Retrieval, Reasoning, and Hallucination in Long-Context LLMs5 Jan 2026
- 2025Mass-Scale Analysis of In-the-Wild Conversations Reveals Complexity Bounds on LLM Jailbreaking6 Jul 2025
- 2025Mitigating Posterior Salience Attenuation in Long-Context LLMs with Positional Contrastive Decoding10 Jun 2025