When Context Fills Up, Who Cleans It?
Original: NVIDIA Technical Report, Letting Models Manage Their Own Context: Where We Stand (arXiv:2611.34147v1, November 25, 2026)
As an agent keeps working, the documents it reads and the tool-call records it makes pile up. Eventually they exceed the input limit the model can take at once. Rather than folding history on the model’s behalf, NVIDIA handed the folding decision to the model, then measured across two benchmarks and four models how accuracy, token usage, and prefill computation change.
Background first: why history overflows, and what “compaction” is
The results are hard to read without the terminology, so let’s set out three things first.
- Context window: the upper bound on the number of input tokens a model can receive and read at once. An agent accumulates tool calls, tool outputs, and model turns as history and puts them into this window.
- Context rot: as history grows longer, the model fails to find and use the information it needs, and eventually exceeds the window limit. The paper calls this phenomenon context rot (Chroma Research, 2025).
- Compaction: the process of replacing part of the history with a summary to prepare for overflow.
Who does this compaction is the starting point of this paper.
In the harness-driven approach, the harness sets the rules. When usage crosses a threshold (80% of the budget in the experiments), the harness summarizes the earlier history and leaves the initial instructions and the most recent 10 events untouched. The model only produces the summary. It is simple, but it can lose information the task really needs.
In the model-driven approach, the model decides for itself. NVIDIA’s open-source agent harness NOOA exposes a context API to the model. Through this API the model calls collapse to turn a span of events into a summary, and retrieves archived events again by their original tags. Collapsed events are not deleted but archived, so the original text can be recovered later when needed.
Here we should note the KV cache and prefill. On every turn the inference engine does not recompute the prompt from scratch; it reuses the KV cache, the computed result for the unchanged prefix. The step that computes the request’s prompt into a context state is called prefill. When you edit the context, the cache is valid only up to the edit point, and everything after it must be recomputed even if the text is unchanged. A shorter context does not automatically make inference cheaper. This fact is the starting point for the final result.
A small example: one call that collapses 12 events
Figure 1 of the paper shows this mechanism in two diagrams. In the model-driven case (bottom), the model sees the usage indicator (85%) and chooses on its own. If Before is Task, e1, e2, …, e12, the model picks e3–e9 and replaces them with a single summary block. After becomes Task, e1, e2, summary(e3–e9), e10, e11, e12, and the originals remain in the archive (by tag) box.
| Point | What stays in the context window | What changes or drops out | How to recover the original |
|---|---|---|---|
| Input | Task, e1–e12 | — | — |
| After replacing e3–e9 with a summary | Task, e1, e2, summary(e3–e9), e10, e11, e12 | The 7 original texts of e3–e9 drop out and are replaced by a single summary block | Archived originals are not deleted |
| When the original is needed again | (no change to window contents) | — | Retrieve and read the original by tagging self.events["9"] |
Listing 2 of the paper shows this interface as is.
# Replace events 3..17 with a summary; returns the summary tag "3..17"
summary_tag = self.events.collapse(
"3", "17", summary_text="Explored the repo layout; tests live in tests/unit."
)
# The originals are archived, not deleted: retrieve any event by its original tag
original = self.events["9"]# Replace events 3..17 with a summary; returns the summary tag "3..17"
summary_tag = self.events.collapse(
"3", "17", summary_text="Explored the repo layout; tests live in tests/unit."
)
# The originals are archived, not deleted: retrieve any event by its original tag
original = self.events["9"]In this example the model receives a history of 12 events as input, picks the span to collapse itself, and writes the summary. After execution, the window holds 1 task, 5 individual events (e1, e2, e10–e12), and 1 summary—7 items in all. The 7 collapsed events e3–e9 leave the window and move to the archive instead. The model later retrieves and reads that original text with self.events["9"]. The key point is that summary and archiving are separated. Reducing context and losing information become two different things, and the model can roll back when needed.
By contrast, the harness-driven approach (top of Figure 1) follows different rules. The harness summarizes the earlier history and leaves the most recent 10 events untouched. The paper does not describe a path for recovering, in this approach, the span that disappeared into the summary.
flowchart LR
H["Input: Task, e1–e12<br/>(usage 85%)"]:::state --> D{"Model selects e3–e9"}:::state
D --> C["Window: Task, e1, e2,<br/>summary(e3–e9), e10–e12"]:::act
C --> A["archive: e3–e9 originals"]:::store
A -->|"self.events['9']"| G["Re-read original"]:::act
classDef state fill:#eef2f7,stroke:#4a5568
classDef act fill:#e4f2c4,stroke:#76b900
classDef store fill:#f5f5f5,stroke:#9aa1ab,stroke-dasharray:4 2
Gray is state inside the window, green is model action, and dashed gray is the archive outside the window.
Method: how the two strategies were compared
Two tasks
- OfficeQA Pro v2 (Databricks AI Research Team, 2026): 90 questions about US federal revenue and spending. The agent searches and reads a large corpus of pre-parsed documents to find answers. The context fills quickly with each document read, making it a good setting for examining how well evidence is retained over the course of a research task.
- MLE-bench Lite (Chan et al., 2024; OpenAI): 22 Kaggle competitions. The agent must inspect the dataset, write and debug code, evaluate results, and submit. It must continuously track experiment records, implementation choices, and execution feedback across repeated work.
Settings for the two strategies
| Harness-driven | Model-driven | |
|---|---|---|
| Who collapses | Harness rules | The model decides |
| When to compact | On reaching 80% of budget | Model judgment. Instructed to consider only after 85% |
| What to collapse | Earlier history | The span the model picks |
| What to keep | Initial instructions + most recent 10 events | Events the model chooses to keep + summary |
| What the model additionally gets | A request to generate a summary | Context API, live usage indicator, 85% instruction, pressure warning near the limit |
Why sweep the budget from 8K–512K
The budget is a hard limit on request size. Lowering the budget increases context pressure—how narrow the window is relative to what the task actually needs—so it can emulate the effect of a much longer task. When a request exceeds the limit, the oldest events are dropped and the request is retried; after three failures the run is counted as incorrect (§3).
The evaluated models are four: GPT-6.1 Sol, Kimi K3, DeepSeek V4 Pro, and Claude Opus 5.5.
Result 1: model-driven leads when the window is tight
A model that uses the context API properly can achieve higher accuracy than harness-driven at the same budget without additional training. The clearest case is GPT-6.1 Sol. On OfficeQA Pro v2 at a 32K budget, its score rises from 21% under harness-driven to 56%. That is nearly 3x (§4, Figure 3).
The gains are not uniform, however. DeepSeek V4 Pro improves little, and Opus 5.5 barely uses the context API. Gains are largest when the budget is tightest and narrow as the budget grows. GPT and Kimi beat the harness baseline from small budgets, while Opus lags until the budget grows large enough for the two approaches to converge.
The figures below show scores by budget on OfficeQA Pro v2 for each model.




Original Figure 3. The horizontal axis is the context budget (8K–512K), and the vertical axis is the pass score across all 90 attempts (including errors). Points are the mean over repeated runs, and vertical bars are the min–max range over repeated runs. For GPT and Kimi, model-driven beats the harness baseline from small budgets, and the gap between the two approaches narrows as the budget grows.
On MLE-bench Lite the effect is much smaller and confined to the tightest budgets (§4, Figure 4). The paper conjectures this is because these tasks require far less context.




Original Figure 4. Only the vertical axis changes to leaderboard percentile (mean over 22 tasks, missing scores counted as 0); the axis structure is the same. Each point is the mean over validated runs at that budget. Placing the two benchmarks side by side, the paper concludes that the model-driven gain is clear when the window is narrower than the task length.
Result 2: the same API, yet very different use
The four models received the same API and the same instructions. Yet call frequency, per-call intensity, and compaction timing diverge widely (§5).
| Model | Share of tasks with any compaction call (Figure 5) | Request-size reduction per call (median, Figure 6 left) | Share of archived originals retrieved again (Figure 6 right) |
|---|---|---|---|
| GPT-6.1 Sol | 42–53% range | 3.7x | 19% |
| Kimi K3 | 42–53% range | 2.1x | 7% |
| DeepSeek V4 Pro | 42–53% range | 1.8x | 3% |
| Claude Opus 5.5 | 4% | 1.5x | 14% (estimate unstable due to rare compaction) |
In Figure 5, three models called compaction on 42–53% of tasks, while Opus did so on only 4%. The axis on the left of Figure 6 is on a log scale. The box holds the middle half of calls, the line inside is the median, the whiskers cover the 5th–95th percentile, and all confirmed compaction calls across all budgets are pooled. 2x means the context was halved, and below 1x means it actually grew. The right panel is the share of compaction calls that retrieved archived events again, and it is a lower bound.
Aggressive compaction is not free. GPT retrieves archived content again after 19% of compaction calls, Kimi 7%, and DeepSeek 3%. Taken together, GPT looks the most comfortable with this API. It knows when to call, reduces the most per call, and recovers the original text when needed.
Behavior at the limit also differs. Let’s follow what happens after the first pressure warning at a 64K budget all the way to the end (§5, Figure 7).
| Model (64K budget) | Behavior after the first warning |
|---|---|
| GPT-6.1 Sol | In 69% of episodes, read the API docs before compacting |
| Kimi K3 | 49% compacted immediately |
| DeepSeek V4 Pro | 46% inspected the event history before compacting |
| Claude Opus 5.5 | 88% accepted the warning and returned an answer, then wrapped up (without compacting) |
Figure 7 breaks down episodes where the first warning appeared into “returned an answer / compacted immediately / read docs then compacted / inspected history then compacted / other”. Opus’s 88% is consistent with the 4% in Figure 5. In other words, Opus rarely uses the compaction API; instead, when it hits the limit, it produces an answer and wraps up rather than compacting.
Result 3: one line of prompt moves compaction timing
Even models that use the API well collapse context earlier than necessary. The paper calls this tendency to keep the window short despite remaining room context anxiety. The term follows Igbinedion et al. (2026) (§6).
The paper measures compaction timing as what percentage of the budget was in use when the first compaction call occurred. With the 85% instruction, most models wait until near that point. Remove the instruction, and some models begin folding much earlier (§6, Figure 8).
| Model | Observed change in first compaction timing |
|---|---|
| Kimi K3 | At 128K, about 84% → 29% |
| DeepSeek V4 Pro | At 256K, 83% → 40% |
| Claude Opus 5.5 | At 128K, almost no compaction with the instruction; median 16% without it |
| GPT-6.1 Sol | Little change even without the instruction |
Original Figure 8. The vertical axis is budget usage (%) at the first compaction, and each point is the median of per-task first compaction decisions at that budget. A budget with no point means the model never compacted at that budget. Here “moved earlier” is not a failure but means folding earlier even though there is still room to use.
Costs also appear in the variant without the instruction. At budgets of 128K and above, the variant without the timing instruction scored about 8 points lower than the harness baseline for Kimi and DeepSeek. GPT and Opus show no comparable accuracy change. The paper cites as reasons for early compaction that many models are trained to keep context short, and that Kimi K3 was trained with a reinforcement-learning penalty on excessively long rollouts. The explanation is that a tendency to save tokens even when room remains may have emerged.
Token usage also shows gains. At a 32K budget, Kimi K3 uses the same maximum context size under both approaches, yet model-driven uses 41% fewer cumulative input tokens (36M vs 62M) and scores slightly higher (43% vs 41%) (§6, Figure 9). Figure 9 plots OfficeQA Pro v2 score against cumulative input tokens. The same budget does not mean the same usage.
Result 4: cutting tokens is not the same as making inference cheap
Context management shines when it yields “the same or better accuracy with fewer input tokens.” At a 64K budget, Kimi uses about 11% fewer cumulative input tokens than the harness baseline while scoring higher (57% vs 52%). The differences vary by model. GPT shows no comparable savings, and the other models lie in between (§7, Figures 10–11).
Yet input token count alone is not enough. As noted earlier, when you edit the context, the KV cache is valid only up to the edit point and everything after it must be recomputed. A shorter context does not automatically make inference cheaper. It depends on how much must be recomputed after the edit.
Figure 12 of the paper shows this situation as A, B, C. Before the edit, A, B, and C are all in the cache. If B is replaced with a summary, A still uses its cache as is, the summary must be computed anew, and C must be recomputed even though its text is unchanged.
flowchart TB
E["Edit: replace B in the history with a summary"]:::edit
subgraph S1["① Standard prefix caching (Figure 12)"]
direction LR
a1["A<br/>reuse KV cache"]:::reuse --- b1["Summary<br/>compute anew"]:::fresh --- c1["C<br/>recompute"]:::fresh
end
subgraph S2["② Suffix reuse (approximate)"]
direction LR
a2["A<br/>reuse KV cache"]:::reuse --- b2["Summary<br/>compute anew"]:::fresh --- c2["C<br/>reuse KV cache (approximate)"]:::approx
end
E --> S1
E --> S2
classDef edit fill:#eef2f7,stroke:#4a5568
classDef reuse fill:#e4f2c4,stroke:#76b900
classDef fresh fill:#fbe7c2,stroke:#e8a33d
classDef approx fill:#e4f2c4,stroke:#76b900,stroke-dasharray:5 3
Green cells are parts taken straight from the KV cache, and yellow cells are parts that must be recomputed. Only the dashed green cell in ② differs, as an approximation. This idea connects with recent work such as SideQuest, Context Language Models, and Cache Engineering for Agents. It is an approximation of full recomputation, an attempt to reduce serving computation while preserving the model’s useful state.
The paper evaluated this suffix-reuse prototype, attached to the SGLang inference engine on NOOA’s context API, under Qwen3.6-27B, 32K context conditions. Across MLE-bench Lite, OfficeQA Pro, and the agentic coding benchmark DeepSWE, per-request prefill computation fell 4–15% versus standard prefix caching, with no measurable change in accuracy (§7, Figure 13).
Original Figure 13. The left panel is the per-request prefill token reduction versus standard prefix caching, where taller bars are better. The right panel is the change in reward compared with no suffix reuse (with error bars). The metrics are OfficeQA Pro task score, MLE-bench Lite mean leaderboard percentile, and DeepSWE fail-to-pass rate (the share of tests that changed from failing to passing).
The per-request prefill token reductions are as follows.
| Benchmark | Model-driven (NOOA context API) | Harness-driven (summary + keep recent 10) |
|---|---|---|
| OfficeQA Pro | +15.1% ± 0.8 | +12.6% ± 0.7 |
| MLE-bench Lite | +5.6% ± 1.1 | +5.3% ± 1.2 |
| DeepSWE | +4.3% ± 0.3 | +1.0% ± 0.2 |
Point estimates of the reward change in the right panel range from −0.043 ± 0.04 to +0.081 ± 0.05. The paper summarizes this as “no measurable effect on task accuracy” (§7).
The largest savings are on OfficeQA Pro. The trailing text that survives the edit averages about 10K tokens, roughly 60% of the prompt, because the agent’s tool calls leave long documents in the context as is (§7).
One caveat. The 4–15% here is the reduction in per-request prefill computation (prefill input tokens). It is not a measured end-to-end latency or cost (§8).
Limitations and when to apply it
The paper states four limitations of its own (§8).
- Small benchmarks. OfficeQA Pro v2 has only 90 questions, and MLE-bench Lite only 22 competitions. Small differences between approaches or models may not be statistically significant.
- Simulated context pressure. Lowering the budget to emulate long tasks is only a proxy. It does not capture all the properties of genuinely long-horizon work, and the fallback that drops the oldest events on overflow can itself affect scores.
- Four models, unknown training. Only four models were evaluated, and their training is unknown. The explanation that GPT’s strong results come from training is conjecture, not a verified claim.
- KV reuse on a single open model. The prototype was evaluated on only one open model (Qwen3.6-27B) and one serving engine, and it is an approximation of full recomputation. What was measured is prefill computation, not end-to-end latency or cost.
There are also constraints a reviewer would add. First, a 42–53% adoption rate for three models means that even a model that uses the API well does not call it on many tasks. The gain is not “always” there; it is conditional on the model and the task. Second, the gain observed for a model like Opus, which barely uses the API, is limited. Third, suffix reuse is an approximation of full recomputation, so whether accuracy holds on tasks where an edit substantially changes the trailing context was not evaluated. The paper only reports no measurable effect across the three benchmarks. Fourth, using this feature requires the serving engine to be designed so that “context edits preserve reusable computation and return KV cache entries that are no longer needed” (§10).
So when is it worth using? It is most useful first in environments where context is tight relative to task length, and second with models that actually respond to the context API. Research-style agents that read many documents and fill context quickly are the typical case. Conversely, on tasks with ample context or with models that barely use the API, the gains are limited or not yet verified.
Conclusion: co-design of model and engine
The paper draws two conclusions. One is that model-driven context management can push out the accuracy–efficiency frontier; the other is that the gain depends heavily on the model. Models differ in how often they call the API, how hard they compact, and when they start compacting, and a single line of prompt moves that timing.
So the paper points in two directions. One is training that teaches the model when and what to fold; the other is an inference engine that serves context edits cheaply. This feature is in fact being adopted in production products. Codex introduced an experimental context-management mode that combines history and notes with a new_context tool that opens a fresh context window, and harnesses like Mainplane also offer context management similar to NOOA.
It is a structure in which the model edits its own context and the engine serves those edits cheaply. The paper sees this as a standard capability of frontier models and leaves co-design of model training and the inference engine as the next task.
The figures in this post are taken from the original arXiv:2611.34147 (CC BY 4.0). Only size and format were changed.
Comments