How to Run Long-Horizon Agent RL on a 100-GPU Cluster
This article explains how to run long-horizon agent reinforcement learning on a 100-GPU-class cluster without relying on thousands of accelerators. It covers why long-horizon agent training is expensive, why the optimization target should be the Pass@1-versus-cost Pareto frontier, and five reusable engineering practices: task environment filtering, an RL recipe for long and stale trajectories, a unified agent harness for training and evaluation, parameter scope for full-parameter training, and a cost-aware evaluation loop. A reproducibility checklist is included.
How to Run Long-Horizon Agent RL on a 100-GPU Cluster
1. Background: Long-Horizon Agents Are Powerful, but Expensive to Train
Long-horizon agents are pushing task boundaries from “fix a single bug” toward continuous terminal operations and software engineering work that can last for hours. These tasks are characterized by long trajectories, many tool calls, large state spaces, and failure points scattered throughout the run. The direct consequence is a sharp rise in reinforcement learning (RL) training cost: a single training sample often corresponds to one complete attempt that lasts hours and involves hundreds of tool calls, so any failure in an intermediate step wastes compute measured in hours.
The common approach to scaling this kind of RL has been to pile on thousands of accelerators. For most teams, however, there is neither the cluster budget for that scale nor the ability to absorb the wasted consumption caused by a low signal-to-noise ratio. The question worth studying is therefore not “can we stack more GPUs,” but: on a 100-GPU-class cluster, how can process and recipe design make every rollout produce usable signal, approaching the performance-cost Pareto frontier?
A recent public technical blog offers a reference answer: starting from a base model with roughly 300B parameters and about 17B activated parameters, running full-parameter RL on only 64 next-generation accelerators for less than five days reached the same level as top closed-source solutions on terminal and coding benchmarks, while reducing per-task cost by more than an order of magnitude and transferring the capability to multiple software engineering benchmarks. The key was not a single trick but a systematic restructuring of the post-training pipeline. The five stages below are abstracted into a reusable engineering methodology.
2. The Goal: Not a Higher Score, but Better Cost Efficiency
Before discussing the specifics, it helps to define the optimization target. Long-horizon agent evaluations typically use Pass@1 (the pass rate of a single attempt), but looking at the score alone hides cost differences. A more reasonable coordinate system is two-dimensional: Pass@1 and average cost per task. The Pareto frontier is the set of configurations where you cannot raise the score at a given cost, or cannot lower the cost at a given score.
This means engineering decisions must optimize two things at once:
- Signal quality: whether each trajectory provides a clear, attributable reward;
- Resource efficiency: whether rollout duration, concurrency, retry counts, inference precision, and storage overhead stay under control.
3. A Systematic Breakdown of the Five Key Stages
3.1 Environment Filtering: Make Every Task Appropriately Difficult with Reliable Signal
The most common failure in long-horizon RL is not that the model fails to learn, but that the environment is too noisy. The team’s approach was to carefully curate agent RL environments around three principles:
- Difficulty stratification: tasks must be neither trivial (no gradient) nor nearly impossible (all-zero reward), keeping the current policy in a range where success is probable;
- Verifiability: prefer tasks with deterministic checks (unit tests, successful compilation, state assertions) and avoid the variance introduced by subjective scoring;
- Low ambiguity: task descriptions, initial states, and acceptance criteria should be clear, reducing cases where the model does the right thing but is judged wrong.
In engineering terms, you can maintain a task pool and sample from it dynamically based on historical pass rates:
# Illustration: difficulty-stratified sampling to control reward variancedef sample_tasks(pool, model_pass_rate, alpha=0.5):# Target range: tasks with pass rates in [0.2, 0.8] give the most stable signalcandidates = [t for t in pool if 0.2 <= model_pass_rate[t.id] <= 0.8]weights = [(1.0 - abs(model_pass_rate[t.id] - 0.5)) ** alpha for t in candidates]return weighted_sample(candidates, weights)
3.2 An RL Recipe for Long Trajectories: Handling Length, Staleness, and Low Precision
Long-horizon rollouts can run for hours, which creates three practical constraints: trajectories are very long, data is relatively stale with respect to the current policy, and inference is often run at lower precision to save memory. The targeted recipe includes:
- Advantage estimation and credit assignment: use segmented or hierarchical advantage estimation for very long trajectories, so a single scalar reward is not diluted across hundreds of tool calls;
- Importance sampling correction: apply clipped or truncated importance weights to stale rollouts to control the variance of policy updates;
- Precision and numerical stability: rollouts can use low-precision inference, but critical normalization and log-probability computations should stay in high precision to prevent gradient explosions or silent NaNs;
- Length budget and early stopping: terminate clearly derailed trajectories early and give the compute to more promising samples.
3.3 A Unified Coding Harness: One Agent Runtime for Training and Evaluation
An often underestimated point: if training and evaluation use different agent runtimes, scores are not comparable and improvements cannot be attributed. The team’s approach was to have model optimization, training, and evaluation share the same harness. The benefits are:
- tool calls, context management, and retry logic stay consistent between training and production;
- evaluation results directly reflect training gains, reducing the gap between offline improvements and no online improvement;
- unified logging and tracing make it easier to determine whether a problem lies with the model or the framework.
3.4 Defining the Scope of Full-Parameter Training: What to Train and What to Freeze
Under a 100-GPU budget, parameter choices directly determine memory usage and throughput. A pragmatic strategy is: apply full-parameter updates to the language backbone (including the multi-token prediction layers) and freeze the vision tower and the retrieval/indexing modules. The rationale is that long-horizon terminal and coding tasks mainly depend on language reasoning and tool orchestration; freezing peripheral modules significantly reduces peak memory and communication overhead while avoiding damage to existing representations under small-sample conditions.
3.5 The Evaluation Loop and Cost Accounting: Making Cost Efficiency Measurable
Finally, cost must be brought into the loop. Practical conventions include:
- use Pass@1 as the primary metric, averaging over multiple runs to reduce variance;
- record average cost per task (including rollouts and inference) and plot the Pareto chart on a logarithmic scale;
- for self-deployed models, convert cost using public pricing so comparisons with closed-source solutions remain valid;
- treat evaluation results from the same harness as a regression baseline to prevent later changes from introducing hidden regressions.
4. A Reproducibility Checklist
- Build a task pool and sample dynamically in difficulty strata based on pass rates to control reward variance;
- Design segmented advantages and importance weight clipping for long trajectories;
- Use low precision for rollouts and high precision for critical operators, combined with early stopping and a length budget;
- Share the same agent runtime between training and evaluation;
- Freeze non-core modules and apply full-parameter updates to the language backbone;
- Use the two-dimensional score-cost coordinate for regression checks rather than looking at the score alone.
5. Conclusion
The bottleneck for long-horizon agent RL is shifting from compute scale to process quality. Approaching the Pareto frontier on a 100-GPU-class cluster depends not on a single breakthrough technique but on the coordination of environment filtering, the long-trajectory recipe, a unified harness, parameter scope, and a cost loop. For most teams, the value of this methodology is: trading controllable compute for stable, attributable, and transferable capability gains. If cloud support is needed, a container platform can provide elastic orchestration, object storage can hold trajectories and checkpoints, and logging plus monitoring and alerting services can track training and evaluation metrics, turning these practices into an operable engineering system.
