Cognition Launches SWE-1.7: Mitigating Entropy Collapse and Scaling RL Across Distant Clusters
Cognition has released SWE-1.7, an agentic coding model trained on a Kimi K2.7 base that achieves performance parity with frontier models. The architecture scales reinforcement learning across four global datacenters using compressed weight updates and introduces a sampling distribution replay method to prevent entropy collapse.
Architectural Overview and Benchmark Performance
Cognition has released SWE-1.7, a software engineering model optimized for long-horizon, asynchronous agentic tasks. Built on the Kimi K2.7 base model, which had already undergone RL post-training, SWE-1.7 demonstrates that additional reinforcement learning can continue to drive performance gains beyond perceived post-training ceilings. Served via Cerebras at 1000 tokens per second (TPS), the model matches or closely approaches the capabilities of frontier models like GPT-5.5 and Opus on specialized software development benchmarks.
In evaluations, SWE-1.7 achieved a 42.3% pass rate on the FrontierCode 1.1 Main benchmark, compared to Kimi K2.7's 30.1%, GPT-5.5's 43.0%, and Opus 4.8's 46.5%. On Terminal-Bench 2.1, SWE-1.7 scored 81.5%, outperforming its predecessor SWE-1.6 (76.0%) and narrowing the gap to Opus 4.8 (86.9%). On SWE-Bench Multilingual, the model achieved 77.8%, establishing a major lead over its base model's 73.5%.
Mitigating Entropy Collapse via Sampling Distribution Replay
A primary challenge in scaling long-horizon asynchronous RL is the Kullback-Leibler (KL) divergence mismatch between the training policy and the sampling policy. In asynchronous setups, the trainer policy regularly diverges from the rollout sampling policy. To combat the resulting training instability and entropy collapse—where a model halts exploration and its reward curve plateaus—Cognition implemented top-p sampling within the rollout phase.
Without top-p filtering, sampling low-probability, low-reward tokens causes training updates that disproportionately sharpen the probability distribution. For three tokens with logits $x_1 > x_2 \gg x_3$ and negative advantage $\hat{A} < 0$, backpropagating the gradient of a sampled $x_3$ trajectory yields updates proportional to the token probabilities: $\Delta x_1 \propto |\hat{A}| p_1$ and $\Delta x_2 \propto |\hat{A}| p_2$. Because $p_1 > p_2$, the logit for the dominant token ($x_1$) increases faster than the logit for the runner-up ($x_2$), artificially widening the probability gap, decreasing entropy, and stalling optimization.
To safely deploy top-p sampling without exacerbating the training-inference mismatch, Cognition developed sampling distribution replay. During rollouts, the system records the "kept-set" of valid tokens available under the top-p threshold. The trainer then uses these masks to renormalize probabilities, bounding the training-inference divergence. Additionally, this setup zeroes out gradients for highly confident tokens where the keepset size is 1, reducing gradient noise and prioritizing high-signal tokens.
Distributed Multi-Cluster RL Architecture
To bypass single-fabric physical limits, Cognition split its RL pipeline across four datacenters spanning three continents, leveraging both internal GPUs and external providers like Fireworks. While the trainer cluster resides in a single high-bandwidth US facility, the self-contained inference engines generating rollouts run asynchronously across the globe.
The core engineering challenge of this decoupled architecture is keeping distributed inference engines synchronized with the central trainer's weight updates. Streaming the full parameter set continuously is bottlenecked by WAN bandwidth. Cognition resolved this by computing a compressed weight delta every K gradient steps.
Using an XOR difference operation paired with zstd compression, the size of each weight transfer is reduced by over 99%. These compressed deltas are uploaded to cloud object storage rather than being broadcasted directly. Rollout clusters fetch these deltas from the central cloud storage repository and apply them in-place to local weights, keeping latency low and allowing for more aggressive learning rates.
Horizon Extension and Optimization Hardening
For long-horizon tasks that exceed the physical context window, SWE-1.7 utilizes a self-compaction strategy. The model is trained to write concise summaries of its working state and resume execution directly from those summaries. To incentivize this behavior without losing critical technical details, the training pipeline applies an alternating length penalty.
The optimization process was further hardened by replacing standard optimizers with the Muon optimizer and systematically removing non-deterministic operations from the training code. The training data pipeline also filters tasks through automated execution environments, stripping out low-signal tasks and hardening test cases to prevent reward hacking.