Skip to content

Composer 2 Technical Report

Composer 2 is Cursor’s coding agent model: continued pretraining on Kimi K2.5 (1.04T-total / 32B-active MoE) followed by large-scale asynchronous RL inside the actual Cursor harness with the actual tools. The headline numbers are 61.3 CursorBench (vs ~36 for the base K2.5), 61.7 Terminal-Bench, 73.7 SWE-bench Multilingual in Cursor’s harness. The report is unusually candid about training-recipe details: a Dr. GRPO-style policy gradient (no length standardization, no group-σ normalization, no overlong masking), the choice of the higher-variance KL estimator over k3, NVFP4 forward / MXFP8 backward asymmetric precision motivated by RL train-inference matching, and a 3-region / 4-region (compute / CPU) fully-asynchronous Ray + PyTorch stack with mid-rollout weight updates and MoE-routing replay to bound off-policy divergence.

  • Composer 2 reaches 61.3 on CursorBench (Cursor’s internal real-session benchmark), a “major improvement” over previous Composer models; on public benchmarks it scores 61.7 on Terminal-Bench and 73.7 on SWE-bench Multilingual in Cursor’s harness, “comparable to state-of-the-art systems” [§1].
  • Base model is Kimi K2.5 (1.04T parameter / 32B active MoE), selected from candidates via internal evals on codebase perplexity, coding knowledge, and state tracking [§3].
  • Continued pretraining is three-phase: bulk compute at 32K sequence length, then long-context extension to 256K, then a short SFT phase on targeted coding tasks; trained in MXFP8 on NVIDIA B300s with AdamW [§3.1].
  • Codebase-perplexity loss decreases log-linearly through continued pretraining, and the final cross-entropy loss is predictive of downstream RL reward — verified by applying the recipe to Qwen3-Coder-30B-A3B at three logarithmically spaced compute levels, each followed by identical SFT + RL [§3.1, Fig. 2].
  • Multi-Token Prediction layers for speculative decoding are initialized from scratch and trained via self-distillation against the main LM head’s logit distribution, atop a mid-run continued-pretraining checkpoint, then jointly trained through the long-context and SFT phases [§3.1 Multi-Token Prediction].
  • Policy gradient follows Dr. GRPO: length-standardization term is removed (introduces length bias) and group advantages are not normalized by their standard deviation (degenerates when all rollouts in a group score equally) [§4.1].
  • Overlong-rollout masking is rejected — the authors saw no benefit at small scale, and report that the self-summarization mechanism limits overlong-rollout occurrences in practice [§4.1].
  • KL regularization uses the standard (higher-variance, unbiased) estimator rather than the popular k3 estimator from Schulman, because k3’s variance “blows up” once the policy diverges from the reference (cited Amini et al. 2025, Fig. 1) [§4.1, Fig. 4].
  • Composer 2 RL training improves both average reward and best-of-K, against a growing literature claiming RL on LLMs typically concentrates probability mass on known-correct trajectories at the cost of best-of-K — i.e. in Cursor’s setting RL appears to expand effective coverage of correct solutions, not just reweight a fixed pool [§4.1, Fig. 5].
  • Self-summarization (introduced in Composer 1.5) lets the model chain multiple generations with intermediate summaries inside a single training rollout, with the final reward propagated to all tokens including the summarizations themselves; “consistently reduces the error compared to using separate prompt-based compaction, while using significantly fewer tokens and reusing the KV cache” [§4.1 Self-Summarization].
  • A concave-down nonlinear length penalty over a weighted mix of (thinking tokens, tool-call tokens, tool-output tokens, final-message tokens, number of tool calls, number of turns) incentivizes the model to be quick on easy tasks and patient on hard ones; the nonlinearity is what makes “every additional bit of effort felt more acutely” on short tasks [§4.2, Fig. 6].
  • Auxiliary “agent behavior” rewards target coding style, communication, and product-specific failures (unfinished to-do items, comment-as-CoT smuggling, terminal-only tool collapse); new rewards are introduced reactively as emergent failure modes appear during RL [§4.2].
  • CursorBench is constructed from real agent sessions inside Cursor’s own engineering team (not public scrapes) and is structurally different from public SWE benchmarks: median 181 lines changed (vs 7–10 for SWE-bench Verified/Multilingual) and median 390-character prompt (vs 1,185–3,055 chars) — broader execution scope under higher intent ambiguity [§5, Fig. 7].
  • Public benchmarks are critiqued on four axes: domain mismatch (SWE-bench is bug-fixing; Terminal-Bench tasks are often puzzles), prompt over-specification (real requests are underspecified), data contamination (OpenAI suspended SWE-bench Verified reporting after frontier models could regenerate gold patches from memory), and narrow evaluation scope (correctness only, no quality/latency/cost/interactive behavior) [§5].
  • Companion evaluations cover intent handling on ambiguous prompts, instruction-following on system/user prompts and rules, eager-editing (questions where the model should not edit code), code quality (both code and comments), and mid-rollout interruption handling [§5].
  • Parallelism stack departs from prior Composer training: Context Parallelism (CP) replaces TP as the primary long-context axis (less communication, no skinny matmuls), and EP is decoupled from TP, formed from DP+CP capacity; EP=8/CP=2 in continued pretraining, EP=8/CP=8 in RL [§6.1 Parallelism].
  • MLA-specific CP optimization: compute local KV latents, all-gather latents across CP ranks, then compute KV projections — this replicates the small projection on all ranks but lets the CP comm overlap with the Q projection compute [§6.1].
  • Forward pass uses a novel NVFP4 variant with FP8E4M3 per-block scales (block=16) plus FP32 per-token scales, replacing standard NVFP4’s per-tensor scales — per-tensor scales caused batch-variance that collapsed numerical precision and diverged RL training, and inter-token scales leaked future-token info into past tokens (biased gradients) [§6.1 Kernels].
  • Backward pass uses standard MXFP8 (FP8E4M3 values, FP8E8M0 per-32-block scales) — the asymmetry is justified by RL: forward must match inference for stability, backward only runs on the training cluster so higher precision is affordable [§6.1].
  • Hardware-level math precision matters: NVFP4 quantization requires IEEE-compliant __fdiv_rn (fast-approx __fdividef diverges after ~100 RL steps); MXFP8 quantization tolerates __fdividef since Composer 1 [§6.1].
  • Composer 2 collaborated with Colfax on the FlashAttention-4 backward kernel for QK=192/V=128 (“DeepSeek shapes”), merged into the public FA repo [§6.1].
  • RL infrastructure is four decoupled services (training, environments, inference, evaluations) spanning 3 GPU-compute regions and 4 CPU-compute regions; built on Ray + PyTorch with a centralized slot-based reconciler and futures-style eager execution [§6.2 Training].
  • Off-policy divergence is bounded by fast weight synchronization + in-flight weight updates (inference workers can update weights mid-rollout, so later tokens are less off-policy) + MoE routing replay between sampling and training policies [§4.1].
  • Fault tolerance is built down to process / process-group level; passive + active health checks plus warm standby nodes mean partial outages of inference / environment services don’t fail the training job, and live per-process code updates avoid restarts [§6.2].
  • Pre-step global sequence packing balances per-DP-rank compute (with attention-cost-aware weighting) — RL rollouts have highly variable lengths that would otherwise crater utilization [§6.1].

Composer 2 is built by continued pretraining + large-scale asynchronous RL on top of Kimi K2.5 (1.04T-total / 32B-active MoE). Continued pretraining is three-phase (32K bulk → 256K long-context → short SFT), trained in MXFP8 on B300s with AdamW; MTP layers for speculative decoding are added from scratch via self-distillation against the main LM head’s logit distribution and then co-trained through the final two phases [§3.1].

The RL phase samples groups of rollouts per prompt, computes group-relative advantages, and updates the full parameter set with Adam. The objective is Dr. GRPO with length-standardization removed and group advantages not divided by group-σ; the standard (rather than k3) KL estimator is used to avoid variance blow-up at high divergence [§4.1]. Self-summarization chains multiple generations inside a single rollout, propagating the final reward to all tokens including the summaries, so the model learns to compress its own context [§4.1 Self-Summarization]. A concave-down nonlinear length penalty over a weighted mix of thinking/tool/turn tokens, plus auxiliary behavior rewards introduced reactively against emergent failure modes (terminal-only collapse, comment-as-CoT, abandoned to-do items), shape the agent’s communication style and resource use [§4.2].

The training stack is a fully asynchronous Ray + PyTorch system across 3 GPU regions and 4 CPU regions with a centralized reconciler scheduling samples through distributed executors via futures. Off-policy divergence is bounded by (a) fast weight sync + in-flight weight updates mid-rollout, (b) MoE routing replay between sampling and training, and (c) global sequence packing before each step to balance per-DP-rank compute under variable rollout lengths [§6.1, §6.2].

The numerical recipe is asymmetric: MoE forward uses a custom NVFP4 with per-block FP8E4M3 + per-token FP32 scales (per-tensor NVFP4 made RL diverge; inter-token scales leaked future-token info); MoE backward uses standard MXFP8. Context Parallelism replaces TP as the primary long-context axis, with EP decoupled from TP (formed from DP+CP capacity) — EP=8/CP=2 in pretraining, EP=8/CP=8 in RL [§6.1].

CursorBench, the headline benchmark, is constructed from real Cursor engineering-team sessions: median 181 lines changed (vs 7–10 in SWE-bench-* ), median 390-char prompts (vs 1,185–3,055 in public benchmarks). It is rolled forward continuously (CursorBench-3 tasks change >2× the files/lines of earlier iterations) to track shifting developer workflows and avoid saturation [§5, Figs. 7, 9].

  • CursorBench (Cursor’s internal real-session benchmark): 61.3, a major improvement over previous Composer models [§1].
  • Terminal-Bench: 61.7 [§1].
  • SWE-bench Multilingual (in Cursor’s harness): 73.7 [§1].
  • Continued-pretraining loss → RL-reward predictivity: on Qwen3-Coder-30B-A3B at three log-spaced CPT-compute levels, post-SFT cross-entropy loss is monotone with post-RL reward [§3.1, Fig. 2].
  • Best-of-K and average reward both improve under RL — counter to recent claims that RL on LLMs concentrates mass on known trajectories at best-of-K cost (Yue et al. 2025; Liang et al. 2026) [§4.1, Fig. 5].
  • Self-summarization beats prompt-based compaction “consistently” on error rate while using fewer tokens and preserving KV-cache reuse [§4.1].
  • Per-tensor NVFP4 (the standard form) was found to diverge RL training due to batch-variance in scaling; per-token + per-block scaling fixed the divergence [§6.1].
  • Fast-approximation FP division (__fdividef) diverges training in ~100 RL steps under NVFP4; required IEEE-compliant __fdiv_rn [§6.1].

Composer 2 is the most detailed agentic-SWE recipe disclosed by a frontier shop to date, and directly anchors several patterns the wiki has been tracking on speculation. It uses the same Kimi K2.5 base (Qwen3-Coder-Next Technical Report places K2.5 on the same Pareto frontier as Qwen3-Coder-Next 80B-A3B) and validates the broader claim that the open frontier’s recipe — continued pretraining + RL inside a real harness with execution-grounded rewards — is also the frontier-closed recipe; the differences are scale and engineering polish, not algorithm. The continued-pretraining-loss → RL-reward predictivity result (§3.1, Fig. 2) is the cleanest filed datapoint behind the Agentic Software Engineering thesis that “reducing pretraining loss reliably improves downstream RL.”

The Dr. GRPO + no-overlong-masking + standard-KL + self-summarization stack contrasts sharply with the Reasoning RL cluster: where InfTool (Close the Loop: Synthesizing Infinite Tool-Use Data via Multi-Agent Role-Playing) uses GRPO + gated rewards on a closed loop, and HuDA (Human detectors are surprisingly powerful reward models) drops KL entirely following DanceGRPO, Composer 2 keeps KL but argues for the higher-variance estimator over the popular k3 estimator specifically because k3 explodes at high divergence — directly relevant to the Reasoning RL open question on “no-KL on-policy GRPO reward hacking under longer training.” The “both average reward and best-of-K improve” finding is a direct counter-datapoint to the Yue/Liang/Chen/Wen/Tajwar line that RL only reweights known-correct trajectories.

The numerical-precision story (per-tensor NVFP4 diverges RL → per-block FP8 + per-token FP32 fixes it) is a new entry for Training stability at scale orthogonal to the existing architectural / optimizer / router stability axes — stability as a precision-recipe property under RL. The FA4 backward-kernel collaboration with Colfax for QK=192/V=128 connects directly to FlashAttention-4: Algorithm and Kernel Pipelining Co-Design for Asymmetric Hardware Scaling and the IO-Aware Kernel Design template.