Cognition Blog→ original

Cognition releases SWE-2: 50% on FrontierCode at a 64% lower price

Cognition has released SWE-2, its strongest coding model. It is fine-tuned from Kimi K3 (2.8 trillion parameters) with RL and scores 50.0% on FrontierCode 1.1 Main. Fable 5.1 reaches 50.9% but costs 64% more. SWE-2 trails GPT-6 Astra by a few points but is four times cheaper. All reasoning effort levels were trained in a single RL run with a cost penalty. • SWE-2 medium uses 58% fewer steps and 81% less money than SWE-1.7. • The first code edit happens at step 18 instead of step 48. • The model is already available in Devin Desktop and CLI.

AI-processed from Cognition Blog; edited by Hamidun News
Cognition releases SWE-2: 50% on FrontierCode at a 64% lower price
Source: Cognition Blog. Collage: Hamidun News.
◐ Listen to article

Cognition has introduced SWE-2, its strongest programming model. On FrontierCode 1.1 Main it scores 50.0%. That is 0.9 points below Fable 5.1, at a price 64% lower. The model is fine-tuned from Kimi K3, which has 2.8 trillion parameters. According to the company, this is the first time it has scaled RL into the multi-trillion-parameter range. SWE-2 is available today in Devin Desktop and CLI, and is rolling out to Devin Web and Fusion.

The numbers against competitors

Cognition compares SWE-2 with the base Kimi K3, Grok 4.6, Fable 5.1, GPT-5.6 Sol, GPT-6 Astra and its own SWE-1.7. The company says SWE-2 beats SWE-1.7 and Grok 4.6 on both quality and price. It is comparable in quality to GPT-5.6 Sol and Fable 5/5.1 but noticeably cheaper. It sits a few points behind GPT-6 Astra, at a quarter of the price.

  • FrontierCode 1.1 Main: 50.0% (Kimi K3 — 44.2%, Fable 5.1 — 50.9%, GPT-6 Astra — 53.3%, SWE-1.7 — 42.0%).
  • DeepSWE 1.1: 73.0% (Kimi K3 — 68.5%, GPT-5.6 Sol — 72.7%, GPT-6 Astra — 74.1%, SWE-1.7 — 37.7%).
  • Terminal-Bench 2.1: 92.8% versus 91.4% for Fable 5.1.
  • Terminal-Bench 4: 27.3%. Here the gap is huge: Fable 5.1 scores 55.8% and GPT-6 Astra 57.9%. SWE-2 does, however, beat SWE-1.7's 7.6% by almost a factor of four.

In other words, the leaders pull far ahead on Terminal-Bench 4. On many benchmarks, it is RL fine-tuning that delivers the 5–6 point gain over Kimi K3. Cognition says the base model still had considerable headroom.

How it was trained: cost inside the reward

The main methodological novelty is a cost penalty built directly into the reward function. The reward is computed as R = S − λe·C. Here S is 1 for a successful run and 0 for a failed one, C is the cost of the run (a mix of inference dollars and time), and e is the reasoning effort level.

The coefficient λe is tuned to the local slope of the base model's Pareto curve at that level. In an appendix, Cognition proves that the penalty must be linear: only a linear penalty behaves the same before and after averaging across tasks. If λ is set too high, the model at high effort starts behaving like medium.

Cost falls faster than solve rate, the reward rises, and the frontier does not move. All effort levels are trained in a single run. Kimi K3 handles this with separate experts per domain and level, followed by distillation.

Training stability comes from a length-weighted group baseline, which Cognition has used since SWE-1.6. The optimal baseline requires an extra backward pass, but gradient norm correlates strongly with rollout length. So the baseline is replaced with the sum of Ri·Li divided by the sum of Li. In ablations, this keeps the KL between inference and training low.

Rollouts were sped up as follows: a prefill delayer batches similar requests and yields 10–20% in TPM per GPU and TPS per request. DSpark speculative decoding loses efficiency as the policy changes, so the draft model was retrained through SpecForge. The length of accepted sequences grew by 15%. NVFP4/FP8 kernels and quantization-aware training reduced memory use. The mismatch between training and inference came out smaller than for SWE-1.7 at similar throughput, even though the model is almost three times larger. The number of RL environments has tripled, and overlays with instructions were added. Earlier SWE-2 checkpoints are used to tighten the verifiers.

Agent behavior and what developers should do

The most visible effect is savings in steps. On FrontierCode 1.1 Main, SWE-1.7 takes an average of 127 steps per task; SWE-2 medium takes 53, high 80, and max 98. The first real edit with medium comes at a median of step 18, versus step 48 for SWE-1.7. This addresses user complaints that the previous model spent too long exploring code on simple tasks. Medium is also faster and 81% cheaper than SWE-1.7, while scoring higher. Cognition also notes qualitative shifts: tests have become more thorough, and when an MCP integration was blocked, the model reconstructed the data from Slack history. When a user proposes a hypothesis, SWE-2 tests it rather than simply agreeing.

In practice, the choice looks like this. For simple and medium tasks, start with medium: it gets to the point faster. Save high and max for complex changes that need planning and multi-step verification. If your tasks resemble Terminal-Bench 4, meaning long terminal workflows, leave a margin or try GPT-6 Astra and Fable 5.1. The figures so far come from Cognition itself, so run SWE-2 on your own repository and compare the cost per solved task.

ZK
Hamidun News
AI news without noise. Daily editorial selection from 50+ sources. A product by Zhemal Khamidun, Head of AI at Alpina Digital.
✦ Hands-On AI Engineering

Build & Ship Production AI Apps with Vibe Coding

Join Zhemal Khamidun's hands-on Vibe Coding Intensive at hamidun.com/vibecoding — master Claude Code, Cursor, and autonomous agentic workflows.

Explore Vibe Coding →Vibe Academy Platform
What do you think?
Loading comments…