Harness Hub
All papers

Letting Models Manage Their Own Context: Where We Stand

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

Verdict: Incremental

The per-model call rates and the prompt's effect on compaction timing are a small measurement on an idea already in MemGPT, SelfCompact, Context Language Models, and Codex. They do not identify model-driven compaction as an accuracy or cost upgrade: the headline cells are confounded, small, and not the same experiment as the serving prototype.

  • Novelty

    2 out of 5
  • Rigor

    2 out of 5
  • Reproducibility

    1 out of 5
  • Relevance to harnesses

    4 out of 5

TL;DR

In NOOA, some models beat a fixed 80% summarizer on a 90-question doc task at tight budgets, but 21% to 56% and the 15% prefill cut are best-case cells, and overflow forfeits are scored as wrong answers.

Adversarial review by Harness Hub · Nov 28, 2026 · read full text · Suggest a correction

Original abstract (authors’ text, select to expand)

Agent harnesses today manage context on the model's behalf: when the window fills, the harness triggers a compaction that summarizes the history. We study the alternative, \emph{model-driven} context management, in which the model itself decides when and what to compact through a context API. We gave models control over their own context in \nooa, NVIDIA's open source agent harness, and compared the two strategies on document research and machine learning engineering across context budgets from 8K to 512K tokens. Models that use the context API effectively reach higher accuracy, often with fewer input tokens, especially at tight budgets: \textbf{GPT 6.1 nearly triples its score at a 32K budget} on OfficeQA Pro v2 (21\%~$\rightarrow$~56\%), and \textbf{Kimi gains with up to 41\% fewer input tokens}. Models differ widely, however, in how often they use the API, how aggressively they compact, and when they start compacting, and prompt changes shift that timing. Finally, we show that \textbf{inference engines can make model-driven edits cheaper}: by reusing the KV cache of the unchanged suffix after an edit, \textbf{we cut prefill compute by up to 15\% per request with no measurable change in accuracy}. Together, these results point to a new co-design frontier: models trained to manage their own context, served by inference engines that support KV cache editing.

Filed underharnesscontext-engineeringagents

Summary

The paper compares harness-triggered compaction (summarize at 80% of budget, keep instructions and the last 10 events) with a model-called collapse/retrieve API inside NVIDIA's NOOA harness. Budgets from 8K to 512K are hard request limits on OfficeQA Pro v2 (90 questions) and MLE-bench Lite (22 tasks), using GPT-6.1 Sol, Kimi K3, DeepSeek V4 Pro, and Claude Opus 5.5. The large accuracy jump is one cell: GPT-6.1 Sol on OfficeQA Pro v2 at 32K, 21% to 56% (abstract and Section 4). Other models use the API less or not at all, MLE-bench Lite gains are small, and timing is prompt-sensitive (Sections 5-6). A separate SGLang suffix-KV prototype on Qwen3.6-27B reports 4-15% less prefill versus prefix caching (Section 7), including under harness-driven compaction, on OfficeQA Pro rather than OfficeQA Pro v2, and not on the four models in the accuracy study.

Key findings

  • Abstract and Section 4: GPT-6.1 Sol on OfficeQA Pro v2 at a 32K budget, 21% to 56% (passed tasks over all 90 trials, including errors). Section 4 calls this nearly 3× and says gains shrink as the budget grows; DeepSeek V4 Pro improves less and Opus 5.5 rarely uses the API.
  • Section 5: GPT, Kimi, and DeepSeek call the context API in 42-53% of tasks; Opus edits context in 4% of tasks. Median request shrink per compaction is 3.7× (GPT), 2.1× (Kimi), 1.8× (DeepSeek), 1.5× (Opus). Archived content is retrieved after 19% (GPT), 7% (Kimi), 3% (DeepSeek), and 14% (Opus) of compaction calls.
  • Section 6: Kimi K3 at 32K uses 41% fewer cumulative input tokens (36M vs. 62M) with scores 43% vs. 41%. Without the 85% timing instruction, Kimi's median first compaction drops from about 84% of the budget to 29% at 128K; DeepSeek from 83% to 40% at 256K; Opus compacts at a median of 16% of the budget at 128K. At 128K and above, no-instruction variants score about 8 points below the harness baseline for Kimi and DeepSeek.
  • Section 7: at 64K, Kimi uses about 11% fewer cumulative input tokens than harness-driven while scoring 57% vs. 52%; GPT shows no comparable saving. Suffix KV reuse on Qwen3.6-27B cuts prefill by 4-15% per request vs. standard prefix caching. On OfficeQA the surviving suffix is about 10K tokens or roughly 60% of the prompt.
  • Section 3: harness-driven triggers at 80%; model-driven is told to consider compacting only at 85%, plus a usage indicator and a pressure warning. Exceeding the budget drops oldest events and, after three failures, counts as a wrong answer. Section 8 says that fallback can itself affect scores.

The paper at a glance

01History of toolcalls and modelturns grows againsta hard contextbudget (8K-512K)02Harness-driven: at80% usage,summarize olderevents; keepinitial…03Model-driven: usageindicator,consider-at-85%instruction, andpressure warning;…04Originals arearchived and can befetched by tag;three overflowfailures count as a…05Separate servingpath: SGLangprototype onQwen3.6-27B reusesKV cache of the…
  1. History of tool calls and model turns grows against a hard context budget (8K-512K)
  2. Harness-driven: at 80% usage, summarize older events; keep initial instructions and the 10 most recent events
  3. Model-driven: usage indicator, consider-at-85% instruction, and pressure warning; model may collapse a chosen event range into a summary
  4. Originals are archived and can be fetched by tag; three overflow failures count as a wrong answer
  5. Separate serving path: SGLang prototype on Qwen3.6-27B reuses KV cache of the unchanged suffix after an edit, under both strategies
Fig. 1 — How the paper works, step by step (arXiv:2611.34147).
harness-driven21%model-driven (this paper)56%
Fig. 2 — OfficeQA Pro v2 score, GPT-6.1 Sol, 32K budget, higher is better. Source: Abstract and Section 4, arXiv:2611.34147.
Data table
OfficeQA Pro v2 score, GPT-6.1 Sol, 32K budget
Method%
harness-driven21%
model-driven (this paper)56%

Why it matters

This is on-topic for harness builders, but not a drop-in result. Most agent loops still compact with a threshold summarizer, and the paper measures what changes if the model can collapse a chosen span and read archived events back. The part worth keeping is the spread: some models almost never call the API, some compact far too early unless the prompt tells them to wait, and a shorter prompt is not cheaper prefill once the edit invalidates the KV cache after the change. The accuracy and token headlines are one prompted setup in one harness, on small benchmarks, with a scoring rule that can mark overflow as a wrong answer. The serving saving was measured on a different model and also appears under harness-driven compaction.

Issues (7)

  • High severity

    The abstract leads with GPT 6.1 nearly tripling OfficeQA Pro v2 at 32K (21% to 56%). Section 4 says gains are not consistent: DeepSeek V4 Pro improves less, Opus 5.5 rarely uses the API, gains shrink as the budget grows, and on MLE-bench Lite the effect is much smaller and limited to the tightest budgets. Section 5 puts API use at 42-53% of tasks for GPT, Kimi, and DeepSeek versus 4% for Opus. Section 4 also says the gain is without extra training, while Sections 5 and 8 call the GPT explanation a conjecture and note a Codex-like context tool may be why that one model looks strong. The advertised result is the best model, budget, and benchmark cell, on the model whose training is least comparable.

  • High severity

    The comparison is not the same compaction policy with a different trigger. Section 3 gives model-driven a live usage indicator, an instruction to consider compacting only at 85%, a pressure warning, selective range collapse, and archive retrieval, while harness-driven fires at 80% and always keeps instructions plus the last 10 events, with no stated archive. Section 6 shows the timing instruction does much of the work: without it, median first compaction falls from about 84% of the budget to 29% at 128K for Kimi, from 83% to 40% at 256K for DeepSeek, and Opus compacts at a median of 16% of the budget at 128K. At 128K and above, those no-instruction runs score about 8 points below the harness baseline for Kimi and DeepSeek. 'The model itself decides when' overstates autonomy relative to the prompted setup behind the gains.

  • High severity

    The score can be an overflow forfeit, not a better answer. Section 3: each budget is a hard request limit; if a request exceeds it, a fallback removes the oldest events and retries; after three failures, the run counts as a wrong answer. Model-driven runs also get a pressure warning and can collapse before overflow. Harness-driven only summarizes at 80% and can still exceed the limit. The paper never reports how often each strategy hits that three-failure rule. Section 8 admits the fallback can itself affect scores, but the abstract still presents 21% to 56% as accuracy. At the tight budgets where the gap is largest, avoided forfeits and better answers are not separated.

  • High severity

    Abstract: engines cut prefill compute by up to 15% per request with no measurable change in accuracy. Section 7 reports 4-15% versus standard prefix caching, on Qwen3.6-27B in an SGLang prototype, not on the four models in the accuracy study. No reward deltas are printed. Figure 13 runs suffix KV reuse under both model-driven and harness-driven management, so the saving is an engine feature, not evidence that model-driven edits are uniquely cheaper. The high end is tied to OfficeQA Pro, where the surviving suffix is about 10K tokens or roughly 60% of the prompt; the accuracy study is OfficeQA Pro v2, and DeepSWE appears only here. Section 8: one open model, one engine, an approximation, prefill compute only, not latency or cost.

  • Medium severity

    Abstract: 'Kimi gains with up to 41% fewer input tokens.' Section 6 locates that figure at 32K: 36M vs. 62M cumulative input tokens, with scores 43% vs. 41%, which the paper calls slightly higher. Section 7's other Kimi saving is about 11% fewer tokens at 64K (57% vs. 52%), and GPT shows no comparable saving. Cumulative input counts cached and uncached tokens, and Section 7 notes that an edit forces recomputation after the change, so fewer tokens are not cheaper inference.

  • Medium severity

    Baseline fairness is weak on seeds, sample size, and filters. Figure 3 reports replicate means and min-max bars but the text never states the replicate count. OfficeQA Pro v2 has 90 questions and MLE-bench Lite 22 tasks; Section 8 says small differences may not be significant. Figure 4 counts missing MLE scores as zero. No sweep of the 80% threshold is reported. Figure 10 excludes runs below 95% trace coverage from the token-usage plot, and Figure 11 says Kimi K3 points combine several context budgets using equal-weight averages.

  • Low severity

    The compression factors in Section 5 are not pure context shrink. Figure 6 defines the factor as input tokens of the request in which the model decided to compact divided by input tokens of the next request, which also carries the executed cell's output. A median of 3.7× for GPT, or 2.1×, 1.8×, and 1.5× for the others, mixes the summary with that tool output.

Questions for the authors

  • How often did each strategy hit the three-failure fallback, by model and budget, and what are scores if those runs are excluded?
  • How many replicates were run per model, budget, and strategy, and were 21% vs. 56% and 43% vs. 41% tested for significance on 90 items?
  • Does harness-driven compaction also archive events for later retrieval, or is retrieval only on the model-driven API?
  • Was the 80% harness trigger tuned against the 85% instruction, or fixed before looking at scores?
  • Which model writes the harness-driven summaries, and is that the same model as the agent?
  • Do the OfficeQA gains still hold under suffix KV reuse for GPT-6.1 Sol and Kimi K3, or only for Qwen3.6-27B on OfficeQA Pro?

Related in the directory

Open-source projects

Sections 1 and 5 discuss Codex's experimental context-management mode and new_context tool, and conjecture it may explain GPT's results.
Section 9 cites MemGPT (Packer et al., 2023) as prior model-managed hierarchical memory, the line Letta ships.

People

Cited via Packer et al. 2023 (MemGPT) for giving the model control of memory instead of a harness threshold.

More tools on the same problem

Products and open-source projects in the directory closest in meaning to this paper.

Context compression for coding agents.
A self-evolving context database for agents.
A context graph of your codebase and SDLC for AI agents.
Agent-native RAG engine and context infrastructure.

Agent harnesses keep long sessions inside the context window by compacting the history when a token threshold is crossed. We study an alternative in which the model manages its own context: it decides when to compact, what to keep and what to write as the hand-off, given two tools and one paragraph of guidance. Since earlier work found that open-weight models cannot manage their own context without scaffolding, we compare seven frontier models under identical conditions, with and without the context tools, on token cost and benchmark score, and we compare our harness with three widely used harnesses on two of these models. The benchmark is assembled from existing ones: coding exercises, multi-step SciCode problems and SWE-bench Pro and Terminal-Bench 4.0 tasks are interleaved with planted facts, ephemeral observations and standing instructions, all checked deterministically, in sessions of 35-212 turns that resemble a user working through different tasks in one chat. Most of the strongest models manage their context: they compact and curate regularly, the live context of the mixed sessions stays mostly below 100k tokens, and their benchmark scores mostly do not drop significantly. For the models that manage their context well, the cost reduction is substantial but varies between models, because some models compact so often that other costs increase. With Claude Opus 5.5, the self-managed harness matches Claude Code on task success at 34% lower cost than its explicit 200k-window configuration and 49% lower than its default, with no context window to choose. We release the agent, the benchmark and all result rows.

Matthias Busch, Marius Tacke +3

LLM agents are judged by two numbers: the size of the context window, and how often the final answer is correct. Both numbers miss a third thing: how much of a tool's output is lost before the model ever sees it. We measured this loss in a real tool-using agent. The agent finds the cause of injected faults by reading Linux kernel traces. The context window was almost empty: across 720 runs, the single largest prompt used only 5.75% of it. Yet a third of all tool results (3,827 of 11,189) were cut before they reached the model, and every cut result became broken JSON. The harness cut each result by slicing its JSON text at a fixed length. This does not shorten a result evenly. It deletes whatever data sits near the end. One field reached the model in only 4.7% of calls. A second field, in the very same results, reached the model in 99.3% of calls. Which field held the fault's evidence depended on when the faulty process started: early or late in the trace. The agent's diagnosis accuracy matched this same split. So we ran controlled experiments to test one question: did the data loss cause the drop in accuracy? This paper makes four contributions. First, we model an agent's context as a five-stage pipeline, with a measured failure at each stage. Second, we replay 864 real tool results, including one from a production trace where the shipped cut deletes all 128 records of the fault's evidence. Third, a controlled experiment shows that the cut's real cost appears first as extra work, not as wrong answers: 43% more tool calls, twice the computation, and yield falling from 0.61 to 0.31. The agent still finds the right answer when it has another way to reach it. Fourth, a survey of seven agent frameworks finds two that cut tool output the same unsafe way. Whether the data cut truly causes the accuracy drop is still an open question.

Yuvraj Sehgal, Mahsa Panahandeh +1

Memory has become a central mechanism for extending large language models (LLMs) beyond fixed context windows, stateless interaction, and static parametric knowledge. This survey organizes the literature around three complementary dimensions: the life cycle of memory, the storage substrate, and the system role that memory plays in LLM-based agents, while using cognitive-science-inspired memory concepts as a lightweight conceptual motivation rather than as a separate technical contribution or implementation family. On this basis, we distinguish three mechanism families: nonparametric memory, where information is stored outside model parameters in text, graph, multimodal, or database-like structures; parametric memory, where information is stored or accessed through activations, key-value caches, learned modules, adapter-based parameterizations, or model weights; and memory for agent evolution, where stored experiences support reinforcement learning, continual learning, procedural reuse, context engineering, and agent harness design. Evaluation is treated as a separate cross-cutting component rather than as a memory mechanism. Unlike surveys that focus primarily on retrieval-augmented generation or long-context modeling, this paper emphasizes the full memory life cycle: construction, maintenance, retrieval, consolidation, forgetting, governance, and evaluation. By aligning conceptual motivations, computational memory mechanisms, benchmarks, and deployment concerns, the survey provides a structured roadmap for designing memory-augmented LLM agents that are persistent, adaptive, auditable, and safe to update over time.

Chenye Han, Hongche Yu +3

Large Language Model (LLM) agents can handle increasingly complex tasks, navigating long trajectories of observations and actions. As these trajectories grow, key-value (KV) cache I/O and storage become the dominant cost. Trajectories can also exceed the LLM's maximum context length, requiring control over active cache growth. Prior work uses context engineering to reduce cache size by trimming or summarizing history. However, modifying the trajectory prefix invalidates subsequent cached states and triggers costly re-prefilling of retained context. Task accuracy can also suffer when too little context is retained to limit re-prefill costs. We propose cache engineering as a new scheme. It allows agents to directly control their active KV cache without modifying the trajectory or re-prefilling retained context. Specifically, agents can proactively use drop to exclude selected cache from future attention and repos to adjust retained keys' position encodings. We formalize these cache operations and identify history dependence as a serving challenge: identical token sequences can yield different cache states under different cache operation sequences, making prefix matching insufficient for correct cache reuse. Thus, we co-design the AKV serving engine. It provides a stateless interface compatible with existing serving APIs, while internally managing stateful cache reuse, eviction, and restoration. Experiments show that a tool-response rolling-drop cache policy improves average benchmark scores by 1.7 points and reduces average cost by 27.7%, compared with conventional threshold-triggered summarization. With AKV, it achieves up to 1.2x the output throughput and a 1.5x speedup in P95 request latency. Recursive self-improvement of cache policies further reduces cost by 7.1% over expert design. Our code is at https://github.com/thu-nics/AKV.

Tianyu Fu, Ruoxi Wang +7

Context windows have grown a thousand-fold, yet coding agents still start every session with no memory of their past work. They re-read files, retry failed approaches, and forget root causes they established hours earlier. This is not a context-length problem but a memory-architecture problem. Our hypothesis: coding agents need persistent, experience-aware repository memory, so that knowledge survives from one session to the next. Three measurements on real repositories motivate the design. First, mid-size projects already exceed the largest production context windows, and storing knowledge inside the model's key-value (KV) cache costs $10^4$ to $10^5$ times more bytes than storing it as indexed text. Second, across 752 real bug-fix commits, the median fix edits two files, and these files plus their direct imports amount to less than 10% of the repository; the bottleneck is selection, not capacity. Third, even with transitive import reachability and test links, 47% of co-edited file pairs remain structurally disconnected; the knowledge needed for selection must be mined from history and experience. We sketch Stratum, a tiered memory that lives with the repository and serves it through page-safe tools: every response states what was returned, what remains, and what it cost. Retrieval over a store of one million nodes takes 1.7 ms at the median. In a multi-session experiment on eight real bugs, a fresh agent that inherited a prior session's memory, written by a different model, identified the root-cause file in 21 of 24 trials versus 6 of 24 for a retrieval-only baseline (Fisher $p<10^{-4}$), at 4.5x lower median token cost. With the notes of all eight investigations pooled in one store, success remained 8/8.

Yuvraj Sehgal, Mahsa Panahandeh +1

Long horizon agentic tasks are now pushing LLM agents past their context window. To continue the task, the agent scaffold has to free up the context window, a process known as context compaction. Compaction is generally lossy by design: agents can silently lose task constraints, instructions, or their reasoning behind earlier decisions. Although compaction is a standard component of coding agent scaffolds, it has not been studied systematically with frontier models on realistic, long horizon agentic tasks. Previous work evaluate smaller open weight models on toy or synthetic trajectories. We fix the agent scaffold (OpenCode), implement five compaction strategies inside it, and evaluate three frontier models on three long horizon benchmarks (PaperBench, ProgramBench, PostTrainBench). For the two 1M context models, the compaction threshold does not measurably affect the task performance, whereas GPT-5.3-Codex, the model with the smallest context window, performs worse at lower thresholds on PaperBench and, less clearly, on PostTrainBench. No compaction method outperforms default self-summarization, and methods that discard more content cost some models up to 20 points while leaving other models the same. Compaction can, however, silently remove task constraints: on ProgramBench, the first compaction summary already drops about one third of the task's anticheating rules on average, and this rises monotonically with the number of compactions. On real user-agent sessions from SWE-chat, instructions about how the agent should work and what it should not do are dropped around 6 times more than specifications of what to build. We argue that current benchmarks are compaction-friendly: i.e., the objective is fixed and the agent's progress stays on disk, so most of what compaction discards can be recovered, except constraints that don't exist anywhere else.

Jeanne Salle, Hardik Bhatnagar +3

The Harness Hub newsletter

New harness companies, projects, releases and the monthly State of Harness report, in your inbox.