Skip to content
←Back to Papers

PAPER DEEP DIVE

Agent HarnessContext ManagementKV Cache

Letting Models Manage Their Own Context: Where We Stand

The authors let models decide when and what history to compact through NOOA's context API, then compare model-driven and harness-driven management from 8K to 512K tokens on document research and machine learning engineering. Effective use improves accuracy and can reduce input tokens, while suffix KV-cache reuse lowers prefill compute by 4-15% without measurable accuracy loss.

Paper information

Paper: “Letting Models Manage Their Own Context: Where We Stand.”

Authors: Alessio Devoto, Avinash Vem, Tara Safavi, Sanjay Kariyappa, Yu-Hsuan Tseng, Paul Furgale, and Ricardo Silveira Cabral.

Source: arXiv:2611.34147, November 25, 2026.

Code: Publicly available in NVIDIA-NeMo/labs-OO-Agents. This analysis checks commit d4daffb, which contains the event-collapse and archived-event access path.

One-sentence summary: The paper moves control over when and what to compact from the outer harness to the model, then shows that this control helps only when the model can use it, the prompt exposes the right state, and the serving stack can make edits cheaper.

Why this problem matters

Most agent harnesses separate problem solving from context administration. The model chooses tools and produces an answer, while the harness watches token usage and summarizes history near a threshold. A common policy preserves the initial instructions and the latest few events. It is deterministic, easy to audit, and works reasonably well when every task has the same context dynamics.

Agent workloads violate that assumption. A document agent may spend several turns searching before a tool returns a large body of evidence that must remain available for follow-up questions. A coding agent may alternate between failed executions, patches, test logs, and conclusions that are no longer relevant. A fixed trigger knows that the window is filling, but it does not know which evidence has become disposable or which old instruction constrains the next action.

The paper studies a model-driven alternative. The model receives a context API and can collapse a selected range of events into a summary or truncation marker. It can therefore connect context maintenance to its current plan instead of waiting for an external threshold. NVIDIA's open-source NOOA harness supplies the event substrate used in the experiments.

The research question has three parts. Can a model recognize when context work is useful? Can it select a range without destroying evidence that later turns need? Can the serving system reuse enough computation after the edit to make the choice efficient? The paper contributes a joint examination of these questions rather than treating the API call as an isolated capability.

The experiments use OfficeQA Pro v2 and MLE-bench Lite. OfficeQA contains 90 questions over U.S. federal receipts and expenditures; document search and reading make it a natural pressure test for evidence retention. MLE-bench Lite contains 22 Kaggle competitions that require dataset inspection, code, execution feedback, and iteration. The authors sweep context budgets from 8K to 512K to simulate different levels of task pressure.

Analytical notation

The paper does not present a conventional sequence of numbered equations. To make the experimental logic explicit, this article uses derived formalizations. They describe relationships defined in the prose and tables; they are not presented as numbered claims from the paper.

Let $C$ be the effective task content in tokens and $B$ the hard context budget. Context pressure can be written as:

$$P(B)=\frac{C}{B}$$

This is more informative than raw occupancy. Two requests may both use 32K tokens while one is carrying necessary evidence and the other has repeatedly copied obsolete tool output. A smaller budget raises the pressure on the second request differently from a task whose information density is genuinely high.

Let $B_t$ denote context use at turn $t$. With a timing instruction $\phi$, the first eligible compaction point is:

$$T_{\phi}=\min\{t\mid P(B_t)\geq \phi\}$$

The model-driven condition uses $\phi=0.85$. The harness-driven comparison triggers at 80% and preserves the initial instructions plus the ten most recent events. Their difference is not merely five percentage points; one policy is fixed, while the other is conditioned on the model's representation of the task.

Given cumulative input $I_H$ for the harness and $I_M$ for the model, token savings are:

$$S_{\mathrm{in}}=\frac{I_H-I_M}{I_H}$$

For a single compaction, let $C_{\mathrm{before}}$ be the input size at the compaction request and $C_{\mathrm{after}}$ the size of the following request. The compression factor is:

$$R=\frac{C_{\mathrm{before}}}{C_{\mathrm{after}}}$$

A value above one means the request became smaller. A value below one means the generated summary plus new tool output made it larger. This definition is important because a successful API call is not automatically a useful compression event.

How model-driven context management works

NOOA stores agent history as ordered, tagged events. An event may be a user message, an assistant action, a tool call, or a tool result. A summary is also represented as an event, but its tag identifies the range it replaces. The model sees the active tags, chooses a continuous interval, and invokes collapse.

Collapse changes the active view. The selected events are marked archived and removed from the ordered list of active tags, while one summary tag is inserted where the range used to be. The original objects remain addressable by their old tags. This separation between “not currently rendered” and “deleted from the system” is the basis of recovery.

Comparison of harness-driven and model-driven context management

Figure 1: The harness compacts at a fixed threshold above; the model edits its own context below. Extracted from the paper's original HTML.

In the harness-driven path, the system summarizes earlier history when the budget reaches 80%. In the model-driven path, the model receives a live usage signal, guidance to consider compaction only after 85%, and a pressure warning when the request approaches its limit. The warning does not force an action. The model may answer immediately, compact, inspect the API documentation first, or examine event history.

The source mapping is direct. src/nooa/runtime/events.py exposes collapse(start_tag, end_tag, summary_text) to the model-facing interface. It validates the endpoints and delegates to the event manager. The manager archives every active event in the selected interval, removes those tags from the active order, creates a summary with the range tag, and inserts that summary at the original position.

The implementation does more than substitute text. A summary records the replaced range and its child tags. The manager adds recovery instructions that tell the model how to query original events, read one by tag, or expand the summary's children. Tests verify that the first and last original events can still be accessed after collapse. This makes the summary an index over retained history, not an irreversible deletion.

Collapsing events and retrieving an archived event by original tag

Figure 2: A range becomes a summary tag while original events remain queryable by their earlier tags. Extracted from the paper's original HTML.

Visibility is enforced during prompt construction. src/nooa/runtime/context_builder.py reads active event values from the event manager. The manager obtains those values through the active-tag list, so archived originals do not silently return in a normal request. test_archived_events_excluded_from_context.py also covers query-filtered construction, because a filter applied to the wrong collection could expose archived events behind a summary.

The complete loop is therefore: observe pressure, choose a range, collapse it into a tagged summary, render only active events, preserve stable access to originals, and recover details when needed. This is distinct from a lossy transcript truncation or a generic retrieval layer. The model controls structural edits with explicit semantics.

The pressure warning supplies state that a model cannot infer reliably from the visible text alone. A provider may report different token counts, and a request can grow sharply after a tool response. Exposing remaining capacity lets the model plan. Automatically compacting at the same point removes that planning problem but also removes any opportunity for task-specific choices.

The design does not assume that model judgment is always good. A model can compact too early, produce a summary that removes a needed entity, retrieve the same archive repeatedly, or ignore the warning until the harness fallback takes control. The paper therefore measures behavior as well as final score: API use, compression factor, archive reopening, first-compaction timing, and token use.

flowchart TD
  A[Live context usage] --> B{Approaching 85 percent}
  B -- No --> C[Continue task]
  B -- Yes --> D[Model selects event range]
  D --> E[Collapse into summary tag]
  E --> F{Need original detail}
  F -- Yes --> G[Query or expand archived tags]
  G --> C
  F -- No --> H[Continue reasoning]
  C --> I[Edited request]
  H --> I
  I --> J[Reuse unchanged suffix KV]
  J --> C
    

Context editing creates a serving problem. Standard prefix caching reuses computation before the first changed token. A collapse introduces a new summary at the edit point, so the summary and the text after it no longer share the old prefix. A shorter prompt may still require fresh prefill for most of its later content.

Figure 12 isolates this issue. Replacing a range with a summary shortens the request, but the new summary and the downstream suffix need computation in the standard path. The prototype asks whether the unchanged suffix can retain useful KV state even though its absolute position or preceding context changed.

Compaction invalidates the summary and the text after it for standard prefix reuse

Figure 12: The summary and everything after the edit require fresh computation under standard prefix caching. Suffix KV reuse targets this region. Extracted from the paper's original HTML.

Let $K_{\mathrm{suf}}$ be the number of tokens in the surviving suffix and $B$ the context budget. Its fraction is:

$$\rho=\frac{K_{\mathrm{suf}}}{B}$$

On OfficeQA Pro, the average surviving suffix is about 10K tokens, roughly 60% of the prompt, so $\rho\approx0.60$. Retrieved documents remain in the context while earlier conversational events are summarized. The task therefore creates a large unchanged region after the edit, unlike a workload that rewrites every message on every turn.

If $P_{\mathrm{prefix}}$ is prefill under standard prefix caching and $P_{\mathrm{suffix}}$ is prefill with suffix reuse, the reduction is:

$$\Delta_p=\frac{P_{\mathrm{prefix}}-P_{\mathrm{suffix}}}{P_{\mathrm{prefix}}}$$

The SGLang prototype with Qwen3.6-27B reports a 4% to 15% reduction per request. The measured quantity is prefill compute, not wall-clock latency, scheduler overhead, or monetary cost. The distinction matters because a serving optimization can reduce arithmetic while leaving the end-to-end critical path nearly unchanged.

The system lesson is that an editable context needs a compatible inference interface. Model output can describe a compact summary, but the serving layer must know which cached blocks remain semantically reusable. If it recomputes the full edited sequence, semantic improvements in accuracy may coexist with an avoidable serving penalty.

What the experiments show

The strongest accuracy result appears at a 32K budget on OfficeQA Pro. GPT-6.1 Sol rises from 21% under harness-driven compaction to 56% under model-driven management. This is nearly a threefold increase at the same budget. The result is not a cosmetic gain in response quality: the evaluated unit is whether the agent passes the task.

The effect is concentrated at tight budgets. GPT and Kimi benefit at small windows, while Opus trails the harness until the budget becomes large enough for the strategies to converge. MLE-bench Lite shows a much smaller difference, mostly at the tightest budget, because its tasks require less context than document research. The authors do not claim that model-driven management dominates everywhere.

Analytical table 1: Behavior and compression outcomes, synthesized from Sections 5 and 6 rather than a numbered table in the paper
ModelTask-level API useMedian compressionArchive reopenedFirst compaction without timing instruction
GPT-6.1 SolWithin the 42% to 53% group3.7x19%Less sensitive to the instruction
Kimi K3Within the 42% to 53% group2.1x7%About 84% to 29% at 128K
DeepSeek V4 ProWithin the 42% to 53% group1.8x3%83% to 40% at 256K
Claude Opus 5.54%1.5x14%, noisy estimate16% median at 128K

All models received the same interface, but their operating styles diverged. GPT, Kimi, and DeepSeek used it in 42% to 53% of tasks, while Opus used it in only 4%. GPT compressed most aggressively, at a median factor of 3.7x, and reopened archived content after 19% of its compactions. Kimi's factors and reopening rates were 2.1x and 7%; DeepSeek's were 1.8x and 3%. Opus compressed 1.5x and reopened at 14%, but the estimate is noisy because compaction was rare.

Behavior after a pressure warning also differs. At 64K, Opus usually acknowledges the warning and wraps up. GPT reads the API documentation before compacting in 69% of the relevant episodes. DeepSeek inspects event history first in 46%, and Kimi compacts immediately in 49%. These choices are not simply right or wrong. They expose different assumptions about how much planning is needed before changing the prompt.

The paper labels premature compaction as context anxiety. With the instruction to consider compaction only near 85%, most models wait near that threshold. Remove the instruction and Kimi's median first compaction falls from about 84% to 29% at 128K. DeepSeek falls from 83% to 40% at 256K, and Opus compacts at a median of 16% at 128K. The models are preserving space while useful space still exists.

That behavior can hurt. At budgets of 128K and above, the variants without the timing instruction score about eight points below the harness baseline for Kimi and DeepSeek. GPT and Opus do not show the same change. A concise context is therefore not automatically a better context. The value depends on whether the removed material is still needed and whether the model can recover it.

Analytical table 2: OfficeQA Pro v2 accuracy and cumulative input, synthesized from Sections 6 and 7
SettingBudgetHarness accuracyModel-driven accuracyModel-driven input change
GPT-6.1 Sol32K21%56%No comparable saving reported
Kimi K332K41%43%62M to 36M, 41% fewer
Kimi K364K52%57%About 11% fewer

Kimi's 32K result separates budget from consumption. Both strategies have the same maximum request size, yet the model-driven run processes 36 million cumulative input tokens instead of 62 million and scores two points higher. The model is not reading less evidence by accident. It is changing the history at useful points, reducing the amount of obsolete material carried into later requests.

At 64K, Kimi improves from 52% to 57% while using about 11% fewer cumulative input tokens. GPT does not show a comparable token reduction despite its large accuracy gain. A system may therefore trade more lookups for a higher success rate, or save tokens while losing necessary evidence. Accuracy and token efficiency are related outcomes, not interchangeable measures.

The suffix-reuse experiment uses Qwen3.6-27B at a 32K context on MLE-bench Lite, OfficeQA Pro, and the agentic coding benchmark DeepSWE. Relative to standard prefix caching, the prototype reduces prefill by 4% to 15% per request, with no measurable change in task accuracy. OfficeQA benefits most because its average surviving suffix is large.

Analytical table 3: Reported boundaries of suffix KV reuse, synthesized from Section 7
DimensionReported resultInterpretation boundary
Model and engineQwen3.6-27B, SGLang prototypeOne open model and one serving implementation
Prefill reduction4% to 15% per requestNot end-to-end latency or cost
OfficeQA suffixAbout 10K tokens, roughly 60%Retained document text creates a large reusable region
AccuracyNo measurable changeApproximate reuse still needs broader validation

The three measurements should not be collapsed into one score. Accuracy asks whether the model completes the task. Cumulative tokens ask how much history the agent transports across its trajectory. Prefill reduction asks how much serving computation remains after an edit. Together they map the model-harness-inference frontier that the paper identifies.

Code evidence and engineering implications

The public repository supports the paper's conceptual description with implementation and tests. The model-facing collapse() method validates tags and delegates to the manager. The manager changes event status, updates the active order, constructs a summary event, and preserves the archive. This is stateful infrastructure, not a prompt-only convention.

The visibility path is equally important. context_builder.py builds from active event values. If it instead filtered the complete event store, an archived original could reappear whenever a new query matched its type or content. The test suite explicitly checks both the unqueried and queried paths, because context compression is only real if every rendering route excludes the archived originals.

Recovery instructions are embedded with the summary and updated through child tags for nested collapses. The model can search originals, read one by tag, or expand the summary. This structure supports audit and repair. It also makes the summary accountable: the model can inspect what the summary replaced instead of treating it as an opaque statement.

These semantics matter for embodied agents. A long robot task combines operator constraints, sensor summaries, tool responses, plans, failures, and safety checks. Re-fetching a sensor frame may be cheap, while reconstructing an operator's one-time constraint may be impossible. A policy that always retains the latest ten events can preserve the freshest status while deleting the oldest invariant.

Production use would need more diagnostics than the paper reports. Archive reopening is a useful signal, but it does not reveal whether a summary silently changed an entity, omitted a negative result, or preserved a stale plan. Systems should track evidence references, constraint coverage, query cost, summary provenance, and the task stage at which compaction occurs.

Limitations

The authors explicitly note that both benchmarks are small. OfficeQA Pro v2 has 90 questions and MLE-bench Lite has 22 competitions. Differences between strategies or models may not be statistically significant, so the results should not be generalized into a universal performance ranking.

The second author-stated limitation is simulated context pressure. Reducing the budget forces compaction quickly, but it does not reproduce every property of a task that naturally runs for hours across tools and sessions. The hard-limit fallback removes oldest events and retries, which can itself alter scores. Some failures may therefore come from the safety path rather than the model's decision.

Third, the authors do not know how the four evaluated models were trained. The explanation that GPT may have received related training is a conjecture, not an ablation. Tool-use style, long-context training, and output conventions may all affect how readily a model adopts the context API.

Fourth, suffix KV reuse is tested with one open model in one serving engine. It is an approximation to full recomputation, and the paper measures prefill compute rather than end-to-end latency or cost. Performance and safety may change with other architectures, batching policies, cache layouts, and hardware.

A further issue is experimental symmetry. The model-driven condition receives a live meter, a timing instruction, and a pressure warning, while the harness policy is a fixed trigger. The large GPT gain may come partly from those additional signals rather than from decision ownership alone. A stronger ablation would give the harness policy the same state and vary only who chooses the compaction range.

Finally, the paper cannot show when a compressed context has become semantically wrong. Reopening reveals that the model sometimes knows it lacks information. It does not cover cases where the model confidently continues from a plausible but distorted summary. Auditable provenance and immutable task constraints should accompany model-selected compaction in high-stakes settings.

Conclusion

The paper does not argue that models should replace every harness policy. It shows that context control is useful when model behavior, prompt state, archive semantics, and inference support are designed together. Models that use the interface well can improve accuracy at tight budgets and reduce transported history; models that ignore or overuse it can lose evidence or accumulate avoidable retrieval.

NOOA supplies a concrete context substrate: range collapse, stable tags, hidden but retained originals, explicit recovery, and active-view construction. The suffix-cache prototype addresses the next layer by recognizing that edited prompts should not always pay full prefill for unchanged text after the edit.

The most valuable next steps are clear. Train models to estimate future evidence value rather than merely minimizing length. Compare model-driven and harness-driven policies with equal context signals. Evaluate real long-horizon tasks with latency, cache behavior, and safety-constraint retention, not only token counts. The central engineering question is no longer whether a context can be shortened, but whether the system can shorten it without losing the ability to reason or recover.

Golden quote

Context management succeeds when hidden history is still recoverable evidence, not when the prompt merely becomes short.

Related Papers

GUARD: Stabilizing Recursive Self-Improvement with Regret Guidance

GUARD: Stabilizing Recursive Self-Improvement with Regret Guidance

Autonomous AI agents pair a frozen base model with an editable harness of prompts, skills, tool rules, and memory. Recursive self-improvement (RSI) adapts this harness from experience without weight updates, yet self-editing without external graders often backfires: reflection and scalar scores conflate what an edit newly broke with what remains unsolved, causing local regressions, skill forgetting, and memory bloat. We introduce GUARD (Grader-free Unsupervised Environment Design [UED] with Adaptive Rule Distillation), a closed-loop framework for reference-free continual harness evolution. Our key insight is to decompose each task into pre-execution self-checks and guide harness updates via directional regret. Each round grades trajectories against these checks, pinning mastered rules while prioritizing newly broken behaviors, and selects among parallel candidate edits by critic-free group-relative fitness. A Soft-HURT gate then promotes an edit only when gains outweigh regressions, scoping specialized fixes to prevent over-triggering and guaranteeing non-regression on its gated buffer. At test time, one frozen harness runs in a single pass. Across benchmarks on memory, skill evolution, continual task streams, and domain reasoning, GUARD consistently improves performance without catastrophic forgetting or memory pollution while substantially cutting deployment token usage.

Minghe Zhang, Xuetao Kang, Yifei Ming · 355 views · Nov 17, 2026
LLMAgent Harness
Nov 17, 2026
Self-Improvement Memory Enables Continual Recursive Self-Improvement

Self-Improvement Memory Enables Continual Recursive Self-Improvement

This paper introduces Continual Recursive Self-Improvement (CRSI) for agent harnesses and Self-Improvement Memory (SIM), a structured record that links recurring root causes to selected edits, rationales, and predicted or observed outcomes. Starting from a harness evolved on a source benchmark or model, CRSI resumes optimization after a dataset or model transition rather than restarting. Across six cross-dataset settings, full SIM has the highest final held-out score and beats harness-only transfer by 2.43 to 4.35 points; across four Opus-to-Gemini model-family transfers it beats the harness-only continuation by 3.60 to 11.33 points. A ten-run paired coding study reports a mean gain of 2.36 points over continuation without SIM (95% CI 1.05 to 3.68, p=0.003).

Xin Yu, Fei Xia, Jiaqi Pan · 386 views · Nov 13, 2026
Agent HarnessRecursive self-improvement
Nov 13, 2026
Is Complex Agentic Memory Always Needed? Naive RAG Is Stronger Than We Thought

Is Complex Agentic Memory Always Needed? Naive RAG Is Stronger Than We Thought

LLM memory is widely used in long-term conversation understanding. Agentic memory systems often use mutation, structural organization, learned retrieval strategies, or other complex operations. Is this complexity always necessary? We study Raw-RAG, a naive RAG baseline using dense retrieval and reranking over raw history to supply evidence to a reader LLM. Across LoCoMo, LongMemEval, MEME, and MemoryAgentBench, Raw-RAG ranks first among the compared memory systems in six of seven benchmark-model settings, outperforming the strongest compared agentic memory system by 0.13-5.53 points. We investigate why raw-history retrieval remains competitive. Evidence analysis shows that its higher coverage of necessary evidence can offset lower utilization. Useful evidence includes both answer values and the relations and dependency paths needed to derive them. Even complete access to transformed memory stores leaves an accuracy gap relative to raw evidence, highlighting the importance of preserving raw information. These findings challenge the necessity of complex agentic memory for the evaluated conversation tasks and establish naive RAG as an essential baseline.

Bao, Zhengye, Zhang, Shengtao, Zhang, Haokai · 561 views · Oct 22, 2026
Agentic MemoryRAG
Oct 22, 2026
Hybrid Computer Use: A Unified Programmatic, Semantic, and Visual Interface for General Agents

Hybrid Computer Use: A Unified Programmatic, Semantic, and Visual Interface for General Agents

The paper introduces Hybrid Computer Use (HCU), a unified agent interface that combines code and command-line interaction, accessibility-tree semantics, and screenshot-based mouse and keyboard control in one context. Compact observations, batched action execution of up to 64 steps, wait steps, post-action diffs, and cross-channel goal and layout guards reduce round trips and prevent stale-input actions. HCU improves task success or interaction efficiency across OSWorld 2.0, OSWorld 1.0, WeaveBench, macOS, and Windows Agent Arena.

Haoqing Wang, Xiaoyi Zhang, Sicheng Fan · 390 views · Oct 30, 2026
Agent HarnessComputer Use
Oct 30, 2026

As an Amazon Associate, we earn from qualifying purchases.