# SWE-1.7

# SWE-1.7

**Source:** Cognition blog — https://cognition.com/blog/swe-1-7
**Fetched:** 2026-07-18 (via `defuddle`)
**HN discussion:** https://news.ycombinator.com/item?id=48833866

---

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.

[See how models rank on the FrontierCode leaderboard](https://cognition.com/frontiercode)

At Cognition, we have been formulating and refining principles for good agentic software engineering both in evaluation, with FrontierCode, 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.

## Coding benchmark results

Pass rate (%) on agentic coding benchmarks.

|  | 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.

- **Preserving entropy and stabilizing training:** Long RL runs face two challenging problems: entropy collapse, and instability due to numerical drift between training and inference. We hunted down and addressed causes of each, which enabled training to keep improving well past where earlier runs stalled.
- **Multi-cluster training and fault tolerance:** RL doesn't need all of its inference compute in one cluster. We trained on clusters across three continents, shipped weight updates through object storage, and built fault tolerance so that hardware failures never stalled the run.
- **Curating high-quality data:** We built an extensive data-quality pipeline that runs each task through automated execution tests, filters out tasks with low learning signal, and hardens tasks to prevent reward-hacking.
- **Self-compaction for long-horizon tasks:** The model learns to summarize its working state and resume from the summary, extending task horizons past the raw context window. We use an alternating length penalty to incentivize concise output without sacrificing correctness.

## Preserving Entropy and Stabilizing Training

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

When training with asynchronous RL, one of the most problematic issues we encountered was the KL divergence mismatch between inference and training, 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-sampling and quantization-aware training for low-precision rollouts in NVFP4 + experts routing replay.

We find that top-p sampling contributes significantly to staving off entropy collapse, 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; sampling them sharpens the token probability distribution and decreases entropy. Top-p sampling prevents these low probability tokens from being sampled as optimization targets in the first place.

Naively implementing top-p increases the training-inference mismatch — the trainer computes probabilities over all tokens while rollouts sample from the top-p subset. Cognition implements sampling distribution replay: record a kept-set of tokens available for sampling at rollout time, and renormalize probabilities with those masks in the trainer. With this fix, entropy stays roughly constant over training and inference-training divergence stays bounded. A side effect is that tokens above the top-p threshold have their gradients zeroed out, which Cognition says reduces gradient noise and focuses optimization on high-learning-signal tokens. They also report benefits from the Muon optimizer and from eliminating non-deterministic operations in the trainer.

## Multi-cluster Training

Cognition describes itself as a fast-growing research lab entering a compute-constrained field. It aims to train trillion-parameter models, but large clusters with 10-100k chips on a single network fabric are scarce, while smaller clusters are abundant. RL decomposes naturally across multiple clusters: only the trainer must live on a single high-bandwidth cluster, and the inference engines that generate rollouts are self-contained and need only the current weights.

RL training spans four datacenters across three continents, combining Cognition's own GPUs with additional compute from inference providers like Fireworks. Every K gradient steps, the trainer computes and sends a compressed weight delta between the current and previous weights, reducing each transfer by over 99%. Rather than streaming weights directly, cloud object storage maintains a single source of truth for weight versions. A weight controller in each cluster polls object storage for new manifests, downloads shards, and replicates them across local disks with a tree broadcast. Each inference engine prefetches the delta into CPU memory while serving, then briefly pauses to apply it in-place. Cross-continental weight updates for a 1T parameter model complete in 1-2 minutes end-to-end, with only 3-4 seconds of inference pause at update.

## Fault Tolerance

Failures on the inference side are cheap by construction. Engines hold no state beyond the current weights, so a dead engine costs only its in-flight sessions. Cognition uses NVIDIA Dynamo to manage engine lifecycles and route inference; each agent sandbox has a proxy that records tokens in and out, so if a replica goes down the full trajectory isn't lost and Dynamo reroutes it. The trainer is the one place where a failure is expensive — one dead node stalls the whole cluster. Each node checkpoints asynchronously to local disk every step and replicates 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.

## Intelligent Self-Compaction for Long-Horizon Tasks

Devin was built for asynchronous, long-running tasks, and SWE-1.7 is trained directly in the Devin harness. This introduces two challenges: rollouts can extend far beyond the raw context window, and RL on reasoning tasks tends to produce progressively longer responses (as shown by DeepSeek R1).

Cognition addresses these with training for self-compaction and an alternating length penalty. When an agent approaches the context limit, it is asked to summarize its working state and resumes from its self-authored summary; during training the model learns both to write succinct summaries and to work from them. With self-compaction, rollouts during the SWE-1.7 training run reach up to six hours in duration. Rather than applying a length penalty uniformly, an alternating strategy switches between unconstrained phases (optimize only for task success) and budget phases (penalize solutions exceeding a weighted cost budget of tokens, turns, and tool-call time). Response length compresses on tasks within the model's ability while long-horizon behavior on hard tasks is preserved.

## Data Quality

- **Verifier quality:** A task's verifier can accept incorrect solutions (false positives) or reject valid ones (false negatives). Cognition built QA pipelines to minimize both in training.
- **Difficulty:** On tasks the model always solves or always fails, there's no learning signal. Cognition curated data the model solves only a low fraction of the time.
- **Cheating detection and prevention:** Sandboxes were network-restricted and stripped of git history and reference artifacts; the grading path was isolated from the agent; programmatic checks caught known exploit signatures; trajectories with any cheating attempt were assigned reward 0 regardless of success.

## Results: Model Behaviors

Cognition reports SWE-1.7 behaves noticeably differently from its Kimi K2.7 Code base. It is said to be more aligned and trustworthy than K2.7 or other frontier open-source models (covered in a companion post, *Measuring the Trustworthiness of Open-Source-Derived Models*). SWE-1.7 shows condensed chain-of-thought — a lower function-word ratio and nearly half the average words per sentence versus Kimi-K2.7-Code — attributed to the budget phases of the alternating length penalty. It also explores the codebase much more thoroughly before acting (more tool calls, file reads, and searches). In bug-fixes it is more likely to investigate root cause and probe edge cases, hypotheticals, and adversarial inputs, and it tends to settle ambiguous semantics by writing small scripts rather than guessing. The extra thinking comes at a cost in increased change scope: SWE-1.7 writes additional tests and touches more files than the task requires — a trend Cognition says holds across the industry as reasoning increases.

## Evaluation Methodology

- All models evaluated under their maximum reasoning effort.
- **Terminal-Bench 2.1:** evaluated on Cognition's own internal evaluation framework, using Claude Code for Anthropic models, Codex for OpenAI models, and Devin CLI for other models, timeout=4h.
- **SWE-Bench Multilingual:** self-reported numbers used when available, otherwise evaluated on Devin CLI.
- **FrontierCode 1.1:** Cognition's own benchmark (see cognition.com/blog/frontier-code-1.1).

---

## HN discussion notes (item 48833866)

- **pants2:** the cost-vs-performance chart looks like Cursor's Composer 2.5 chart, except Composer 2.5 sits at a different spot. Both models are RL'd from Kimi as a base; the training data and benchmarks likely come from the same kind of dataset (Devin/Cursor interaction logs), so they naturally overfit to their own benchmarks. Posits it's not deliberate deception.
- **spate141 / londons_explore:** "build your own benchmark, you can win it"; most benchmarks are gamed by training on the test set. "Benchmarks are just vibes with error bars... wake me up when it survives a week on a real codebase without hallucinating a package."
- **harmonic18374:** distrust rooted in Cognition's first (2024) Devin demo being widely called misleading; pattern of marketing-first claims.
- **achierius:** smart people and real products, but repeated suspicious/fabricated marketing claims; they avoid unfavorable comparisons and lean on their own benchmarks. In personal use their models were not as useful as comparable Claude/GLM (hadn't tried SWE-1.7 yet).
- **throwaw12 / mirekrusin / spott:** SWE-1.7 is closed-weight despite being derived from MIT-licensed Kimi K2.7; not on HuggingFace.
- **akshaydeshraj / joecot:** only usable inside the Devin harness — no API access from other tools.
- **petesergeant:** odd to show competitors' API prices since most users don't pay that way; likes that it's provisioned by Cerebras and would emphasize TPS.
- **oofbey:** "you get what you measure" — collapsing quality to a single number involves trade-offs; define a KPI and people push it up even with bad side effects.
