NVIDIA researchers have evaluated a method in which an AI agent condenses its working state into a short note at every step and carries it into the next one. Median peak context length per task stayed within 7,000 to 9,000 tokens. On two benchmarks, accuracy improved for Claude Opus 4.5 but dropped for GPT-5.6 Sol.
In a preprint published on November 3, 2026 (UTC), Peter Belcak and colleagues also evaluate a method that stores long documents in external files and loads only the relevant passages. Shortening the context substantially improved GPU inference efficiency, but the team also found cases where costs actually rose at the same per-token API prices.
Per-step history compression sharply shortens the context
The researchers compared three ways for an AI agent to manage its work history. The baseline, full-history accumulation (FHA), is the common approach: it keeps appending the AI's actions and their results to the conversation history. End-of-context compression (EoCC) summarizes the necessary information once the history reaches a set length, then continues the work in a new conversation. Step-wise agent compression (SAC) performs this handoff after every single step.
What SAC carries forward is a short note covering the original request, progress so far, the next action, needed files and references, and completion criteria. Each time the agent receives a result, it updates this note and resumes work in a fresh conversation. Because the agent no longer has to retain every past exchange, context bloat as work drags on is kept in check.
Table 2 of the paper aggregates the maximum context length used in each task as "peak context length." With SAC, the median stayed between 7,000 and 9,000 tokens, and the maximum between 15,000 and 37,000 tokens.
| Model / Benchmark | Accuracy (FHA→SAC) | Median peak context length (FHA→SAC) | Max peak context length (FHA→SAC) |
|---|---|---|---|
| Claude Opus 4.5 · SWE-bench Verified | 70.0%→70.2% | 32K→8K | 200K→16K |
| Claude Opus 4.5 · Terminal-Bench 2.1 | 47.2%→51.8% | 27K→9K | 130K→19K |
| GPT-5.6 Sol · SWE-bench Verified | 84.4%→82.4% | 18K→7K | 173K→15K |
| GPT-5.6 Sol · Terminal-Bench 2.1 | 87.6%→84.3% | 17K→8K | 133K→37K |
Note: K stands for 1,000 tokens. Figures follow Table 2 of the paper and are rounded to the nearest 1,000 tokens.
Claude Opus 4.5 improved on both benchmarks, while GPT-5.6 Sol fell by 2.0 points on SWE-bench Verified and 3.3 points on Terminal-Bench 2.1. On SWE-bench Verified, the best accuracy under EoCC was 74.8% for Opus and 88.8% for Sol, both higher than with SAC. Performance also varies with how often compression is applied. EoCC was evaluated on six long-horizon benchmarks, whereas SAC was evaluated only on the two shown above.
Storing long documents externally and loading only what is needed
The team also evaluated seven benchmarks that involve long inputs. Instead of placing the full document in the context from the start, this approach saves it to an external file. The AI searches for relevant passages and reads the text around them. If the work history reaches a set length, EoCC compresses it.
BABILong embeds short facts needed for reasoning in book text. The team evaluated 550 questions in total on inputs of 64,000 to 1 million tokens, with the context limit set at 16,000 tokens and the compression threshold at 12,000 tokens. Claude Opus 4.5's accuracy rose from 67.1% to 92.0%, and GPT-5.6 Sol's from 70.7% to 94.0%. The history was actually compressed 0 times across all tasks for Sol and at most once for Opus.
On LOONG, which covers financial reports, court rulings, and similar documents, both models also improved in average score and exact-match rate under a 48,000-token limit and a 40,000-token compression threshold. The median number of compressions was 0. Because the full text is kept as an external file, the model can consult the passages it needs on demand. However, this experiment changed both the amount of information initially provided and the subsequent search-and-read procedure, and the team did not separately assess how much each contributed to the gains.
Better GPU efficiency doesn't guarantee lower API bills
In experiments on NVIDIA H100 GPUs, cutting the context length limit from 256,000 tokens to 16,000 raised output tokens per second by 3.6x for GLM 5.2, 5.6x for Kimi K2.6, and 7x for Qwen 3 Coder Next. The experiments used 8 H100s for Qwen and 16 each for the other two models, with the GPU configuration held constant within each model.
In Figure 4 of the paper, the longest shared input was processed in advance to prepare a cache, and each request then generated 1,024 tokens. Varying the level of concurrency, the team measured the maximum throughput sustainable without cache eviction. The performance gain here therefore applies to output generation after input processing has finished.
Shorter context does not translate directly into lower API charges, however. In Table 11, the paper compares two approaches on LongBench v2 with GPT-5.6 Sol: giving the full text at once, and loading only the needed passages with a 16,000-token context limit and a 12,000-token compression threshold. The latter raised accuracy from 70.8% to 72.6%, but total new-input, cached-input, and output tokens all increased. As a result, the cost at identical API prices rose by about 14%.
If the full-text approach costs 100, the selective-loading approach costs about 114. Based on its GPU measurements, the team also devised a pricing model in which the per-token price at a 16,000-token context is 20% of the standard price. Under that pricing, the cost index falls to about 22.8. This is an estimate that assumes inference providers would set lower prices for shorter contexts.
On the same LongBench v2, Claude Opus 4.5 saw costs fall by about 32.6% at identical API prices, though accuracy slipped from 68.0% to 67.6%. API charges depend not only on maximum context length but also on how often the model rereads information and on total input and output tokens.
Cached input still adds up when referenced repeatedly
A Harvard University research group analyzed real-world usage data from human-operated coding agents through the inference service FreeInference and published a summary of its work on November 4. The data covers about 12,000 sessions and roughly 1.2 million requests over 3.7 months. The median input per request was about 129,100 tokens, but the median number of input tokens that could not be reused from the cache was 491. Note that the NVIDIA figures are aggregates of peak context length per task, not per-request numbers.
In requests where cache usage was recorded, 97.4% of input tokens were cached, and charges for them accounted for 72.9% of the estimated total API cost. The estimate set the price of cached input at one-tenth that of new input and one-fiftieth that of output. Even at a low unit price, cached input can make up a large share of total cost when the number of tokens referenced repeatedly is enormous.
Rewriting or deleting history, meanwhile, can narrow the range over which prefix caching, which reuses the shared beginning of an input, remains effective. In the real-world data, existing history was rewritten or deleted between steps in 4% of cases, but 56.4% of sessions had at least one such change.
Shortening history also reduces the input that later requests must repeatedly reference. In a simulation with a 15-minute cache retention time, not shortening the history increased newly processed input tokens by about 5%. Both the reprocessing triggered by compression and the input saved on later requests need to be taken into account.
Next challenge: choosing what to keep and how to retrieve it again
History compression inevitably loses information. To prepare for cases where past information must be referenced exactly, the NVIDIA team proposes an execution environment that stores every message externally and retrieves it as needed. The agent normally continues its work using the compressed state note and consults the original record only when detailed information is required.
The team also puts forward, as a concept, a "Semantic State Space Model (SSSM)," in which a model acquires through additional training the ability to update its working state in natural language and carry it into the next inference. This study used existing models and changed how information is handed over on the execution-environment side. The performance of additionally trained models, and the effect of per-step history compression in real-world operation on accuracy, processing time, and API charges, remain subjects for future validation.
For delegating long-running work to AI agents, it matters that past conditions and decisions can be retrieved accurately when needed. Evaluation should consider not just how short the context is but also the burden of re-retrieving information, measured by the time and total cost needed to complete a single task.
