What Happens When Models Manage Their Own Context? Results from NVIDIA’s Agent Harness

Letting models decide when and what to compact, rather than leaving those decisions to the harness, substantially improved accuracy under tight context budgets. The gains, however, varied widely by model.
← All posts
온
온틀 리서치
2026년 11월 30일 36 min read views 0

NVIDIA researchers added a feature to NOOA, their open-source agent harness, that lets models edit their own context. They then compared it directly with the conventional approach, where the harness automatically summarizes the history. The headline finding: giving models control over context management produced higher accuracy within the same context budget, often while using fewer input tokens. The gains were especially large under tight budgets. But the paper’s real message is how much the results depended on which model was doing the work.

The Problem This Paper Addresses

As an agent works, its conversation history grows. Tool calls, tool results, and the model’s intermediate decisions accumulate until they exceed the context window—the number of tokens it can see at once. Trouble starts even before that limit. As information piles up, the model has a harder time finding and using what it actually needs. The paper calls this degradation “context rot.”

Most agent harnesses handle this automatically. Once context usage crosses a threshold, the harness summarizes the older history and clears it away. This process is generally called “compaction.” The paper refers to this approach as harness-driven context management.

There is a structural weakness here. Fixed harness heuristics decide when to compact and which parts of the history to replace; the model merely writes the summary. Think of an assistant who replaces a stack of documents with a single summary memo whenever your desk gets full. You—the person working with those documents—have no say in what disappears. Essential task information can be lost in the process.

The paper asks three questions. Can today’s models manage their own context? Does doing so improve task performance? And can inference engines serve these context edits more cheaply?

The Core Idea

The alternative is model-driven context management. The model chooses both when to compact and what to compact. Returning to the desk analogy, the person doing the work decides whether to clear documents away, which stack to summarize, and whether to retrieve it later.

In NOOA, the model uses a “context API” for two operations. It can inspect its history and replace a range of events with a summary through a collapse call. It can also retrieve the compacted content using its original tags. The crucial detail is that compacted events are archived, not deleted. If the model realizes it needs a document it cleared away earlier, it can restore the original by tag. That differs from the irreversible information loss of harness-driven summarization.

Alongside the API, the experiment gave models three supporting mechanisms: a live indicator of current context usage, an instruction not to consider compaction until usage reached 85%, and a “pressure warning” appended to requests as context approached the limit.

How the Experiments Were Designed

The two strategies followed clearly defined rules.

  • Harness-driven: When usage reaches 80% of the context budget, the harness summarizes earlier history, preserving the initial instructions and the 10 most recent events.
  • Model-driven: The model receives the context API, usage indicator, instruction to “consider compaction starting at 85%,” and pressure warnings described above.

The researchers used two benchmarks with different demands. OfficeQA Pro v2 contains 90 questions about U.S. federal revenue and spending. Agents search and read a large document corpus to answer them, and reading those documents quickly fills the context. This makes it a useful setting for testing how well an agent retains evidence during research. MLE-bench Lite consists of 22 Kaggle competitions, where agents inspect data, write and debug code, evaluate results, and submit predictions. These tasks require repeatedly tracking experiment history, implementation choices, and execution feedback.

Context budgets ranged from 8K to 512K tokens. Reducing the budget increases context pressure: the amount of context a task requires relative to what the window can hold. In effect, this simulates much longer tasks. Each budget is a hard limit on request size. If a request exceeds it, the oldest events are dropped and the request is retried; after three failures, the run is scored as incorrect. The authors acknowledge that this fallback can itself affect scores.

Four models were evaluated: GPT-6.1 Sol, Kimi K3, DeepSeek V4 Pro, and Claude Opus 5.5.

One caveat matters here. These measurements do not directly assess performance on long-running tasks. They use smaller budgets as a proxy to create artificial pressure. The authors also note that this does not capture every property of genuinely long-running tasks.

Results and What They Mean

GPT-6.1 Sol delivered the clearest improvement. On OfficeQA Pro v2 with a 32K budget, accuracy rose from 21% with harness-driven management to 56% with model-driven management. As the abstract puts it, that is nearly a threefold increase. The score is the proportion of all 90 attempts that passed, with error cases included in the denominator.

The gains were largest under tight budgets and diminished as budgets grew. With a larger window, compaction is needed less often, so it makes sense for the strategies to converge. On MLE-bench Lite, the benefit was much smaller and appeared only at the tightest budgets, apparently because the tasks require far less context in the first place. In other words, context management is most useful when the window is small relative to the task’s length.

But not every model benefited equally. The key distinction was whether models used the capability, rather than whether they had it. GPT, Kimi, and DeepSeek called the context API in 42–53% of tasks. Opus did so in just 4%. It was given the feature but barely touched it.

Looking at behavior under pressure with a 64K budget revealed clear differences. After the first pressure warning, Opus usually acknowledged the warning and simply wrapped up with an answer. GPT, by contrast, read the API documentation before compacting in 69% of cases. DeepSeek inspected the event history first in 46%, while Kimi went straight to compaction in 49%. The models also differed in how aggressively they compacted. The paper reports that GPT reduced request size the most per compaction call, with the specific compression ratios shown in Figure 6. Its aggressive compaction also came with the highest rate of retrieving archived content: 19%, compared with 7% for Kimi and 3% for DeepSeek. Opus was at 14%, but its infrequent compaction makes that estimate unstable. Taken together, GPT appears the most adept: it knows when to call the API, compacts most aggressively, and retrieves material when it needs it again.

Token efficiency was also interesting. With a 32K budget, Kimi K3 processed 41% fewer cumulative input tokens under model-driven management—36 million versus 62 million—even though both strategies had the same maximum context size. Its score was also slightly higher: 43% versus 41%. The same budget does not mean the same usage. At 64K, Kimi used about 11% fewer cumulative input tokens than the harness-driven baseline while scoring higher: 57% versus 52%.

Limitations and Open Questions

The authors identify four limitations. First, the benchmarks are small. OfficeQA Pro v2 has 90 questions and MLE-bench Lite has 22 competitions, so small differences between strategies or models may not be significant. Second, the context pressure is simulated. Smaller budgets stand in for longer tasks without capturing all their properties, and the fallback that drops old events at the limit also affects scores. Third, only four models were tested, and their training is unknown. The authors explicitly label the suggestion that GPT may have been trained to manage its own context as speculation, not an established explanation. Fourth, the KV reuse experiment discussed below was validated with only one open model, Qwen3.6-27B, on one serving engine. It measured prefill computation, not end-to-end latency or cost.

I would add another limitation: the conclusion that model-driven management helps is effectively conditional on the model using the feature well. Giving control to a model like Opus, which barely calls the API, does little to distinguish it from harness-driven management. Prompting is another variable. As the next section shows, a single timing instruction—“consider compaction starting at 85%”—substantially changed behavior. That suggests this capability is not yet reliably embedded in the models themselves.

The Complication of Context Anxiety

Another finding worth examining is what the paper calls “context anxiety.” Even models that use the API well tend to compact more aggressively than necessary, keeping context small despite having room to spare.

Removing the timing instruction substantially changed some models’ behavior. Consider the first compaction point: the median percentage of the budget used when a task first triggers compaction. For Kimi at 128K, it shifted from about 84% to 29%. For DeepSeek at 256K, it shifted from 83% to 40%. GPT was less sensitive, which may reflect differences in training. Opus barely compacted with the instruction in place, but without it, it regularly compacted early, at a median of 16% usage with a 128K budget.

Clearing context too early comes at a cost. At budgets of 128K and above, the variants without the timing instruction scored about 8 points below the harness-driven baseline for Kimi and DeepSeek. GPT and Opus showed no comparable change. Why compact so early? The paper points to Kimi K3’s training, which used RL penalties for excessively long rollouts. It may have learned to conserve tokens even when space remains available.

From Fewer Tokens to Cheaper Inference

Input token counts tell only half the story. Inference engines reuse computation for an unchanged prompt prefix through the KV cache, avoiding the need to process the entire prompt again at every turn. But when an edit replaces part of the history with a summary, the cache remains valid only up to the edit. Everything after it is invalidated, including text that has not changed. A smaller context therefore does not automatically mean cheaper inference.

The paper connects an approach that reuses the KV cache for the unchanged suffix after an edit to the NOOA context API, implementing a prototype in SGLang. Tested with Qwen3.6-27B and a 32K context on MLE-bench Lite, OfficeQA Pro, and DeepSWE, it reduced prefill computation per request by 4–15% relative to standard prefix caching, with no measurable effect on task accuracy. OfficeQA Pro saw the largest savings because a large amount of suffix text survives each edit: about 10K tokens on average, or roughly 60% of the prompt. Its tool calls retrieve long documents that remain in context.

This points toward designing models, harnesses, and inference engines together. When models edit their own context, the harness and engine become partners in deciding what to retain and how to serve it efficiently.

How This Compares with Other Approaches

Context management research has taken several directions recently. MemGPT introduced hierarchical memory. Recursive Language Models keep long inputs in an external programming environment and process them through recursive calls. MEMENTO, AgentFold, and Context-Folding explore learned mechanisms for preserving, condensing, and restructuring past computation. Related work includes SelfCompact, which uses a prompting rubric to let models trigger compaction without fine-tuning; Context Language Models, which expose live context as editable files; and SideQuest, which uses auxiliary inference tasks to choose which KV cache contents to remove.

This paper positions itself as an empirical study of how current models actually behave under a shared context management API, rather than as a proposal for a new technique. Its contribution is measuring how differently frontier models behave when given the same control, and how those differences relate to performance and efficiency. On serving efficiency, it overlaps with Suffix Cache Reuse from Context Language Models, SideQuest, and Cache Engineering for Agents. Here, however, the researchers paired the reuse prototype with the model-driven API and measured its effects on both prefill computation and accuracy.

ONTLE’s Perspective

ONTLE is a service that assigns AI project managers to projects. Part of an AI PM’s job is to follow a long-running project through to completion. Consider a two-month project. The AI PM continually accumulates meeting notes, decisions, task status by owner, and the full history of issues that stalled work the previous week. After a few weeks, those records will exceed any context window.

Here is the kind of failure that automatic harness summarization can cause. Once the window fills up, the harness replaces earlier history with a summary memo. In the process, it loses a decision from 3 weeks earlier: “Put this feature on hold until legal review.” Unaware of that constraint, the AI PM restarts the task. With an irreversible summary, there is no way to recover the missing information.

That is exactly where the paper’s model-driven approach changes things. First, letting the model choose what to clear gives it a chance to preserve critical constraints such as a legal hold. Second, compaction archives content rather than deleting it, so the original can be retrieved by tag. Third, the finding that benefits were greater for long-running projects under tight budgets has direct relevance to products like ONTLE that handle work stretching over time.

But we need to take the paper’s lessons seriously. The benefit depends entirely on the model. Giving control to a model like Opus, which barely uses the API, accomplishes little. And if a single instruction such as “consider compaction starting at 85%” can substantially change behavior, ONTLE needs to tune compaction timing prompts carefully and validate them empirically when configuring PM agents. Without guidance, models may behave like Kimi and DeepSeek: clearing context while space is still available, losing important information, and scoring worse.

A Checklist for Practitioners

  • Choose the model before the strategy. Before enabling model-driven context management, check whether your intended model actually calls the context API. In the paper, API usage ranged from 42–53% at one end to 4% at the other.
  • Make compaction timing instructions explicit and validate them. Removing the instruction shifted first compaction from usage in the 80% range to the 20–40% range. Variants that compacted too early scored worse under larger budgets.
  • Start with tasks under tight context budgets. Gains were largest with small budgets, and the strategies converged as budgets grew. Short tasks, such as coding work with modest context requirements, may see smaller benefits.
  • Design compaction as archiving plus retrieval. Models differed in how often they retrieved archived content, with rates reaching 19%. Without a retrieval path, more aggressive compaction carries a greater risk of information loss.
  • Do not judge token savings solely by input tokens per request. Editing the middle of the context invalidates the KV cache for what follows, so a shorter context does not necessarily mean cheaper inference. Check whether your serving engine can reuse suffix KV caches.
  • Measure again in your own environment. The reported gains apply to specific combinations of models, budgets, and benchmarks. The 4–15% savings from KV reuse measure prefill computation on one open model and one engine.
Does model-driven context management always improve accuracy?

No. It improved accuracy only for models that used the feature effectively. GPT jumped from 21% to 56% on OfficeQA Pro v2 with a 32K budget. Opus, which barely used the API, actually underperformed the harness-driven baseline until budgets grew large enough for the two strategies to converge.

What happens if compacted content is needed later?

In NOOA, compacted events are archived rather than deleted. The model can retrieve the originals using their original tags. GPT retrieved archived content in 19% of compaction calls, a figure reported as a lower bound. Harness-driven summarization does not provide this recovery path.

Under what conditions did scores drop by 8 points?

When the timing instruction (“consider compaction starting at 85%”) was removed, Kimi and DeepSeek scored about 8 points below the harness-driven baseline at budgets of 128K and above. GPT and Opus showed no comparable change under the same conditions. This is a result for specific conditions, not a figure that applies to every model and budget.

How extensively was KV cache reuse validated?

The prototype was tested with one open model, Qwen3.6-27B, on the SGLang engine, using a 32K context across three benchmarks. It reduced prefill computation per request by 4–15% compared with standard prefix caching, with no measurable change in accuracy. However, it measured prefill computation rather than end-to-end latency or cost, which the authors acknowledge as a limitation.

Can these results be applied directly to a product?

The benchmarks are small—90 questions and 22 competitions—and context pressure is approximated by reducing budgets, so small differences may not be significant. Before adopting the approach, measure in your own environment whether your intended model actually calls the API and how compaction timing instructions affect your tasks.

References