Many models advertise long context lengths (256k, 1M etc.). However, research indicates that longer contexts do not necessarily produce better results. There are three questions we can ask when considering this: Is the longer context useful? Was the model trained to make use of long contexts? How costly is it to use long contexts? Below we discuss the evidence for each question, and then counterpoints.
Longer context doesn’t mean useful context
We distinguish between a long context length and useful context length. In practice:
In RULER (Hsieh et al., 2024), models were given extremely easy needle in haystack tasks and near perfect scores. However, performance dropped significantly on hard tasks. Even at 32K, only around half of the models tested performed satisfactorily. All models advertised support for at least 32k contexts.
Most open source models have a significantly shorter useful context length than training context. For example, in a model with 2048 token training context, context positions at 1024 or beyond make up less than 20% of the total seen (An et al., 2024).
However in the same work, they demonstrated that training-free solutions can improve performance in these long contexts. By using STRING, rare positions in the context at inference time are mapped onto well trained positions. Using this method, Llama 3.1 70B and Qwen2 72B were improved by >10 points on both RULER and InfiniteBench tasks. Essentially, the long context knowledge was present in the model weights, but undertrained.
Position in context matters
Even within useful context lengths, models perform poorly depending on where the relevant information is.
In Lost in the Middle (Liu et al., 2023) models perform best when information is at beginning or end of inputs. Performance decreases for mid input information, and also as inputs get longer. Even models adapted for long contexts suffer from this issue. Additionally, the performance of readers plateaus significantly earlier than retrievers, meaning that increasing the number of retrieved documents eventually has no effect.
In Context Rot (Hong et al., 2025), models perform worse as inputs get longer, even in easy tasks. Not all tasks were equally impacted, however. This work is a technical report from a vector database company, not peer reviewed.
Training to utilise long contexts
Gao et al. (2024) performed detailed ablations on long context pretraining and fine-tuning of Llama-3-8B. Some unexpected results include:
Using only long documents in training reduces long context performance.
Code repositories and books performed well as long context data, but only when mixed with high quality short context data, which ensured good performance in short contexts.
Using training sequences longer than evaluation sequences helps.
Supervised fine tuning with short instruction data alone gives strong long context performance.
This model outperformed Llama-3.1-8B-Instruct on most long context tasks, with only ~5% as many tokens in long contexts in training. The authors argue that perplexity and needle in a haystack tasks are not suitable metrics for development.
As in both papers, context length is a configurable parameter. Useful context length depends on data and evaluation.
Avoiding accumulation of context
Belcak et al. (2026) demonstrate methods to avoid accumulation of context. For agents, context is condensed into a short summary when changing task. If long documents are provided, the text is stored in files, and agents make bounded queries using tools such as grep.
Key results from this work using leading closed models include:
SWE-bench Verified: Claude Opus 4.5 improves from 70.0% to 74.8% using condensation levels of 24k and 18k.
RULER recall increases significantly in Opus from 62.5% to 95.7% using selective reading.
LongBench v2 was unchanged (68.0% -> 67.6%) and FRAMES decreased by an average of ~1.3-3.7 points.
Condensed context that performed best was not summarized context, but succinct context to allow efficient processing. It included near verbatim task descriptions, an overview of current intentions and plans, completion requirements, and references to key items (file paths / specific values).
Confounding factors
Comparing long context input against search-enabled agents may mean some performance improvements are due to the search tools, rather than short context. Additionally, Qwen 3 Coder Next performs very poorly on SWE-bench Verified in tight conditions (from 53.0% to 3.6%) mainly due to very verbose paths in the trajectories meaning no progress could be made between condensations.
Estimated cost savings, The main cost saving is based on an estimated pricing method from open weights throughput speeds, and is therefore not the actual cost incurred.
Dependent on model, As noted above, some models perform very badly. However, in the same conditions, some models may be suited to long contexts.
Lossy, As the context is condensed, information will be lost. To fully retain logs, it must be possible to retrieve them from disk.
The paper suggests models could be trained to take condensed state notes as input, rather than accumulated transcripts. However, no training experiments were run.
Personal Experience
I can confirm that within my applications, ingestion works well. I am generally surprised at the levels of accuracy and performance. However, increased context length does not improve results. It simply increases resource usage.
For example, when changing from a 12B to a 9B model, I saw equivalent results to the larger model. Therefore no improvement was gained from increasing model size.
Note that this is only from my experience with my own workloads, and does not indicate whether models would benefit from long context in tasks with truly massive context needs. However it aligns with the studies above. Extra context length in my experience only increases cost, without improving quality.
Context depth affects cost. As such, tokens in position 200,000 cost more than tokens in position 10,000. In practice, the increase is significant. In real world deployment on H100 GPUs with vLLM, the cost of generating tokens in models with 256k context (rather than 16k) increased by 3.6x for GLM 5.2, 5.6x for Kimi K2.6, and 7x for Qwen 3 Coder Next. Local testing on DGX Spark hardware doubled inter-token latency between 16k and 256k contexts for several models.
While token cost is flat in retail APIs, longer context length means that all subsequent output tokens are slower and more expensive.
Counterpoint
In Li et al. (2024), retrieval augmented generation (RAG) systems were compared directly with long context models. In cases with no constraints on resources, long context models outperformed RAG in nearly all cases. However, RAG had the advantage of being cheaper. Self-Route, a hybrid approach where the model chooses for each query whether to use RAG or full context, reduced costs significantly. Cost was reduced by 65% for Gemini-1.5-Pro and 39% for GPT-4o, with equivalent performance.
Long context is not always worse. Although it is costly, it is often underutilised. Sometimes it is still correct to choose long context models. Perhaps a way to reconcile this is to appreciate that in classic RAG only a single round of retrieval is performed, whereas iterative searching and reading in agents can change behaviour.
Most of this research is from 2023/2024 and uses older models. Specific figures will have changed, although trends may be similar.
Takeaways
Treat the context window as a ceiling you hopefully never approach, not a budget to fill.
Check effective length on your own task and model. Needle-in-a-haystack scores alone won't tell you.
Put the important material at the start or end, and be wary of piling on retrieved documents.
For long documents, consider giving the model search and bounded-read tools, and measure whether it beats full ingestion for your case.
If you train or tune for long context, mix long data with high-quality short data and evaluate on varied tasks, not perplexity.
Keep a raw log somewhere retrievable if you compact, so the compaction is never the only copy.
References
Liu, N. F. et al. (2023). Lost in the Middle: How Language Models Use Long Contexts.
Hsieh, C.-P. et al. (2024). RULER: What's the Real Context Size of Your Long-Context Language Models?
Li, Z. et al. (2024). Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach.
Gao, T. et al. (2024). How to Train Long-Context Language Models (Effectively).
An, C. et al. (2024). Why Does the Effective Context Length of LLMs Fall Short?
Hong, K., Troynikov, A., Huber, J. (2025). Context Rot: How Increasing Input Tokens Impacts LLM Performance. Chroma technical report.
Belcak, P. et al. (2026). You don't need long context. arXiv preprint.
Top comments (0)