CursorFederico Cassano & Sasha RushExplainer
Training Composer for longer horizons
Summary
Composer is trained for long-horizon coding tasks using self-summarization, allowing reinforcement-learning trajectories to exceed the model’s context window. When a fixed token trigger is reached, Composer receives a synthetic summarization query, uses scratch space to produce a condensed context, and resumes with the summary plus conversation state; training rewards every token in the chained rollout with the final outcome. Against a tuned prompt-based compaction baseline, self-summary reduced compaction-related error by 50% on CursorBench at both 80k and 40k triggers, while summaries averaged about 1,000 tokens instead of more than 5,000 and reused the KV cache. An early Composer checkpoint solved Terminal-Bench 2.0’s make-doom-for-mips after 170 turns, summarizing more than 100,000 tokens into roughly 1,000 tokens of retained information.
Context
Agent trajectories are expanding faster than model context lengths, and existing compaction methods can cause models to forget critical information during long-running coding tasks. The work aims to preserve the information needed for challenging tasks requiring hundreds of actions.
Approach / What changed
Composer incorporates compaction into reinforcement-learning training. At a fixed context trigger, it summarizes its own context using a synthetic query and scratch space, then continues with the condensed context and conversation state. The final reward is applied to all tokens in the chained rollout, including self-summaries.
Takeaways
Self-summarization reduced compaction-related error by 50% on CursorBench at both 80k-token and 40k-token triggers.
Composer’s trained summaries averaged around 1,000 tokens, compared with more than 5,000 tokens for the tuned prompt-based baseline, while reusing the KV cache.
An early Composer research checkpoint solved Terminal-Bench 2.0’s make-doom-for-mips after 170 turns and more than 100,000 tokens of self-summarized context.
Source and freshness
- Source
- cursor.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.