---
title: "Training Composer for longer horizons"
description: "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."
---

# Training Composer for longer horizons

[Cursor](https://yomu.fyi/company/cursor) · Federico Cassano & Sasha Rush · Mar 17, 2026

**Type:** Explainer

## 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.

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [Performance](https://yomu.fyi/topic/performance), [Reinforcement Learning](https://yomu.fyi/topic/reinforcement-learning)

- Source: [Cursor](https://cursor.com/blog/self-summarization)
- Source URL: https://cursor.com/blog/self-summarization
- Ingested by Yomu: 2026-09-02T11:43:47.650Z

[Read original post](https://cursor.com/blog/self-summarization)
