For AI models, context is everything. Too long context implies they lose the ability to reason. Missing from context implies they don’t know or hallucinate. Currently, external model harnesses manage (build, prune, summarize) contexts. Using rigid heuristics like fixed summarization intervals or restricted compaction routines.
A new paper, Context Language Models (CLMs), from MIT recommends letting the model manage its own context. Treats the active context as an editable file in storage. The model is given direct system-level write access (via general Bash commands) to mutate, rewrite, or compact its own context file. These edits synchronize directly to the live context for subsequent model steps.
Impact: Before-After
Evaluation on diagnostic suites (like ContextBench) shows that traditional fixed strategies fail even on simple tasks (e.g., losing critical details during blanket summarization or being unable to perform in-place board state updates). Native context mutation resolves these diagnostic failure modes.
On deep-research tasks like BrowseComp-Plus, zero-shot CLMs achieved 11.4% higher accuracy with 21.5% fewer FLOPs compared to state-of-the-art baselines.
Surprises
When given unrestricted control to edit their context, models spontaneously develop complex, creative context-management behaviors:
- Custom Roles: Creating new interna chat roles (e.g., role=notes) to store internal tracking state distinct from normal assistant outputs.
- In-Context Trackers: Maintaining live progress ledgers and scoreboards that are updated via in-place edits (e.g., managing subagent swarms in 6–8K tokens across hundreds of steps).
- Programmatic Compaction: Writing reusable Python/Bash helper functions and loops to trim unhelpful search outputs or compress old observation histories.
Context management can be optimized both at inference time (by evolving textual skill prompts across task traces) and in weights (improving performance on long-horizon tasks via RL while simultaneously lowering compute usage).
Optimizing Cache Reuse
Suffix Cache Reuse (SCR)
In-the-middle context modifications typically invalidate standard Key-Value (KV) prefix caches in serving engines like SGLang or vLLM, triggering expensive re-prefilling overhead.
SCR solves this bottleneck on the serving infrastructure side by reusing and re-indexing the cached KV attention states of surviving token sequences beyond the modified region.
Further, they optimize for Prefix reuse and prevent models from making gratuitous edits that destroy information or inflate compute. The paper trains models using stepwise GRPO with a specialized advantage function.
The reward signal re-ranks only successful task completions based on their total prefix-reuse FLOPs, teaching the model to edit surgically and maximize compute efficiency.
In Context Steering Prompts
These work quite well too, without changing the underlying model.
Context management is ripe for moving from external harnesses to model weights. Erroneous context formation can lead to loss of provenance and users might get surprised — this information was provided to the model but is not being used. This can cause surprises and difficulty in debugging. Therefore, any self context management technique must explain its actions well.




The 11.4% accuracy gain with 21.5% fewer FLOPs on BrowseComp-Plus is striking, but I wonder how much of the FLOP saving depends on Suffix Cache Reuse. Editing in the middle of a context normally invalidates the KV prefix cache, so without SCR the shorter contexts could be paid back in re-prefill. Did the paper report the model-driven edits on a standard prefix-cached server, so the gain from the edits alone is visible?