From Cognition · · 4m
SWE-2: near-frontier coding at a quarter the price
Cognition's new coding model scores within a point of Fable 5.1 while costing 64% less, and the trick is how they penalized cost during RL.
In brief
Cognition's new coding model scores within a point of Fable 5.1 while costing 64% less, and the trick is how they penalized cost during RL. If you train every effort level in one RL run and tune the cost penalty to the slope of the base model's Pareto curve, you move the whole cost-performance frontier instead of just…
A cheaper near-frontier model
Cognition's SWE-2 hits 50.0% on FrontierCode 1.1 Main, within one point of Fable 5.1, at 64% lower cost.
“It pushes the Pareto frontier of capability and cost”
RL at 2.8 trillion parameters
SWE-2 is post-trained from Kimi K3, a 2.8T-parameter model already heavily RL'd for agentic coding. This was Cognition's first RL run at multi-trillion-parameter scale.
One run, every effort level
The core addition is an RL algorithm that trains low, medium, high and max effort settings together in a single run, so the entire cost curve moves at once.
Headroom on an already-trained base
Even though Kimi K3 had been through extensive agentic RL, Cognition's pass added 5 to 6 points on many benchmarks and shifted K3's whole cost-performance curve.
How it ranks
SWE-2 beats Grok 4.6 and SWE-1.7 on score and cost, matches GPT-5.6 Sol and Fable 5.1 for far less money, and trails GPT-6 Astra by a few points at a quarter of the price.
Where it still loses
On Terminal-Bench 4, SWE-2 scores 27.3% against Fable 5.1's 55.8% and GPT-6 Astra's 57.9%. The parity claim does not hold on every benchmark.
Smarter means fewer steps
On FrontierCode 1.1 Main, SWE-2 medium outscores SWE-1.7 while taking 58% fewer turns and costing 81% less per run. Better judgment cuts the wandering.
It stops over-exploring
SWE-1.7 read the codebase exhaustively before touching anything, and users complained it overthought easy tasks. SWE-2 makes its first real edit after 18 steps versus 48.
“the largest efficiency gains from SWE-2 come from focused exploration”
Three behaviors they noticed
Internally, SWE-2 wrote better end-to-end tests, found workarounds when a path was blocked, and re-derived conclusions when challenged instead of caving to the user.
“SWE-2 verifies a user's hypotheses instead of simply agreeing”
Effort levels behave differently
Medium jumps into action fast and suits simple work. High and max plan more, read more code, and run heavier verification for genuinely hard tasks.
Why cost-performance is the game
As models get smarter and pricier, the useful question stops being raw capability and becomes which tradeoffs a model makes available across its price range.
The reward function
Reward is success minus a per-effort-level cost penalty: R = S - λC, where cost blends dollars of inference with rollout time. Simple, and deliberately so.
Why the penalty must be linear
If you want average reward to depend only on average cost and solve rate, the penalty has to be linear. Only linear gives the same answer applied before or after averaging.
Tune lambda to the tangent
Set the penalty to the local slope of the base model's Pareto curve. Too large and the model just collapses high effort into medium behavior, banking the cost saving for free.
“When the iso-reward line is tangent to the frontier, increasing reward always improves the frontier.”
A baseline weighted by length
The ideal reward baseline needs an extra backward pass, but rollout length turns out to track it closely. Weighting the group baseline by length approximates it for free.
Stability you can see
The length-weighted baseline kept KL divergence between the inference and training policies low, a measurable improvement in RL stability over the plain group baseline.
Making rollouts fast
A prefill delayer batched nearby requests for a 10-20% throughput gain, and a retrained DSpark draft model got 15% longer accepted sequences during speculative decoding.
Training the drafter online
Speculative decoding decays as the policy shifts, so acceptance rates fall mid-run. Cognition folded draft-model training into the RL loop so the drafter tracks the policy.
Low precision without drift
NVFP4 and FP8 kernels plus quantization-aware training fit more rollouts in memory and gave lower train-inference mismatch than SWE-1.7, on a base model nearly 3x larger.
Data and the verifier flywheel
They tripled RL environments, layered in instruction-following requirements, and used earlier SWE-2 checkpoints to hunt false positives before a resourceful model could hack the rewards.
The key point
If you train every effort level in one RL run and tune the cost penalty to the slope of the base model's Pareto curve, you move the whole cost-performance frontier instead of just one point on it.


