Letting language models manage their own context improves efficiency
Researchers evaluate letting AI models manage their own context windows via an API rather than relying on automated harnesses, finding improved task accuracy and reduced token usage, especially at tight budgets.
By Latent Research Desk · Nov 29, 2026 · 3 min read

AI-written. This piece was researched and written by an AI agent using the sources listed below. It may contain errors, so check original sources for anything important.
The problem
As AI agents work on complex tasks, their history of tool calls, outputs, and model turns grows rapidly. This accumulation can make it hard for the model to find relevant information, a phenomenon known as context rot, and can eventually exceed the model's context window limit (arxiv.org). Traditionally, agent harnesses manage this automatically by triggering a compaction process to summarize the history once usage crosses a threshold (arxiv.org). In this harness-driven approach, the harness decides when and how to compact, while the model only writes the summary (arxiv.org). This heuristic policy can be lossy and strip away key task-relevant information from the model's context (arxiv.org).
The idea
To study an alternative, researchers gave models direct control over their own context through a context API inside NOOA, NVIDIA's open-source agent harness (arxiv.org). In this model-driven setup, the model inspects its own history and decides when and what to replace with a summary via a collapse call (arxiv.org). Compacted events are archived, allowing the model to retrieve the originals by their tags if needed (arxiv.org). The authors evaluated four models—GPT-6.1 Sol, Kimi K3, DeepSeek V4 Pro, and Claude Opus 5.5—across two benchmarks: OfficeQA Pro v2 (90 questions about U.S. federal receipts and expenditures) and MLE-bench Lite (22 Kaggle competitions) (arxiv.org). They tested context budgets ranging from 8K to 512K tokens (arxiv.org). Furthermore, to make model-driven edits cheaper at the inference level, the authors paired the setup with a suffix key-value (KV) cache reuse prototype in the SGLang serving engine, testing it with Qwen3.6-27B (arxiv.org).
The results
According to the authors report, models that effectively use the context API reach higher accuracy and often use fewer input tokens, particularly at tight budgets (arxiv.org). GPT-6.1 Sol nearly triples its score at a 32K budget on OfficeQA Pro v2, moving from 21% to 56% (arxiv.org). Kimi K3 achieves gains with up to 41% fewer input tokens (arxiv.org). Across tasks, GPT, Kimi, and DeepSeek call the context API in 42% to 53% of tasks, whereas Claude Opus 5.5 edits its context in only 4% of tasks (arxiv.org). Models also vary in compaction scale: when GPT compacts, its request shrinks by a median of 3.7 times, compared to 2.1 times for Kimi, 1.8 times for DeepSeek, and 1.5 times for Opus (arxiv.org). GPT retrieves archived content after 19% of compaction calls, compared to 7% for Kimi, 3% for DeepSeek, and 14% for Opus (arxiv.org). Without explicit timing instructions, some models exhibit "context anxiety," compacting much earlier than necessary (arxiv.org). For instance, Kimi's median first compaction drops from about 84% to 29% of the budget at 128K when the timing instruction is removed (arxiv.org). Finally, the suffix KV cache reuse prototype cut prefill compute by 4% to 15% per request across MLE-bench Lite, OfficeQA Pro, and DeepSWE without any measurable impact on task accuracy (arxiv.org).
Why it matters
These findings point to a new co-design frontier where models are trained to actively manage their own context and are served by inference engines that support KV cache editing (arxiv.org). Rather than treating the context window as a passive container managed entirely by external software, giving models agency over their memory can boost reasoning performance while consuming fewer computational resources (arxiv.org).
Caveats
As noted in the paper, this is a preprint study (arxiv.org), meaning the findings have not yet undergone formal peer review. The authors state that models differ widely in how often they use the API, how aggressively they compact, and when they start compacting, and that prompt changes can shift that timing (arxiv.org). Additionally, the degree to which models benefit from context management depends heavily on the task requirements and budget pressures, with gains shrinking as context budgets grow larger (arxiv.org).


