2 min lesson
Self-summarization: training past the context limit
Connect "Training past the context limit" to the decision you would make.
Step 1 of 3
Self-summarization: training past the context limit
A rollout that can reach 200K tokens can outgrow the model's context window mid-task. Rather than truncate and lose the thread, the model is trained to summarize its own progress and continue from the summary, so a single episode can run longer than one context window holds. Without that, the episode dies at the context wall before the task is done, and the agent never learns behaviors that take more than one window to finish. The summary lets the rollout shed stale detail, such as old file reads and test logs, while keeping the state the next step depends on.
Learn more
Full explanation
A nonlinear length penalty
A nonlinear length penalty
Reward only on passing tests would let the agent ramble: take the long way every time because length is free. So the reward includes a nonlinear penalty on length, which keeps easy problems efficient and lets hard ones run long before the penalty bites. A flat per-token cost would either bloat the easy cases or starve the hard ones.
A purely linear penalty has a worse problem. Its optimum sits at zero tokens, so the policy learns to stop early and drop the last edit to collect a shorter completion.
Learn more
Full explanation
Best-of-16 kept improving, no collapse
Best-of-16 kept improving, no collapse
A standing fear in RL is mode collapse: the policy narrows onto one solution and loses the diversity that lets sampling find better answers. Cursor reported the opposite. Across training, best-of-16 performance kept improving, so sampling sixteen attempts and taking the best still got better and the policy did not collapse to a single strategy. Had it collapsed, all sixteen samples would look alike and best-of-16 would stop beating best-of-1. A climbing best-of-16 is direct evidence that extra samples still surface better solutions, which for a coding agent means many viable paths through a problem rather than one brittle route.
Composer 2Cursor's own coding model, built on the open Kimi K2.5 base as a software-engineering specialist. Cursor calls it frontier-level at coding and more cost-efficient than comparable models; Composer 2.5 has since replaced it in Cursor's model list. Press Enter for the full definition. is no longer the newest run: Composer 2.5The current Composer release, better at long-running tasks and at judging when a job needs a light touch versus deep work. Press Enter for the full definition. has since shipped, with gains attributed mostly to cleaner reward signals and refined data on a base that barely changed, which echoes the reward-quality point from section three, and ComposerCursor's own fast coding model, tuned for the editor and priced well below frontier models; the recommended day-to-day model for executing a plan. Press Enter for the full definition. 3 trains on a much larger cluster.
If the deep-dive asks how you'd train a long-horizon coding agent, narrate the Composer 2Cursor's own coding model, built on the open Kimi K2.5 base as a software-engineering specialist. Cursor calls it frontier-level at coding and more cost-efficient than comparable models; Composer 2.5 has since replaced it in Cursor's model list. Press Enter for the full definition. pipeline as a system: real problems in isolated repo copies, many rollouts each of up to 200K tokens and hundreds of tool calls, environments auto-built by a prior model, self-summarizationA trained behavior in which the model, on reaching a fixed token-length trigger, summarizes its own context and continues from that summary, so one task can run past the context window. Cursor trains Composer this way and rewards the summaries along with the rest of the run. Press Enter for the full definition. to get past the context limit, a nonlinear length penaltyA penalty on effort added to the reward during RL. In Composer 2's training it grows with effort, but each extra unit costs less than the last, so easy tasks finish quickly while hard tasks can run longer. Press Enter for the full definition. for efficiency, and best-of-16 watched as a non-collapse health check. Then name the environment-construction and context-limit problems, which sit outside the loss.
QA single Composer 2Cursor's own coding model, built on the open Kimi K2.5 base as a software-engineering specialist. Cursor calls it frontier-level at coding and more cost-efficient than comparable models; Composer 2.5 has since replaced it in Cursor's model list. Press Enter for the full definition. rollout can run to 200K tokens and hundreds of tool calls. Why does training the model to summarize its own progress help on these long tasks?