Skip to main content

Your agent reads documents, calls tools and writes code on your own GPU servers. On a long task its history outgrows the context window, and the agent harness, the program that runs the model’s loop of tool calls, summarises it. The agent keeps going, but some facts it needed are gone. A longer window is no free fix either: every token in context holds KV-cache memory and costs prefill compute. On 25 November 2026 NVIDIA researchers published a test of another option: let the model decide when and what to compact. This article sets out what they measured, what it changes when you choose a model, a harness and an inference engine for agents, and what the study does not prove.

Two ways to compact an agent’s history

As an agent works, its history of tool calls, outputs and model turns grows. The model finds the relevant parts less reliably, an effect researchers call context rot, and in the end the history no longer fits the window.

Harness-driven compaction is the default in today’s agent harnesses. When context usage crosses a threshold, the harness asks a model to summarise the earlier history. In the study the threshold was 80 % of the budget, and the harness kept the initial instructions and the 10 most recent events word for word. A fixed rule decides when and what; the model only writes the summary. The paper calls this simple, but lossy: facts the task needs can fall out of the summary.

Model-driven context management gives the decision to the model. In NOOA, NVIDIA’s open-source agent harness, the model sees a live context-usage indicator and gets a context API. One call replaces a range of events with a summary the model writes. The originals go to an archive, and the model can read any of them again by its tag. Nothing is deleted; it only leaves the window.

What the study measured

The researchers ran both strategies on two benchmarks. OfficeQA Pro v2 is document research: 90 questions answered from a large corpus of US federal receipts and expenditures, where reading documents fills the context fast. MLE-bench Lite is machine learning engineering: 22 Kaggle competitions, in which the agent inspects data, writes and debugs code and keeps track of its experiments. They cut the context budget from 512K tokens down to 8K to simulate much longer tasks, and tested four models: GPT-6.1 Sol, Kimi K3, DeepSeek-V4-Pro and Claude Opus 5.5.

The headline result comes from document research at a tight budget. At 32K tokens, GPT-6.1 Sol scored 21 % with harness-driven compaction and 56 % when it managed its own context, with no extra training.

For a GPU budget, Kimi K3’s result matters more. At the same 32K budget, managing its own context, it processed 41 % fewer input tokens over the run and still scored slightly higher: 43 % against 41 %. At 64K it used about 11 % fewer input tokens and scored 57 % against 52 %.

Not every model gained: DeepSeek-V4-Pro improved less, and Claude Opus 5.5 trailed the harness-driven baseline until the budget was large enough for the two strategies to converge. The gains are largest where the window is tight against the task, and they shrink as the budget grows. On MLE-bench Lite the effect was much smaller and showed only at the tightest budgets, probably because its tasks need far less context.

The same API, four different habits

All four models got the same API and the same instructions. They used them very differently.

The authors see GPT as the model most at ease with the API. As a conjecture, they suggest that training for this kind of context management may contribute to its stronger results. A model that has only worked in harnesses that compact for it, they note, does not necessarily learn when to compact or what to keep.

Context anxiety: compacting while space remains

The model-driven runs told each model to consider compacting only once usage reached 85 %. With that line, most models waited until close to that point. Without it, some compacted far earlier. Kimi’s median first compaction at a 128K budget fell from about 84 % of the budget to 29 %. DeepSeek’s at 256K fell from 83 % to 40 %. Opus, which almost never compacted with the line, compacted regularly without it, at a median of 16 % at 128K.

The paper calls this context anxiety. For Kimi and DeepSeek it cost accuracy: at budgets of 128K and above, without the timing line, they scored about 8 points below the harness-driven baseline. GPT and Opus showed no comparable change. The paper points to training: many models are trained to keep their context short, and Kimi K3 is trained with penalties for overly long rollouts, which may teach it to save tokens even when space remains. The practical point is that one line of instructions moves a model’s compaction timing a long way, so that line belongs in your tests.

Fewer tokens do not yet mean less GPU work

Inference engines avoid computing the whole prompt on every turn. vLLM and SGLang keep the KV cache of the prompt’s unchanged prefix and compute only what is new. A compaction edits the history in the middle. The cache stays valid up to the edit; the summary and everything after it is computed again, including text that did not change. A shorter prompt is therefore not automatically a cheaper one.

The researchers tested a fix: after an edit, reuse the KV cache of the unchanged suffix as well. Their prototype in SGLang, with the open-weight model Qwen3.6-27B at a 32K budget, cut prefill compute per request by 4–15 % against standard prefix caching, with no measurable change in task accuracy. They measured it on MLE-bench Lite, OfficeQA Pro and the coding benchmark DeepSWE. The saving was largest in document research, where the text that survives an edit made up about 60 % of the prompt on average: the long documents the agent had retrieved. Suffix reuse is an approximation of full recomputation, and the engines in production today, the paper notes, reuse the cache only up to the first change.

What this means for agents on your own GPUs

Two of the four models, GPT-6.1 Sol and Claude Opus 5.5, are available only as cloud services. Kimi K3, DeepSeek-V4-Pro and Qwen3.6-27B are open-weight models of the kind you run on your own servers. From the study we draw five engineering rules. They are our reading, not the paper’s claims.

  1. Test the model’s context habits, not only its benchmark score. The same API took one model from 21 % to 56 % and went almost unused by another. Run your shortlisted open-weight models on your own agent tasks with both compaction modes before you fix the model.
  2. Test at the budget you will run. The gains appear where the context is tight against the task, and memory sets that budget, because the KV cache grows with the tokens in context. In the worked example of LLM hardware requirements, Configuration C4 holds Trinity-Large-Thinking in NVFP4 and the FP8 KV cache of 50 sessions at 32K tokens; at 128K the same memory holds ≈ 15 sessions. If you plan many concurrent sessions per server, you will run tight budgets, and that is where model-driven compaction helped GPT and Kimi most.
  3. Put the timing rule in the prompt and measure it. Without it, two open-weight models compacted at well under half of the budget and lost accuracy at large budgets. Keep harness-driven compaction as the fallback for a model that does not act.
  4. Count prefill, not only tokens. Every compaction makes the engine recompute the prompt from the edit on. When you size prefill compute for agents, include that recomputation. Follow suffix KV reuse in vLLM and SGLang, but do not plan capacity on the prototype’s saving yet.
  5. Treat the archive as session data. Compacted events are archived, not deleted, and the models went back to them. The archive holds the same data as the session, so the same access and retention rules apply to it.

What the study does not show

The authors list the limits themselves.

Ask an engineer about your agents

Send us what your agent does, the models on your shortlist and the context length its sessions reach. An engineer replies with how we would test both compaction modes on your tasks and how the result changes the server size: ask an engineer about agent context.

If your team builds the agent harness itself, forward them this article together with the paper, Letting Models Manage Their Own Context: Where We Stand.

Send us your users, your models and your data rules. An engineer replies with the stack that fits.

An engineer replies in writing within one business day. No sales calls unless you ask for one.

Ask an engineer

Ask an engineer

An engineer replies in writing within one business day.No sales calls unless you ask for one.

We use your details only to answer your question. Privacy notice