SWE-1.7: Frontier Intelligence at a Fraction of the Cost

💥 Read this must-read post from Hacker News 📖

📂 **Category**:

💡 **What You’ll Learn**:

Ben Pan*, Carlo Baronio*, Rohan Choudhury, Eric Lu, Ryan Kim, Deniz Birlikci, TC Qin, Sam Lee, Fermi Ma, Allen Liu, Yang Liu, Sampriti Panda, Jacob Teo, Ray Wang, Gary Chang, Steven Cao, Silas Alberti*equal contribution

07.08.26

Today, we’re launching SWE-1.7, the most capable model we’ve trained so far. It reaches frontier-level intelligence at a much lower cost, advancing the cost-performance Pareto curve.

SWE-1.7 is the result of broad improvements across our RL pipeline: better infrastructure, more stable training, higher-quality data, and new techniques for long-horizon tasks. Since SWE-1.7 was trained from a Kimi K2.7 base, which had already undergone extensive RL post-training, the large additional gains from our own training challenge the idea of a ‘post-training ceiling’ and suggest that RL can push capabilities much further than previously believed.

At Cognition, we have been formulating and refining principles for good agentic software engineering both in evaluation, with FrontierCode1,2, and now in training, with SWE-1.7. Our model is particularly optimized for longer-horizon asynchronous tasks, an important component of high-quality software engineering.

SWE-1.7 is available today in Devin (Web, Desktop, and CLI) via Cerebras at 1000 TPS. We encourage you to try it for yourself!

Coding benchmark resultsPass rate (%) on agentic coding benchmarks.

Benchmark SWE-1.7 Kimi K2.7 Code GPT-5.5 Opus 4.8 Opus 4.7 GLM-5.2 Composer 2.5 SWE-1.6
FrontierCode 1.1 Main 42.3% 30.1% 43.0% 46.5% 38.5% 24.5% 25.6% 9.4%
Terminal-Bench 2.1 81.5% 72.7% 84.2% 86.9% 83.0% 81.0% 76.0% 39.7%
SWE-Bench Multilingual 77.8% 73.5% 76.8% 84.4% 80.5% 74.5% 71.6% 58.3%

The rest of this post covers how we trained SWE-1.7: the infrastructure, algorithms, and data work behind our model. We cover four important components that stand out.

Finally, we conclude by sharing some observations on interesting behavioral tendencies, such as careful exploration and concise reasoning, that the model acquired as a result of our training setup.

We found training stability to be a key contributor to predictable improvement at scale.

When training with asynchronous RL3, one of the most problematic issues we encountered was the KL divergence mismatch between inference and training4, since the trainer policy is usually different from the sampling policy. In the past, to correct for this (albeit at smaller scale), we used importance-sampling5 and quantization-aware training for low-precision rollouts in NVFP4 + experts routing replay6,7.

Here we present additional interventions that become more important at larger scale.

We find that top-p sampling8 contributes significantly to staving off entropy collapse9,10, where a strong model stops exploring and reward plateaus within a few hundred steps.

Very low probability tokens are often part of trajectories that have gone off track or out of distribution. These trajectories are likely to produce low reward, and properties of the softmax function lead to these tokens sharpening the token probability distribution. Indeed, suppose we have three tokens with logits x1>x2x3x_1>x_2\gg x_3

logp3=log[ex3ex1+ex2+ex3]=[p1p2p1+p2]\nabla \log p_3=\nabla\log \left[\frac{e^{x_3}}{e^{x_1}+e^{x_2}+e^{x_3}}\right]= \begin{bmatrix} -p_1 \\ -p_2 \\ p_1+p_2 \end{bmatrix}

and the policy gradient update to the logits is ΔxiA^ logp3\Delta x_i \propto \hat{A}\ \nabla \log p_3

Δx1A^p1,Δx2A^p2,Δx3A^(p1+p2).\Delta x_1 \propto |\hat{A}| \, p_1, \qquad \Delta x_2 \propto |\hat{A}| \, p_2, \qquad \Delta x_3 \propto -|\hat{A}| \, (p_1+p_2).

In these updates, x3x_3

Policy entropy across trainingLine chart of policy entropy across training: the SWE-1.7 recipe holds entropy roughly constant while the baseline decays steadily.

This entropy-preservation effect makes top-pp sampling desirable in our rollouts. But naively implementing top-pp clearly increases the training-inference mismatch — the trainer computes probabilities as a selection from all tokens, while rollouts sample from the top-pp subset, so the distributions have higher divergence, leading to collapse after a small number of steps. Thus, we implement sampling distribution replay11, where we record a kept-set of tokens available for sampling at rollout time, and renormalize probabilities with those masks in the trainer. With this fix, our run’s entropy stays roughly constant over the course of training and inference-training divergence stays bounded.

Training-inference mismatch across trainingLine chart of training-inference divergence across training steps: with sampling distribution replay the divergence stays bounded, while the naive top-p implementation diverges.

Another interesting result of using top-p sampling replay is a targeting of only tokens with p<top_p_thresholdp < \text{top\_p\_threshold}

We also find benefits from using the Muon optimizer12 and eliminating non-deterministic operations in the trainer.

Cognition is a fast-growing research lab entering an established landscape that is heavily compute-constrained. We aim to train trillion-parameter models, but today, large clusters with 10-100k chips on a single network fabric are a scarce resource. In contrast, smaller clusters around the world are abundant, if used together correctly.

In this setting, the structure of RL works in our favor. RL decomposes naturally across multiple clusters. Only the trainer must live on a single high-bandwidth cluster. The inference engines that generate rollouts are self-contained. They can run anywhere and need nothing but the current weights.

We invested in infrastructure that makes use of this property. Our RL training spans four datacenters across three continents, combining our own GPUs across multiple clusters with additional compute from inference providers like Fireworks. The result is that we can scale RL training far beyond what any single cluster would allow.

TRAINER CLUSTER · USROLLOUT CLUSTERS · 3 CONTINENTSData bufferSTATEprompts in · scored data outRollout ManagerCONTROLcustom rollout generationsend init promptrecv scored datageneration requestssend train dataTrainerOPTIMIZEGPUGPUGPUGPUwrite Δ weightsXOR diff + zstdCloud storageSYNCpull Δ, apply in-placeDynamo routerInferenceSERVEGPUGPUInferenceSERVEGPUGPU
SWE-1.7 RL training architecture. A single US trainer cluster streams compressed weight deltas through cloud storage to inference rollout clusters spread across three continents.

The central challenge in this setup is keeping all inference engines up to date with the trainer weights after each optimizer step. We want these weight updates to be fast to reduce staleness of trajectories so we can train with more aggressive learning rates.

Naively broadcasting the full model from one cluster to another would be slow and inefficient. Instead, every K gradient steps, we compute and send a compressed weight delta between the current and previous weights, reducing the size of each transfer by over 99%13.

Rather than streaming the weights directly from the trainer to every inference cluster, we use cloud object storage to maintain a single source of truth for weight versions. After the trainer uploads a new weight delta, the inference engines can be updated with almost no inference downtime. Each training run has a weight controller in each involved cluster that manages the run’s weight version lifecycle. The weight controller polls object storage for new manifests, which the trainer writes after each update. When it finds a new delta, it instructs workers to download their shards, which are then replicated across local disks using a tree broadcast. The same object storage also carries routing matrices and top-p masks from the inference engines back to the trainer.

Each inference engine prefetches the delta into CPU memory while continuing to serve trajectories. Only once the delta is fully staged does the engine briefly pause to apply it in-place. Trajectories that are in-flight can simply continue on the new weights with their KV cache intact.

With this approach, cross-continental weight updates for a 1T parameter model complete in 1–2 minutes end-to-end. This happens asynchronously and blocks neither training nor inference beyond 3–4 seconds of inference pause at update.

At large scale, hardware failures occur continuously, and globally restarting on each failure makes long runs infeasible. Our architecture handles this differently depending on where the failure occurs — the inference engines or the trainer.

Failures on the inference side are cheap by construction. Engines are self-contained and hold no state beyond the current weights, so a dead engine costs only its in-flight sessions. We use NVIDIA Dynamo to manage the engine lifecycles and route inference: each agent sandbox has its own proxy that records tokens in and out, so if a replica goes down, we don’t lose the full trajectory, and Dynamo reroutes it to a different worker. When Dynamo reschedules the replica on healthy nodes, our weight controller loads the most recent checkpoint from object storage and replays a series of deltas from the checkpointed version.

The trainer is the one place where a failure is expensive: it’s the single tightly-coupled component, where one dead node stalls the whole cluster. To make recovery fast, each node checkpoints asynchronously to local disk every step and replicates its shards to peers, so a dead node’s state is rebuilt from replicas in seconds. If capacity is still missing, the run shrinks by whole data-parallel replicas and regrows once nodes return. Throughout this process, the rollout pipeline remains warm. After the trainer restarts, a buffer policy selects which accumulated rollouts to use and prevents bias from any imbalance in training-inference throughput during the interruption.

From the start, we built Devin for completing asynchronous, long-running tasks. SWE-1.7 is trained directly in the Devin harness, so naturally we want to train our own model on longer horizon tasks. This introduces two challenges. First, rollouts can extend far beyond the raw context window. Second, as shown by DeepSeek R114, RL on reasoning tasks tends to produce progressively longer responses, but we want the model to be efficient in its reasoning and only elaborate on difficult tasks.

We address these issues with training for self-compaction and an alternating length penalty.

Response length under the alternating length penaltyLine chart of mean response length across training under the two-phase length penalty. Length grows in unconstrained phases as the model thinks longer on harder tasks and compresses in budget phases on solved tasks.

Data is the core determining factor in what capabilities and skills our model learns. As such, we ensured that the data we trained on was calibrated and sufficiently difficult, and disincentivized undesirable behaviors to keep the model well-aligned. We focused most on the following aspects:

Due to extensive RL, SWE-1.7 exhibits noticeably different behavior from Kimi K2.7 Code, its base model. Firstly, it is significantly more aligned and trustworthy than K2.7 or other frontier open-source models. We expand on this extensively in our companion blog post, Measuring the Trustworthiness of Open-Source-Derived Models.

One behavioral difference we noticed in SWE-1.7 is condensed chain-of-thought. Compared to Kimi-K2.7-Code, SWE-1.7’s first chain-of-thought has a much lower function-word ratio (fraction of words that serve as grammatical “glue”) and nearly half the average number of words per sentence. We think this was influenced directly by the budget phases in our alternating length penalty. We’ve included a couple of examples of condensed chain-of-thought in the dropdown below.

The other major behavioral difference we observed is that SWE-1.7 explores the codebase much more thoroughly before acting, as you can see in the number of tool calls, file reads, and searches the model executes.

Behavioral tendencies on FrontierCode 1.1 MainBox plots of behavioral tendencies on FrontierCode 1.1 Main: SWE-1.7 makes substantially more tool calls, file reads, and greps/searches per run than Kimi-K2.7-Code, Opus 4.8, and GPT 5.5.

This shows up most clearly in bug-fixes. A bug report typically describes one primary symptom, but the underlying issue often affects a larger surface area. SWE-1.7 is much more likely to investigate the root cause of the bug and consider edge cases, hypotheticals, adversarial inputs, and beyond-the-ask requirements than Kimi-K2.7-Code. Through its enhanced codebase exploration, SWE-1.7 also does a much better job understanding the exact design decisions that need to be made. In addition, we’ve observed that SWE-1.7 tends to settle ambiguous semantics by experimenting and probing, for example by writing small Python scripts, rather than guessing.

How often the chain-of-thought probes edge cases and hidden requirementsBar chart on a log scale of how often the chain-of-thought probes edge cases, hypotheticals, adversarial inputs, and beyond-the-ask requirements on FrontierCode 1.1 Main. SWE-1.7 probes more than Kimi-K2.7-Code in every category except hypotheticals.

We believe these behaviors arise directly from the extensive quality-assurance measures we took to strip out false positives and false negatives in our data, forcing our model to come up with more complete, end-to-end solutions. We think that SWE-1.7’s increased due-diligence directly translates to higher performance on various benchmarks. We’ve attached a couple of example trajectories in the dropdown below.

The extra thinking comes at a small cost in increased change scope. As described in FrontierCode1, a good solution modifies only the minimal set of files needed, without touching unrelated code or introducing unnecessary refactors. Since SWE-1.7 reasons more, it also does more: writing additional test cases and touching more files than the task naively requires. We’ve noticed this trend consistently in models across the industry: as reasoning increases, the scope of files that the model touches also expands. This is an axis we’re excited to improve on.

  1. [1]E. Lu, B. Pan, D. Birlikci, S. Lee, R. Wang, R. Choudhury, F. Ma, TC Qin, C. Baronio, and S. Alberti, “Introducing FrontierCode,” June 2026. cognition.com/blog/frontier-code
  2. [2]E. Lu, B. Pan, F. Ma, A. Lombardi, D. Birlikci, S. Lee, R. Wang, R. Choudhury, TC Qin, C. Baronio, J. Teo, J. H. Lee, and S. Alberti, “FrontierCode 1.1,” July 7, 2026. cognition.com/blog/frontier-code-1.1
  3. [3]A. Piché et al., “PipelineRL: Faster On-policy Reinforcement Learning for Long Sequence Generation,” arXiv:2509.19128, 2025.
  4. [4]F. Yao et al., “Your Efficient RL Framework Secretly Brings You Off-Policy RL Training,” 2025. fengyao.notion.site/off-policy-rl
  5. [5]B. Pan, C. Baronio, A. Tam, P. Marsella, M. Jain, D. Chiu, Swyx, and S. Alberti, “Introducing SWE-grep and SWE-grep-mini: RL for Multi-Turn, Fast Context Retrieval,” 2025. cognition.com/blog/swe-grep
  6. [6]“Stabilizing MoE Reinforcement Learning by Aligning Training and Inference Routers” (Rollout Routing Replay, R3), arXiv:2510.11370, 2025.
  7. [7]C. Baronio, B. Pan, S. Lee, E. Lu, S. Cao, R. Choudhury, A. Zweiger, R. Wang, G. Chang, and S. Alberti, “An Early Preview of SWE-1.6 and Research Update,” March 2026. cognition.com/blog/swe-1-6-preview
  8. [8]A. Holtzman et al., “The Curious Case of Neural Text Degeneration,” arXiv:1904.09751, 2019.
  9. [9]G. Cui et al., “The Entropy Mechanism of Reinforcement Learning for Reasoning Language Models,” arXiv:2505.22617, 2025. arxiv.org/abs/2505.22617
  10. [10]S. Yu et al., “DAPO: An Open-Source LLM Reinforcement Learning System at Scale,” arXiv:2503.14476, 2025. arxiv.org/abs/2503.14476
  11. [11]DeepSeek-AI, “DeepSeek-V3.2: Pushing the Frontier of Open Large Language Models,” arXiv:2512.02556, 2025. arxiv.org/abs/2512.02556
  12. [12]K. Jordan et al., “Muon: An optimizer for hidden layers in neural networks,” 2024. kellerjordan.github.io/posts/muon — see also J. Liu et al., “Muon is Scalable for LLM Training,” arXiv:2502.16982, 2025.
  13. [13]Fireworks AI, “Frontier RL Is Cheaper Than You Think,” 2026. fireworks.ai/blog/frontier-rl-is-cheaper-than-you-think
  14. [14]DeepSeek-AI, “DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning,” arXiv:2501.12948, 2025. arxiv.org/abs/2501.12948
  15. [15]C. Baronio, P. Marsella, B. Pan, and S. Alberti, “Kevin-32B: Multi-Turn RL for Writing CUDA Kernels,” 2025. cognition.com/blog/kevin-32b
  16. [16]Kimi Team, “Kimi K2.5: Visual agentic intelligence,” arXiv:2602.02276, Feb. 2026. arxiv.org/abs/2602.02276
  17. [17]The Terminal-Bench Team, “Terminal-Bench: A Benchmark for AI Agents in Terminal Environments,” 2025. tbench.ai
  18. [18]J. Yang et al., “SWE-smith: Scaling Data for Software Engineering Agents,” arXiv:2504.21798, 2025. arxiv.org/abs/2504.21798 (SWE-bench Multilingual: swebench.com/multilingual)

{💬|⚡|🔥} **What’s your take?**
Share your thoughts in the comments below!

#️⃣ **#SWE1.7 #Frontier #Intelligence #Fraction #Cost**

🕒 **Posted on**: 1783531577

🌟 **Want more?** Click here for more info! 🌟

By

Leave a Reply

Your email address will not be published. Required fields are marked *