Composer 2 Technical Report

Cursor Research, Aaron Chan, Ahmed Shalaby, Alexander Wettig, Aman Sanger, Andrew Zhai, Anurag Ajay, Ashvin Nair, Charlie Snell, Chen Lu, Chen Shen, Emily Jia, Federico Cassano, Hanpeng Liu, Haoyu Chen, Henry Wildermuth, Jacob Jackson, Janet Li, Jediah Katz, Jiajun Yao, Joey Hejna, Josh Warner, Julius Vering, Kevin Frans, Lee Danilek, Less Wright, Lujing Cen, Luke Melas-Kyriazi, Michael Truell, Michiel de Jong, Naman Jain, Nate Schmidt, Nathan Wang, Niklas Muennighoff, Oleg Rybkin, Paul Loh, Phillip Kravtsov, Rishabh Yadav, Sahil Shah, Sam Kottler, Alexander M Rush, Shengtong Zhang, Shomil Jain, Sriram Sankar, Stefan Heule, Stuart H. Sul, Sualeh Asif, Victor Rong, Wanqi Zhu, William Lin, Yuchen Wu, Yuri Volkov, Yury Zemlyanskiy, Zack Holbrook, Zhiyuan ZhangarXiv 2026

TL;DR

The Cursor Research Team has introduced Composer 2, a domain-specialized Mixture-of-Experts (MoE) model explicitly optimized for agentic software engineering. By combining targeted continued pretraining with large-scale asynchronous reinforcement learning (RL), Composer 2 matches the coding performance of frontier general-purpose models like GPT-5 while operating at a fraction of the inference cost.

What Problem Does This Paper Address?

Building AI agents capable of autonomously navigating large codebases, executing multi-step reasoning, and maintaining coherence over long development sessions is incredibly difficult. General-purpose LLMs are not inherently optimized for the specific tool-use, long-context tracking, and iterative debugging workflows required by real-world software engineering.

Furthermore, the authors argue that popular public benchmarks (like SWE-bench) fail to accurately reflect actual developer challenges. These benchmarks often suffer from data contamination, narrow task scopes (mostly isolated bug-fixing), and over-specified prompts that eliminate the real-world challenge of interpreting ambiguous user intent.

Methods

Composer 2 is built using a two-phase training pipeline starting from the Kimi K2.5 base model (a Mixture-of-Experts model with 1.04T total parameters and 32B active parameters):

  1. Continued Pretraining: The base model underwent a three-phase pretraining stage on a large, code-dominated data mix. Context length was progressively scaled up to 256k tokens. Multi-Token Prediction (MTP) layers were also trained via self-distillation to enable fast speculative decoding in production.
  2. Asynchronous RL Training: The model was optimized using a highly asynchronous, single-epoch policy gradient pipeline built on Ray and PyTorch. The team modified the standard Group Relative Policy Optimization (GRPO) algorithm by removing length standardization and group advantage normalization to eliminate length biases.
  3. Stability & Behavior Tweaks: To prevent variance blow-up during long agent rollouts, the authors swapped out the commonly used $k_3$ KL-divergence estimator for the standard $k_1$ estimator. They also utilized a "self-summarization" technique to chain long trajectories without exhausting the KV cache, and applied a concave-down nonlinear length penalty to encourage the model to solve easy tasks quickly while allowing deep thinking on complex problems.
Figure 4: Comparison of estimators of KL(p ∥q) for two synthetic Gaus- sian distributions with unit variance and different means.

Datasets

  • Training Data: A massive code-dominated dataset was used for pretraining. For the RL phase, the team generated a highly diverse problem distribution mirroring actual developer workflows.
  • CursorBench: The authors introduced CursorBench, a new internal evaluation suite built from real engineering sessions. Unlike public benchmarks, CursorBench tasks feature highly ambiguous, underspecified prompts (median length of 390 characters) and require extensive code modifications (median of 181 lines changed).
  • Public Benchmarks: The model was also evaluated on SWE-bench Multilingual and Terminal-Bench to demonstrate competitive generalizability.
Figure 3: RL training tasks.

Key Insights and Ideas

  • Pretraining Loss Predicts RL Success: The authors demonstrated a log-linear relationship between a model's cross-entropy loss on an internal codebase during pretraining and its subsequent reward performance after RL. Foundational domain knowledge directly bounds downstream RL capabilities.
  • Standard KL Estimators Fail at Scale: Many open-source RL implementations rely on the $k_3$ KL estimator because it reduces variance when policies are close. However, as the training policy diverges from the reference policy during long-horizon tasks, $k_3$ suffers from catastrophic variance blow-up. Switching to the standard $k_1 = -\log r$ estimator restored training stability.
  • No Best-of-K Tradeoff: Contrary to recent literature suggesting that RL narrows a model's output diversity (improving average performance but flattening best-of-K metrics), the authors found that their RL recipe simultaneously improved both average and best-of-16 performance, expanding the model's effective coverage of correct solutions.
Figure 2: Continued pretraining translates to downstream RL performance. Left: We study this relationship on a smaller Qwen model, examining checkpoints trained on a varying number of tokens. Right: The model undergoes a steady decrease in training perplexity.

Key Results

  • CursorBench: Composer 2 achieved an accuracy score of 61.3%, marking a massive relative improvement over Composer 1.5 (44.2%) and performing competitively with the much larger GPT-5.4 High (63.9%).
  • Public Benchmarks: The model scored 73.7% on SWE-bench Multilingual and 61.7% on Terminal-Bench, matching or exceeding state-of-the-art general-purpose systems.
  • Cost Efficiency: By specializing entirely on coding intelligence, Composer 2 achieves a superior Pareto frontier, delivering frontier-level software engineering capabilities at a significantly lower inference cost than general-purpose API alternatives.
Figure 1: Composer 2 improves greatly from previous Composer models, achieving performance competitive with state-of-the-art models. By specializing entirely on coding ability, Composer attains such performance while being lower cost to serve than state-of- the-art model API pricing. See Section 5 for detailed evaluations.

Limitations and Future Work

Although highly optimized, Composer 2's active parameter size (32B) means it is likely smaller than the largest proprietary frontier models, leaving clear room for further architectural scaling. Additionally, the scope of coding agents is rapidly expanding from short interactive sessions to complex tasks requiring hours of human labor. The team's future work will focus on developing training algorithms and infrastructure capable of effectively utilizing longer-term training signals to support these ultra-long-horizon tasks.

Summary updated

BibTeX
@misc{research2026composer,
  author = {Cursor Research and Aaron Chan and Ahmed Shalaby and Alexander Wettig and Aman Sanger and Andrew Zhai and Anurag Ajay and Ashvin Nair and Charlie Snell and Chen Lu and Chen Shen and Emily Jia and Federico Cassano and Hanpeng Liu and Haoyu Chen and Henry Wildermuth and Jacob Jackson and Janet Li and Jediah Katz and Jiajun Yao and Joey Hejna and Josh Warner and Julius Vering and Kevin Frans and Lee Danilek and Less Wright and Lujing Cen and Luke Melas-Kyriazi and Michael Truell and Michiel de Jong and Naman Jain and Nate Schmidt and Nathan Wang and Niklas Muennighoff and Oleg Rybkin and Paul Loh and Phillip Kravtsov and Rishabh Yadav and Sahil Shah and Sam Kottler and Alexander M Rush and Shengtong Zhang and Shomil Jain and Sriram Sankar and Stefan Heule and Stuart H. Sul and Sualeh Asif and Victor Rong and Wanqi Zhu and William Lin and Yuchen Wu and Yuri Volkov and Yury Zemlyanskiy and Zack Holbrook and Zhiyuan Zhang},
  title = {{Composer 2 Technical Report}},
  year = {2026},
  eprint = {2603.24477},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.24477},
}
Figure