In This Article (8 sections)
What “You Don’t Need Long Context” Actually Shows About Context Compaction and Cost
The paper You don’t need long context, submitted to arXiv on November 3, 2026, by Peter Belcak and eleven coauthors, investigates whether AI agents can preserve strong task performance while operating with substantially smaller active contexts. The headline claim of 36.7x cost savings requires correction because the paper reports a 3.6 to 7x difference in output-token serving costs between tested 256K and 16K context configurations.
Specifically, the reported differences are 3.6x for GLM 5.2, 5.6x for Kimi K2.6, and 7x for Qwen 3 Coder Next. These serving-cost measurements should also remain separate from the paper’s task-level cost estimates and should not be presented as measured reductions in an organization’s API bill. The research is better understood as evidence that shorter active contexts can materially change serving economics while maintaining substantial performance in certain agent workloads.
The central question is whether a long task necessarily requires one continuously growing conversation. A coding agent might inspect dozens of files, execute tests, revise a plan, and accumulate a large interaction history, but the next decision may depend on only a small subset of that material. A research agent may have access to hundreds of pages while needing only a few passages to answer the current question. The amount of information available to the system is therefore different from the amount placed inside the model’s active context. The cost of processing that active context is a third, separate consideration.
Context compaction addresses this distinction by replacing an expanding transcript with a shorter working representation of what remains relevant. If an agent has already discovered the correct test command, for example, it may not need to carry every failed attempt and full diagnostic output into every future request. A compact state could instead preserve the task objective, the working command, known constraints, current files, unresolved questions, and evidence required for the next decision. The value of compaction increases when that smaller state can be reused across many later steps. However, creating and maintaining the state also consumes resources, so the complete workflow must be measured rather than only the reduced prompt size.
This is why the reported cost ratios require careful interpretation. A 7x difference means one tested configuration costs seven times as much as another for the measured output-token serving condition, which corresponds to the cheaper configuration costing roughly 14.3% as much, or an approximately 85.7% reduction. A 3.6x ratio corresponds to the cheaper configuration costing about 27.8% as much, or a reduction of roughly 72.2%. These calculations describe the ratio itself rather than a guaranteed business saving. Hardware, concurrency, utilization, prompt structure, model configuration, input processing, and provider billing rules can all change the economic result.
The report also distinguishes nominal retail costs from estimated optimized retail costs. This matters because provider infrastructure economics and customer billing are different things. A provider may experience lower internal serving costs when contexts are smaller while charging customers according to published token rates that do not reproduce the same ratio. Caching introduces another variable because reusing an unchanged prefix may be cheaper than replacing it with a newly generated summary. Any practical cost analysis should therefore use the actual workflow, provider rates, cache behavior, retrieval cost, summary generation, retries, and final validation.
Longer contexts can increase cost because modern attention-based models must account for more prior information during generation. KV caches reduce the need to recompute all earlier representations, but the stored information still consumes memory and has to be accessed. Longer contexts can therefore affect input processing, decoding, memory pressure, and how many requests can be served concurrently. These effects do not necessarily translate into identical changes in end-to-end response time because tool execution or external services may dominate some workflows. A model’s maximum supported context is also different from the amount an application chooses to provide on any particular request.

End-of-Conversation Compaction, Single-Action State, Selective Reading, and Short-Context Agent Design
The paper compares full-history accumulation with several compact-memory strategies, including threshold-triggered end-of-conversation compaction and single-action compaction. Full history preserves the complete transcript, while compaction carries forward an interpreted account of the current state. Neither approach is inherently perfect. Full transcripts preserve details whose later relevance may not yet be obvious, but they can also carry outdated hypotheses, redundant observations, and large amounts of irrelevant material into every subsequent request.
End-of-conversation compaction creates a handoff when the current context approaches a chosen threshold, then continues the task in a fresh conversation. The timing matters because waiting until the context is completely full can leave too little room to create a useful state summary. Triggering too early can introduce unnecessary summarization overhead. A useful handoff should preserve the assignment, completed work, active constraints, unresolved questions, current artifacts, pending tool operations, and evidence needed to determine completion. It should also distinguish what has been observed from what has merely been inferred.
External artifacts make this approach particularly useful in software work. An agent does not need to remember the exact contents of a patch if the edited file remains available for inspection. The compact state can record why the file was changed, what still needs verification, and where the current implementation resides. The next invocation can then inspect the artifact directly. This allows persistent files and tools to serve as part of the memory system instead of forcing every previous token into the model’s immediate context.
Single-action compaction goes further by updating the carried state after each environment action. This sharply reduces the amount of conversational history that survives between decisions, making the state itself a critical interface. If an agent edits a configuration file, the next state should distinguish between the fact that the file was modified and the separate claim that the application was successfully tested. If a command fails, the state should preserve whether the failure came from the implementation, a missing dependency, or an incorrect invocation. Compressing all of those possibilities into a vague phrase such as “tests failed” can cause repeated work or incorrect assumptions.
The advantage of single-action state is inspectability. A reviewer can examine exactly what the agent believes after each step instead of reconstructing that belief from a long exploratory conversation. The weakness is that a concise state can preserve a mistaken conclusion with great confidence. Reliable implementations therefore need mechanisms to revisit original evidence, challenge assumptions, and preserve uncertainty. A compact state should make it easier to reason from evidence, not replace evidence with unsupported summaries.
Selective reading addresses the problem from another direction. Instead of compressing information the agent has already encountered, the system keeps most source material outside the active prompt and retrieves only the parts needed for the current decision. A research agent comparing two financial periods may search for relevant figures, inspect surrounding definitions and footnotes, and then work from those passages rather than loading every report in full. The benefit is lower active-context use, while the risk is missing information that retrieval failed to surface.
Search results should therefore be treated as candidate evidence rather than a complete representation of the source. Exact terminology can make keyword retrieval effective, but conceptually related information may appear under different wording. Expanding around relevant passages, checking definitions, following cross-references, and preserving provenance all improve reliability. A compact answer remains easier to audit when the system retains document names and passage locations that allow the original source to be reopened.
The authors also discuss semantic state space models as a future direction. The idea is to carry an explicit language-based state between actions rather than allowing the transcript to grow indefinitely. Such a state could preserve the objective, active constraints, observations, unresolved questions, confidence levels, and references to external artifacts. The challenge is not merely shortening text but preserving meaning faithfully enough that future decisions remain correct.
This is where semantic state differs from ordinary summarization. “The test command failed because the dependency is absent” is more operationally useful than “testing failed” because it preserves the reason and the likely next action. A good state must also preserve negation, uncertainty, and unresolved contradictions. Statements such as “this function is not thread-safe” or “the failure appears to originate here” can be dangerously distorted if compressed into more confident language. State maintenance should therefore be evaluated as its own capability.
SWE-Bench Results, Accuracy Tradeoffs, and the Risks of Information Loss
Software engineering provides a useful environment for evaluating compact context because the current state of the work often exists outside the conversation. Files, repositories, test results, diffs, and execution environments can preserve information that the model can inspect when needed. This makes it possible for an agent to operate with smaller conversational memory without literally forgetting the implementation. However, not every software task tolerates aggressive compaction because requirements can span many files and interactions. Some failures come from memory loss, while others come from weak reasoning, poor tests, or ambiguous specifications.
On SWE-bench Verified, the paper reports a single-action-compaction result of 70.2% compared with a 70.0% baseline for Claude Opus 4.5. For GPT 5.6 Sol, single-action compaction reaches 82.4% compared with an 84.4% baseline. That second comparison represents a decline of two percentage points, not an undefined 2% reduction. These results demonstrate that smaller active contexts can retain substantial coding performance, although the effect differs by model and setup.
The benchmark scores should remain tied to the tested harness. Model behavior, tool access, stopping rules, prompt design, and evaluation procedures all influence the outcome. A result cannot be attributed to context management alone if other conditions differ. The distribution of failures also matters because a small aggregate decline may be unacceptable if the additional errors concentrate in security-sensitive or high-value tasks. Conversely, a small gain does not prove that compaction universally improves reasoning.
Failure analysis is therefore more informative than a single score. A compact agent may forget a compatibility requirement, lose a diagnostic observation, repeat a failed approach, or fail for reasons unrelated to memory. Identifying which of these occurred helps determine whether increasing context would actually solve the problem. Some failures require better retrieval, stronger tests, clearer requirements, or improved reasoning rather than more retained text.
Compaction also introduces information-loss risks that full-history systems avoid. A summary may preserve the conclusion while dropping the evidence needed to question it later. Negation, qualifications, uncertainty, and exact identifiers are particularly vulnerable. Repeated compaction creates another hazard because each new summary may depend on the previous summary rather than the original evidence, allowing small distortions to accumulate and become increasingly authoritative.
For that reason, some information should remain verbatim or externally referenced. Exact quotations, filenames, numerical values, identifiers, formal requirements, and critical constraints can be safer to preserve directly than to paraphrase repeatedly. A system that keeps the original transcript or source documents externally can recover omitted details when necessary. If the original information has been discarded, however, later reasoning cannot reliably reconstruct an arbitrary missing fact.
This makes recovery mechanisms central to compact-memory design. The active context can remain small while the wider system retains searchable transcripts, files, indexes, and source documents. Forgetting a detail then becomes a retrieval inconvenience rather than permanent information loss. The most useful architecture separates immediate working memory from durable evidence instead of treating compaction as deletion.
The paper’s title should therefore not be interpreted as saying that long context has no value. Long context remains useful when a decision genuinely requires many interacting pieces of evidence at once or when decomposition creates unacceptable risk. A contract analysis spanning many dependent clauses, a narrative consistency review, or a software change touching many related components may benefit from broader simultaneous access. The difficulty is often knowing what matters before the analysis begins.
A flexible system can therefore expand or contract its context according to the task. Routine steps may operate from a compact state, while difficult synthesis tasks can load broader evidence when necessary. This treats context as a resource to allocate rather than a capacity that should always be maximized or minimized. The correct size is the amount of relevant information needed for the current decision.

What the Research Means for Long-Context Models, Agent Costs, and Practical Deployment
The strongest practical lesson from You don’t need long context is that task length, information availability, and active-context size are different design variables. A complex agent may perform hundreds of actions without carrying the full history of all those actions in every model request. Files, retrieval systems, structured state, searchable transcripts, and external tools can preserve access to information while keeping routine prompts smaller. This can reduce repeated processing and improve serving efficiency when the architecture is designed carefully.
The paper’s 3.6 to 7x serving-cost differences make this economically significant, but they should remain tied to the measured setup. They are not evidence of a universal 36.7x saving, nor are they equivalent to measured reductions on a customer’s final API invoice. The task-level cost calculations are another layer of analysis and should not be merged with the serving experiment. Any organization evaluating the approach should calculate savings from its own prompts, provider pricing, cache usage, tool calls, retries, and completion rates.
A smaller context also does not automatically create a better agent. Poor compaction can cause repeated retrieval, forgotten requirements, incorrect assumptions, and wasted tool calls. An extremely short state may therefore cost more overall than a slightly larger one that preserves the information needed to continue efficiently. Total successful-task cost is more meaningful than prompt length alone. The same principle applies to latency because a smaller prompt may produce little user-visible improvement if external tools dominate the workflow.
The research also reinforces the importance of context organization. Long transcripts can preserve everything while making relevant information harder to identify. Earlier work such as Lost in the Middle showed that, under the models and tasks studied, performance could depend on where relevant information appeared inside a long input. That result should not be generalized unchanged to every later model, but it illustrates that capacity and effective use are different concepts. A large context window is valuable only when the model can find and correctly use the information placed inside it.
For software agents, compact state is especially promising because repositories and execution environments already provide persistent external memory. The model can reopen files, inspect diffs, rerun tests, and search history instead of carrying every prior observation as prompt text. Research and document workflows can use similar designs when source material is searchable and provenance is preserved. The system remains information-rich even when the active prompt remains comparatively small.
The approach becomes less attractive when omitted information is hard to recover or when relationships among many pieces of evidence must be considered simultaneously. Weak retrieval can make a broad context safer than an aggressively filtered one. Tasks involving unexpected contradictions can also be difficult because the system may not know which passages will become relevant until late in the analysis. Context allocation should therefore respond to task structure and retrieval quality rather than follow one fixed policy.
A useful deployment evaluation would compare full-history, retrieval-based, and compact-state configurations under the same success criteria. It should measure task completion, missed evidence, retries, recovery behavior, output quality, latency, and total cost. It should also record which kinds of tasks fail under smaller contexts and whether those failures disappear when broader evidence is loaded. This creates a clearer basis for deciding when compaction is worthwhile.
The research ultimately challenges the assumption that maximum available context should be treated as the default amount of working memory. Large windows remain useful, but an agent does not need to fill them merely because they exist. A system that maintains explicit state, preserves durable evidence externally, and retrieves details when needed can potentially solve long-running tasks while processing far fewer repeated tokens. The opportunity lies in designing memory around relevance and recoverability rather than transcript length.
The corrected conclusion is therefore more useful than the original 36.7x headline. The paper provides evidence that short-context agent designs can retain substantial performance while producing large serving-cost differences in the tested configurations. It also shows that compaction introduces its own costs and risks, especially when important evidence is omitted or distorted. The practical goal is not the shortest possible context, but the smallest reliable working state that still allows the system to complete the task correctly.

Frequently Asked Questions (FAQs)
- Does the paper report 36.7× cost savings?
No. The paper reports a serving-cost range of approximately 3.6× to 7× across the tested model configurations. That range describes several separate measurements rather than one combined 36.7× result. Removing the punctuation between 3.6 and 7 would incorrectly turn a range into a much larger number. The paper also includes task-level cost estimates, but those should remain separate from the serving-cost measurements. The most accurate summary is therefore that the reported serving advantage falls within a 3.6× to 7× range under the tested conditions. - Does context compaction mean deleting the original conversation?
It does not have to. A system can preserve the full transcript, files, or other evidence externally while sending only a shorter working state to the model on later turns. That approach allows the agent to keep its active context small without permanently losing access to earlier information. If an omitted detail becomes important again, the system can retrieve it from the stored transcript or original source. Whether this works depends on the application’s storage, indexing, and retrieval design. - Are shorter contexts always cheaper?
Not necessarily when the entire task is considered. Smaller prompts can reduce repeated context processing, but creating summaries also consumes tokens and computation. A poor summary may force the agent to reopen files, repeat searches, or retry tasks because important details were omitted. Compaction can also change how much cached input is reused. The meaningful comparison is therefore the total cost of successfully completing the task, including summaries, retrieval, retries, and verification. - Is context compaction the same as retrieval?
No. Context compaction creates a shorter representation of information the system has already encountered. Retrieval selects relevant information from an external source such as documents, files, or a stored conversation history. The two techniques can work together effectively. An agent might retrieve several passages, reason over them, and then preserve only the conclusions, constraints, and source references needed for the next step. This keeps working memory small while maintaining access to the larger evidence base. - Does a large context window guarantee accurate recall?
No. A large context window determines how much information a model can accept in one request, but it does not guarantee that every detail will be noticed, remembered, or used correctly. Relevant information can still be overlooked, misunderstood, or outweighed by less useful material. The location and organization of information inside a long prompt can also matter. Developers therefore need to test whether the model actually retrieves and applies important details correctly rather than assuming that fitting them inside the context is sufficient. - Why is software engineering suitable for compact-state agents?
Software projects naturally contain persistent external artifacts such as source files, patches, test results, configuration files, and version-control history. An agent can reopen those artifacts when needed instead of carrying their entire contents in conversational memory. A compact state can preserve the objective, decisions already made, relevant file locations, and outstanding checks. This can reduce repeated prompt length while still giving the agent access to the current implementation. However, important requirements and cross-file dependencies still need to be preserved accurately. - What belongs in a practical compaction handoff?
A useful handoff should preserve the task objective, active constraints, completed work, unresolved questions, evidence locations, and the next actions that still need to be performed. It should also distinguish verified observations from assumptions or hypotheses. Pending operations should be identified clearly so that the next invocation does not repeat them or incorrectly assume success. Exact values, filenames, identifiers, and other critical details may be better preserved verbatim or through references to their original sources. The goal is to make the next decision possible without reconstructing the entire history. - Can compaction introduce hallucinations?
Yes. A generated summary can add unsupported details, omit important qualifications, or turn an uncertain hypothesis into a confident conclusion. Repeated summarization can make the problem worse if each new state is based only on an earlier summary rather than the original evidence. Preserving references to source files, transcript locations, or documents makes important claims easier to verify. Critical facts should be checked against the originals when the cost of an error is significant. - Do serving-throughput gains mean tasks finish equally faster?
No. Output-token generation is only one part of the total time required to complete an AI task. Input processing, retrieval, tool execution, network communication, queueing, file operations, and final verification can all contribute to overall duration. Improving decoding efficiency may therefore produce a smaller improvement in end-to-end completion time. Real latency needs to be measured on the full application workflow rather than inferred directly from token-serving benchmarks. - Should developers stop using long-context models?
No. Long context remains useful when a task genuinely requires broad simultaneous access to many interacting pieces of information or when retrieval could miss something important. The research instead suggests that developers do not need to fill a large context window simply because the model supports one. A practical system can use compact states for routine steps and expand context when difficult synthesis requires more evidence. The best strategy should be chosen by testing representative tasks and comparing accuracy, cost, latency, recovery behavior, and total successful-task performance.

Conclusion
The research raises a useful challenge to the assumption that an increasingly capable AI agent must carry an increasingly long transcript. Information can remain available through files, search, and persistent artifacts while the agent maintains a more focused working state. The headline nevertheless requires accurate numerical interpretation. The reported range of serving costs should not be presented as a 36.7× finding, and estimated deployment economics should remain distinct from actual customer invoices.
For practical systems, the decisive question is whether the next action has sufficient reliable information. Compaction succeeds when it preserves constraints, evidence, uncertainty, and continuity while reducing unnecessary repetition. It fails when a shorter prompt causes missing requirements, repeated work, or unsupported conclusions. The strongest implementation strategy is empirical: compare context arrangements on the real workload, preserve recoverable evidence, and measure the entire successful task. That approach turns context management from a headline claim into an engineering decision.
Sources and Citations
- Belcak et al., November 3, 2026 — “You don’t need long context”: The primary paper by Peter Belcak and 11 coauthors examines whether agents can maintain strong performance while operating with much shorter active contexts. It reports output-token serving-cost differences of up to 7× across tested long- versus short-context configurations, evaluates frequent compaction, selective reading, software-engineering tasks, and proposes semantic state space models as a direction for long-horizon agents. arXiv
You don’t need long context — arXiv - SWE-bench — Official Leaderboards: SWE-bench provides the official benchmark context for the paper’s software-engineering results. The original SWE-bench contains 2,294 real GitHub issue instances, while SWE-bench Verified contains 500 human-filtered instances; the site reports each submission by the percentage of tasks resolved. swebench.com
SWE-bench Official Leaderboards - Liu et al., 2023 — “Lost in the Middle: How Language Models Use Long Contexts”: This research studies multi-document question answering and key-value retrieval and finds that performance can depend strongly on where relevant information appears in a long input. In the evaluated models, performance was often highest when relevant material appeared near the beginning or end and degraded when it appeared in the middle. arXiv
Lost in the Middle: How Language Models Use Long Contexts - Kwon et al., 2023 — “Efficient Memory Management for Large Language Model Serving with PagedAttention”: The paper explains how large and dynamically changing KV caches can waste GPU memory through fragmentation and duplication during LLM serving. It introduces PagedAttention and the vLLM serving system, reporting 2–4× higher throughput at similar latency than the compared serving systems, with larger gains for longer sequences and larger models. arXiv
Efficient Memory Management for Large Language Model Serving with PagedAttention - Vaswani et al., 2017 — “Attention Is All You Need”: This foundational paper introduced the Transformer architecture, replacing recurrent and convolutional sequence models with a system based primarily on attention mechanisms. It provides the architectural background for later discussions of attention, context length, and modern LLM inference behavior. arXiv
Attention Is All You Need
Recommendations
- Where Winds Meet, Official Imperial Palace Gameplay Trailer Explained: Release Date, Story, Combat Details & Everything We Know
- Diablo 4 3Rd Anniversary Event: Goblins, Massive XP Boost, Free Cosmetics, and Full June 2–9 Celebration Guide
- IO Interactive and Build A Rocket Boy End MindsEye Partnership as Hitman Crossover DLC Is Canceled
- All Anomalies in Animal Hospital Guide: Every Roblox Anomaly Explained
- Every Release Date from Every Event at Summer Game Fest 2026
- First Gameplay Trailer of Silent Hill: Townfall: It’s a First-Person Game and Everything We Know (2026)
- Best New Anime to Watch Right Now: Spring 2026 Picks
- Switch 2 Software Update Adds “Handheld Mode Boost” for Old Games – Performance Upgrade Explained
- We Build LEGO Winnie the Pooh: A 100th Anniversary Set Worth the Hype for Disney and LEGO Fans
- Echoes of Aincrad: Complete Guide to Growth Points (Best Stat Builds & Leveling Tips)














































































































