Cognition launches new SWE-2 model, Rivaling Fable 5.1 and GPT-Astra
Cognition launches new SWE-2 model, Rivaling Fable 5.1 and GPT-Astra
Cognition 发布全新 SWE-2 模型,性能比肩 Fable 5.1 与 GPT-Astra
Today we’re introducing SWE-2, our most advanced coding model yet. It pushes the Pareto frontier of capability and cost, achieving 50.0% on FrontierCode 1.1 Main, within one point of Fable 5.1 while being 64% cheaper. 今天,我们正式推出迄今为止最先进的编程模型 SWE-2。它进一步拓展了能力与成本的帕累托前沿(Pareto frontier),在 FrontierCode 1.1 Main 基准测试中达到 50.0% 的得分,与 Fable 5.1 仅差 1 个百分点,但成本降低了 64%。
With SWE-2, we scaled RL to the multi-trillion-parameter regime for the first time, building on the SWE-1.72 training infrastructure and recipe. The key addition is an RL algorithm that trains all reasoning-effort levels in a single run, advancing the whole cost–performance frontier. 在 SWE-2 中,我们首次将强化学习(RL)扩展至数万亿参数规模,并基于 SWE-1.72 的训练基础设施和方案进行了构建。其核心改进在于引入了一种全新的强化学习算法,能够在单次运行中训练所有推理努力程度(reasoning-effort levels),从而全面提升了成本与性能的前沿表现。
The result is our closest model yet to the frontier. On FrontierCode 1.1 Main and DeepSWE 1.1, SWE-2 beats SWE-1.7 and Grok 4.6 on both score and cost, matches GPT-5.6 Sol and Fable 5/5.1 at a fraction of their price, and comes within a few points of GPT-6 Astra at a quarter of the cost. 这是我们迄今为止最接近行业顶尖水平的模型。在 FrontierCode 1.1 Main 和 DeepSWE 1.1 测试中,SWE-2 在得分和成本上均超越了 SWE-1.7 和 Grok 4.6;以极低的价格匹配了 GPT-5.6 Sol 和 Fable 5/5.1 的性能;并以四分之一的成本达到了接近 GPT-6 Astra 的水平。
SWE-2 is post-trained from Kimi K33, a 2.8T-parameter model that had already undergone extensive RL for agentic coding. As with SWE-1.7, our RL still finds substantial headroom, adding 5–6 points on many benchmarks and shifting K3’s entire cost–performance frontier. SWE-2 是基于 Kimi K33 进行后训练的,这是一个拥有 2.8 万亿参数的模型,此前已针对智能体编程进行了广泛的强化学习训练。与 SWE-1.7 一样,我们的强化学习方法依然挖掘出了巨大的提升空间,在多个基准测试中提高了 5-6 个百分点,并重塑了 K3 的整体成本性能前沿。
Coding benchmark results
编程基准测试结果
| Benchmark | SWE-2 | Kimi K3 | Grok 4.6 | Fable 5.1 | GPT-5.6 Sol | GPT-6 Astra | SWE-1.7 |
|---|---|---|---|---|---|---|---|
| FrontierCode 1.1 Main | 50.0% | 44.2% | 48.0% | 50.9% | 47.5% | 53.3% | 42.0% |
| DeepSWE 1.1 | 73.0% | 68.5% | 67.5% | 67.4% | 72.7% | 74.1% | 37.7% |
| Terminal-Bench 2.1 | 92.8% | 88.3% | 88.4% | 91.4% | 88.8% | 89.9% | 81.5% |
| Terminal-Bench 4 | 27.3% | 21.5% | 20.3% | 55.8% | 37.3% | 57.9% | 7.6% |
The rest of this post covers what SWE-2 does differently and how we trained it. We begin with SWE-2’s behavior, focusing on the characteristics that make it more efficient and intelligent compared to our previous models. Then, we detail the post-training advances behind SWE-2: 本文后续部分将介绍 SWE-2 的独特之处及其训练方法。我们首先从 SWE-2 的行为表现入手,重点分析使其相较于前代模型更高效、更智能的特性。随后,我们将详细阐述 SWE-2 背后的后训练技术进展:
- Cost penalties: We apply a linear cost penalty per effort level in a single RL run, with each penalty tuned to the local slope of the base model’s Pareto frontier. 成本惩罚: 我们在单次强化学习运行中对每个努力程度等级应用线性成本惩罚,并根据基础模型帕累托前沿的局部斜率对每个惩罚进行调整。
- Reward baselines: We derive the length-weighted reward baseline we have used since SWE-1.6 and show how it significantly stabilizes training. 奖励基准: 我们推导出了自 SWE-1.6 以来一直使用的长度加权奖励基准,并展示了它如何显著稳定训练过程。
- RL rollout serving: We improve scheduling and train an online draft model to raise decoding throughput. 强化学习部署: 我们改进了调度机制并训练了一个在线草稿模型,以提高解码吞吐量。
- Training data: We triple the number of our RL environments, add instruction-following overlays, and build a flywheel powered by previous checkpoints of SWE-2 that iteratively hardens our verifiers. 训练数据: 我们将强化学习环境的数量增加了两倍,添加了指令遵循覆盖层,并利用 SWE-2 的先前检查点构建了一个飞轮,以迭代方式强化我们的验证器。
SWE-2 is available starting today in Devin Desktop and CLI. We’re also rolling it out on Devin Web and Fusion. SWE-2 即日起在 Devin Desktop 和 CLI 中可用。我们也将陆续在 Devin Web 和 Fusion 上推出该模型。
Model Behavior
模型行为
SWE-2’s improvements in intelligence and efficiency are closely connected. Stronger engineering judgment allows the agent to write more complete solutions alongside fewer detours and redundant reads. On FrontierCode 1.1 Main, we see that SWE-2 medium scores higher than SWE-1.7 while taking 58% fewer turns and costing 81% less on average. SWE-2 在智能和效率上的提升是紧密相连的。更强的工程判断力使智能体能够编写更完整的解决方案,同时减少弯路和冗余读取。在 FrontierCode 1.1 Main 测试中,我们发现 SWE-2 Medium 版本的得分高于 SWE-1.7,但平均步骤减少了 58%,成本降低了 81%。
In our previous post, we observed SWE-1.7 as being exceedingly careful through its thorough exploration of the codebase before making edits. While boosting performance, this led to user feedback that SWE-1.7 tended to over-explore and overthink on simple tasks. Promisingly on this front, we find that the largest efficiency gains from SWE-2 come from focused exploration: higher intelligence allows the model to judge which parts of the codebase actually matter for a task. 在我们之前的文章中,我们观察到 SWE-1.7 在进行编辑前会通过彻底的代码库探索表现得极其谨慎。虽然这提升了性能,但也导致用户反馈称 SWE-1.7 在处理简单任务时往往过度探索和过度思考。令人欣喜的是,我们发现 SWE-2 的最大效率提升来自于“聚焦式探索”:更高的智能使模型能够判断代码库中哪些部分对任务真正重要。
From testing SWE-2 internally, we observed that the higher model capabilities also manifested in the following behavioral patterns: 通过内部测试,我们观察到 SWE-2 更强的模型能力还体现在以下行为模式中:
- Test coverage: SWE-2 is better at writing tests that check an implementation end-to-end, catching regressions and edge cases more reliably. 测试覆盖率: SWE-2 更擅长编写端到端的实现测试,能更可靠地捕获回归问题和边缘情况。
- Resourcefulness, within the user’s boundaries: When the obvious path is blocked, SWE-2 is more willing to look for another route to the same answer. 用户边界内的灵活性: 当显而易见的路径受阻时,SWE-2 更愿意寻找其他途径来达成目标。
- Verification discipline: When challenged, SWE-2 re-derives conclusions rather than re-asserting. SWE-2 verifies a user’s hypotheses instead of simply agreeing. 验证纪律: 当受到质疑时,SWE-2 会重新推导结论而非简单重复。SWE-2 会验证用户的假设而非盲目同意。
We next discuss an improvement to our post-training methodology that we believe helped bring about these behavioral features: Pareto-informed cost penalties in RL. 接下来,我们将讨论我们后训练方法中的一项改进,我们认为这有助于实现这些行为特征:强化学习中基于帕累托信息的成本惩罚。
Pushing the Pareto Frontier with RL
通过强化学习推动帕累托前沿
As models become more intelligent and expensive, cost–performance tradeoffs grow increasingly important in the coding agent landscape. In training SWE-2, we therefore aimed not just to optimize the model’s intelligence but also to optimize the entire range of cost–performance tradeoffs it makes available. 随着模型变得越来越智能且昂贵,成本与性能的权衡在编程智能体领域变得愈发重要。因此,在训练 SWE-2 时,我们的目标不仅是优化模型的智能,还要优化其所能提供的整个成本与性能权衡范围。