我们在 arXiv 上发布了一篇关于 Composer 2 训练的技术报告,这是我们面向智能体软件工程的编程模型。该报告涵盖了完整的训练流程,从基于开源基座模型 Kimi K2.5 的持续预训练,到大规模强化学习,重点在于紧密模拟真实的 Cursor 环境。
持续预训练与强化学习
Composer 2 分两个阶段进行训练:首先在侧重代码的数据混合集上进行持续预训练,以加深基座模型的编程知识;随后进行大规模强化学习,以提升端到端的智能体性能。我们发现,降低预训练损失能够提升下游强化学习性能,更扎实的基座知识可靠地转化为更优秀的智能体。
Composer 2 的强化学习训练在真实的 Cursor 会话中进行,使用与已部署模型相同的工具和测试框架,并应用于能够反映开发者要求 Composer 执行的全部任务范围的问题分布。我们发现,强化学习训练既提升了平均性能,也提升了最佳 K 次采样性能,这表明模型正在学习新的解题路径,而不仅仅是集中于已知路径。
基于 CursorBench 的真实世界评估
构建编程模型的一个核心挑战在于,公开基准测试往往无法反映开发者实际所做的工作。任务被过度限定,解决方案过于狭窄,且代码库规模很小。
我们基于自身工程团队的真实编程会话构建了 CursorBench。它包含提示词简洁且模糊的任务,其解决方案需要在多个文件中进行数百行代码的修改。我们在整个训练和评估过程中都使用 CursorBench,以使模型始终与真实问题保持一致。
性能表现
在 CursorBench 上,Composer 2 得分为 61.3,相比 Composer 1.5 提升了 37%,与最顶尖的前沿模型不相上下。在公开基准测试中,Composer 2 在 SWE-bench Multilingual 上得分为 73.7,在 Terminal-Bench 上得分为 61.7。它在实现这些成绩的同时,推理成本显著低于同类模型,从而在交互式开发者工作流中实现了准确性与成本之间的帕累托最优权衡。
基础设施
训练 Composer 2 需要大规模的基础设施建设,包括用于在 Blackwell GPU 上高效训练 MoE 的自定义低精度内核、一个跨多个区域的完全异步强化学习流水线,以及 Anyrun(我们用于运行数十万个沙盒化编码环境的内部计算平台)。该报告涵盖了完整的技术栈,包括我们在权重同步、容错和环境保真度方面的方案。
该报告提供了关于所有这些内容的更多细节,包括对训练方案的消融实验、我们的智能体行为塑造方法,以及评估套件的设计。
感谢 Kimi K2.5、Ray、ThunderKittens、PyTorch 团队以及更广泛的开源社区。我们还要感谢 Fireworks 和 Colfax 的合作与支持。
在此处阅读完整技术报告。
通过实时强化学习改进 Composer
Jacob、Ben、Nathan 和 Wanqi
推出 Composer 2
通过自动安装引导 Composer
Shomil、Joshua 和 Andrew
We posted to the arXiv a technical report on the training of Composer 2, our coding model for agentic software engineering. The report covers the full training process, from continued pretraining on an open base model, Kimi K2.5, through large-scale reinforcement learning, with a focus on closely emulating the real Cursor environment.
Continued pretraining and RL
Composer 2 is trained in two phases: continued pretraining on a data mix that emphasizes code to deepen the base model's coding knowledge, followed by large-scale reinforcement learning to improve end-to-end agent performance. We find that reducing pretraining loss improves downstream RL performance, with better base knowledge reliably translating into a better agent.
Composer 2 RL training occurs in realistic Cursor sessions with the same tools and harness the deployed model uses, applied to a problem distribution that reflects the full range of what developers ask Composer to do. We find that RL training improves both average and best-of-K performance, suggesting the model is learning new solution paths rather than just concentrating on known ones.
Real-world evaluation with CursorBench
A core challenge in building coding models is that public benchmarks often don't reflect the work developers actually do. Tasks are over-specified, solutions are narrow, and the codebases are small.
We built CursorBench from real coding sessions by our engineering team. It includes tasks where the prompt is terse and ambiguous, and solutions require hundreds of lines of changes across many files. We use CursorBench throughout training and evaluation to keep the model aligned with real problems.
Performance
On CursorBench, Composer 2 scores 61.3, a 37% improvement over Composer 1.5 and competitive with the strongest frontier models. On public benchmarks, Composer 2 scores 73.7 on SWE-bench Multilingual and 61.7 on Terminal-Bench. It achieves this at significantly lower inference cost than comparable models, giving it a Pareto-optimal tradeoff between accuracy and cost for interactive developer workflows.
Infrastructure
Training Composer 2 required substantial infrastructure development with custom low-precision kernels for efficient MoE training on Blackwell GPUs, a fully asynchronous RL pipeline spanning multiple regions, and Anyrun, our internal compute platform for running hundreds of thousands of sandboxed coding environments. The report covers the full stack, including our approach to weight synchronization, fault tolerance, and environment fidelity.
The report has much more detail on all of this, including ablations on the training recipe, our approach to agent behavior shaping, and the design of our evaluation suite.
Thank you to the teams behind Kimi K2.5, Ray, ThunderKittens, PyTorch, and the broader open-source community. We'd also like to thank Fireworks and Colfax for their collaboration and partnership.
Read the full technical report here.
Improving Composer through real-time RL
Jacob, Ben, Nathan & Wanqi
Introducing Composer 2
Bootstrapping Composer with autoinstall
Shomil, Joshua & Andrew