IN THIS BREAKDOWN · 10 SECTIONS
You can read 20% of this breakdown.
The paper in one minute
A standard language model appends: each turn's output is added to the context, so the next context is the old one plus the new tokens. Agents on long tasks hit the window limit, and the fix so far has been a harness. Codex-style compaction summarizes the history at a fixed threshold; tools such as Self-Compact, ACM and Context Folding give the model a few predefined actions. In each case a human picked the strategy.
Rulin Shao, Pang Wei Koh and colleagues at the University of Washington, Meta Superintelligence Labs, MIT and Trillium Labs propose Context Language Models (CLMs), models that manage their own context. Formally, the next context is any function of the current one the model chooses, rather than the current one plus new tokens. The implementation is simple: the live context is mirrored to a file whose path is in the system prompt, the model edits that file with ordinary Bash, and each edit is synced to the server before the next turn. If the model does not edit, generated tokens are appended as usual. Multiple agents get multiple context files.
The paper reports emergent behaviors: an orchestrator keeping a scoreboard of subagents through 163 in-place edits at 6 to 8K tokens, a new "notes" chat role the model invented, and a compact_turns helper function it defined and called 37 times.
It then adds four pieces: ContextBench, four synthetic tasks that test context management alone (separate from the coding-retrieval benchmark with the same name); prefix-reuse FLOPs, a cost metric that charges for re-prefilling after an edit; in-context steering and skill evolution, plus an RL recipe with a success-gated efficiency advantage; and Suffix Cache Reuse (SCR), an SGLang patch that keeps cached states after an edit. Across coding, deep research, math optimization and day-long repository work, CLMs beat or matched the harnesses at lower compute in most settings.
Research notes: the problem, approach and results
BrowseComp-Plus accuracy, Qwen3.6-27B with a 32K limit, against about 53.3% for summarization (derived from the 11.4% relative gain)
held-out KV Store accuracy on ContextBench after evolving a context-management skill, the paper's 35.9-point claim
PFLOPs per BrowseComp-Plus question with Suffix Cache Reuse instead of standard SGLang, both at 60.2% accuracy
Agents on long tasks outgrow their context window. Harnesses compact on a fixed schedule with a fixed summary prompt, or give the model a few predefined tools (compact, offload, retrieve, branch). Either way, a human chose the strategy, and simple tasks expose its blind spots.
Mirror the live context to a file the model can rewrite with ordinary Bash or Python; edits sync to the server before the next turn. The model decides what to keep, compress, move to disk or restructure. Steer it with instructions or evolved skills, train it with RL that rewards cheaper successful trajectories, and serve it with a cache that survives mid-context edits.
With Qwen3.6-27B and a 32K limit, CLM scored 59.4% on BrowseComp-Plus, 11.4% higher in relative terms than Codex-style summarization, using 21.5% fewer prefix-reuse FLOPs. It also led on TBLite, EdgeBench-10 and four math optimization problems. RL took Qwen3.5-9B from 28.8% to 42.5%. Suffix Cache Reuse cut compute 35% at equal accuracy.
Why it matters to an FDE
Every long-running agent you deploy has a context strategy, usually inherited from a framework default: summarize at 75% full, truncate old tool output, or nothing. This paper argues the model can do better if you let it, and gives evidence on public benchmarks.
Smaller harness, more model. CLM keeps the harness minimal: one file, Bash, a reminder near the limit. The strategy lives in the model and in instructions, which you can change per customer with one sentence. The paper shows one-sentence instructions changing when and how the agent compacts.
Edits have a serving cost. Prefix caching only reuses an unchanged prefix. Rewriting something early in the context forces everything after it to be prefilled again. A context strategy is also a cache strategy, and the paper's metric makes that cost visible.
Editable context is an attack surface. If the model can write its own context, injected text can persist by being copied into notes, and the paper cites a report of a model inserting unauthorized instructions into its own compaction summary. Log context edits like any other privileged write.
It needs a capable model. The 9B model edited less, filled its context more and needed RL to catch up. On small models, a fixed harness may still win.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 99 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦1 results table
- ?5 interview questions with answers
- 03Key takeaways
Mechanism, the four contributions, headline results in absolute numbers, and misreadings to avoid
Free account - 04How it works
Context as a file, the cost metric, steering and evolution, RL with an efficiency advantage, and SCR
Premium - 05The numbers that matter
Relative and absolute results, the RL comparison, the swarm result and the serving savings
Premium - 06Try it yourself
Recompute the paper's FLOPs constants, then cost four context policies over a 60-turn trajectory
Premium - 07Where it breaks
Setup asymmetries, relative claims, inconsistencies, model dependence and safety
Premium - 08Using it on a deployment
Adopting model-managed context for a customer's long-running agent
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
