Long-Horizon Agent RL on 100 GPUs: A Five-Day Recipe
This article explains how a 100-GPU-class cluster can approach the performance-cost Pareto frontier for long-horizon agent reinforcement learning. It covers the rising cost of long-horizon RL rollouts, full-parameter training with frozen vision and sparse-attention components, and five key engineering areas: environment filtering, reward and credit assignment for long trajectories, reuse of stale low-precision rollouts, update boundaries with parallelism and sharded checkpoints, and a shared framework for training and evaluation. It also includes practical deployment recommendations and a sample environment-filtering function.
1. Background: Long-Horizon Agents Make the RL Cost Curve Steeper
Long-horizon agents are moving beyond short interactions such as fixing a single bug toward continuous terminal operations and software engineering tasks that run for hours. Longer tasks unlock new capabilities, but they also sharply increase the cost of reinforcement learning (RL) training: a single training sample can correspond to one complete attempt lasting three hours with over a hundred tool calls, and a failure at any intermediate step wastes compute measured in hours.
Frontier labs can scale RL horizontally across thousands of accelerators, while most teams have clusters with only around a hundred GPUs. The real question is therefore not whether long-horizon RL is possible, but: under limited compute, how can you simultaneously raise the signal-to-noise ratio, reuse rate, and evaluation efficiency of every rollout?
2. Key Finding: A 100-GPU Cluster Can Approach the Pareto Frontier
One validated approach starts from a sparse model with hundreds of billions of parameters that activates only tens of billions per token, and applies full-parameter reinforcement learning: all language parameters are trained, including the multi-token prediction layers, while the vision encoder and the sparse attention indexer are frozen. Only the language backbone and the prediction heads are updated.
On terminal benchmarks, models trained this way reach a Pass@1 above 40%, on par with first-tier closed-source models, while inference cost per task is more than an order of magnitude lower than the highest inference-effort configuration. The capability gains also transfer to software engineering benchmarks that are closer to repository-level fixes. The entire training run completes in five days on tens of next-generation accelerators, and the full recipe is public.
The key point is that efficiency does not come from adding more GPUs. It comes from three things: environment filtering, an optimization recipe tailored to long and stale rollouts, and a programming framework shared by training and evaluation.
3. Rebuilding Five Key Components
3.1 Environment Filtering: Keeping Difficulty in the Learnable Range
The goal is to provide reliable learning signal at a suitable difficulty level for every task. In engineering terms, this reduces to three criteria:
- Pass-rate stratification: keep tasks whose pass rate under the base model falls in a middle range; tasks that are too easy provide no gradient, and tasks that are too hard produce all-zero rewards.
- Verifiability: prefer environments with automated tests or explicit terminal-state checks, avoiding the noise of subjective scoring.
- Reproducibility: pin container images, dependency versions, and network policies to reduce false failures caused by environment drift.
Example logic:
def keep(task, base_pass_rate, lo=0.05, hi=0.95):if not task.has_verifiable_checker: # terminal state can be checked automaticallyreturn Falseif not task.env_reproducible: # image and dependencies are pinnedreturn Falsereturn lo <= base_pass_rate <= hi # difficulty falls in the learnable range
3.2 Rewards and Credit Assignment for Long Trajectories
Hundreds of tool calls mean sparse, delayed terminal rewards. A practical approach is to use the final check result as the main reward, supplemented by small process signals such as format validity, whether commands error out, and whether a valid patch is produced. Failed trajectories should be attributed to either environment errors or policy errors, so that noise is not repeatedly reinforced as negative samples.
3.3 Reusing Stale, Low-Precision Rollouts
Asynchronous sampling makes samples stale relative to the current policy, and low-precision inference introduces distribution shift. Engineering practice requires limiting the staleness window, applying importance-weight clipping to old samples, increasing rollout precision during critical update phases, and aligning the numerical implementations of training and inference to reduce train-inference mismatch.
3.4 Full-Parameter Updates and Freeze Boundaries
Training only the language backbone and the multi-token prediction layers while freezing the vision tower and the sparse attention indexer significantly reduces memory and communication pressure, while preserving multimodal and long-context capabilities. On a 100-GPU cluster, this should be combined with tensor, pipeline, and sequence parallelism plus checkpoint sharding to split optimizer states across GPUs.
3.5 One Programming Framework for Training and Evaluation
If training uses one harness and evaluation uses another, the metrics cannot be trusted. A unified framework means the same tool set, the same context management, and the same timeout and retry policies. This keeps the training signal consistent with online behavior and makes ablation studies comparable.
4. Deployment Recommendations
- Start with a small-scale environment audit: measure the pass-rate distribution and failure attribution before deciding the sampling budget.
- Use asynchronous rollouts to increase throughput, but always set a staleness limit and weight clipping.
- Fix evaluation to average over multiple trials, and report two curves, Pass@1 and cost per task, rather than a single-point score.
- If you use cloud resources, container platforms can provide environment isolation, object storage can store trajectories, and logging and monitoring services can track failure rates, assembling a reproducible pipeline from general-purpose capabilities rather than proprietary interfaces.
5. Conclusion
Competition in long-horizon agent RL has shifted from compute scale to sample efficiency and engineering consistency. Get these five things right, environment difficulty, reward design, stale-sample governance, parameter update boundaries, and a unified framework, and a 100-GPU-class cluster can also approach the performance-cost Pareto frontier.
