Long-Horizon Agent RL on a 100-GPU-Class Cluster: Engineering Practices

    Training long-horizon agents requires more than raw compute: hours-long rollouts must produce reliable learning signals without leaving accelerators idle. This article examines a public experiment using 64 high-end accelerators and outlines its approach to asynchronous training, environment filtering, cost-aware reinforcement learning, a shared coding harness, and evaluation that tracks both success rate and inference cost.

    Long-Horizon Agent RL on a 100-GPU-Class Cluster: Engineering Practices

    1. Why Long-Horizon Agent Training Is Expensive

    Long-horizon agents are moving beyond short tasks such as fixing a single bug toward terminal operations and software engineering workflows that run for hours. A single training sample can involve:

    • An attempt lasting two to three hours or longer.
    • Hundreds of tool calls and environment interactions.
    • A trajectory invalidated by an intermediate failure, such as an environment crash, tool timeout, or incorrect reward evaluation.

    Frontier labs can scale reinforcement learning for these tasks across thousands of GPUs. For smaller teams, however, a failed rollout wastes hours of compute rather than seconds. The central challenge is therefore not simply whether an agent can be trained, but how to turn every accelerator-hour into useful learning signal on a roughly 100-GPU-class cluster.

    A recent public experiment offers a compelling example. Starting from an open-source mixture-of-experts model with approximately 300 billion total parameters and 17 billion active parameters per token, the researchers performed full-parameter reinforcement learning using just 64 high-end accelerators in under five days.

    The resulting agent achieved approximately 46% Pass@1 on a major terminal-agent benchmark, comparable to leading frontier agents. Its per-task cost was roughly 30 times lower than that of the baseline at its highest inference-effort setting. The training recipe was also fully disclosed, providing a strong basis for reproducibility.

    2. Define “Good” Before Optimizing for Speed

    The most valuable aspect of this work is its explicit focus on the performance–cost Pareto frontier, rather than accuracy alone.

    • Optimizing only for Pass@1 can encourage lengthy trajectories and repeated trial and error, driving up inference costs.
    • Optimizing only for lower cost can teach the model to give up quickly, causing accuracy to collapse.
    • The practical objective is to maximize success within a fixed per-task inference budget—or reduce average trajectory length and tool calls while maintaining the same success rate.

    The training workflow addresses this objective through five coupled components: infrastructure, environment filtering, the RL recipe, the coding harness, and evaluation and cost accounting.

    3. Infrastructure: Do Not Wait for the Slowest Rollout

    Long-horizon tasks have highly variable rollout durations. One trajectory may finish in five minutes, while another takes three hours. Under synchronous training, the system must wait for the slowest trajectory, pushing GPU utilization to unacceptable levels.

    The experiment’s asynchronous infrastructure uses three key designs.

    Separate Training and Rollout Resources

    Training and inference/environment-interaction workloads run on separate, dedicated resource groups. This prevents resource contention from causing throughput fluctuations.

    Allow Stale Policy Weights

    Rollout workers can lag behind the main training process by up to six weight versions. The main process continues updating while long trajectories interact with their environments, with the RL algorithm handling the resulting policy mismatch.

    This is an engineering trade-off: accept mildly off-policy data to avoid synchronization waits.

    Accelerate Decoding with Multi-Token Prediction

    The system uses the base model’s built-in multi-token prediction (MTP) capability to accelerate autoregressive generation, increasing the number of useful tokens produced per unit of compute per hour.

    A simplified asynchronous training loop looks like this:

    1. # Pseudocode: asynchronous rollouts with stale-weight tolerance
    2. while not converged:
    3. # 1. If the rollout buffer is too small, sample with the latest
    4. # available weights, allowing a lag of up to six versions.
    5. if rollout_buffer.size() < min_batch:
    6. weights = latest_available_weights(max_staleness=6)
    7. trajectories = env_group.sample(weights, timeout=hours(3))
    8. rollout_buffer.add(trajectories)
    9. # 2. Compute advantages and update using the current policy weights.
    10. batch = rollout_buffer.take(policy_batch)
    11. advantages = compute_advantage(batch, reward_fn, length_norm=True)
    12. update_policy(batch, advantages, kl_penalty=kl_to_base)
    13. # 3. Evaluate periodically, tracking both Pass@1 and average cost.
    14. if step % eval_interval == 0:
    15. log_eval(pass_at_1, avg_cost_per_task)

    4. Environment Filtering: Make Every Task Produce Reliable Signal

    Environment quality sets an upper bound on RL efficiency. If tasks are too difficult, rewards become extremely sparse and most trajectories produce no useful signal. If tasks are too easy, the model already solves them and they contribute little to learning.

    The team addresses this through systematic filtering and stratification:

    • Difficulty stratification: Bucket tasks by the base model’s current success rate. Prioritize intermediate-difficulty tasks that are learnable but not yet mastered, maintaining a useful density of gradient signals.
    • Determinism checks: Remove tasks with unstable reward evaluation or excessive randomness in environment initialization, preventing noisy rewards from distorting the policy.
    • Outdated dependency handling: Repair or discard tasks that depend on obsolete environments or package versions, reducing toolchain failures unrelated to the agent’s policy.
    • Coarse reward identification: Where rewards provide only a rough success/failure signal, use repeated sampling or finer-grained test cases to improve signal precision.

    Filtering should remain coupled to training rather than becoming a one-time preprocessing step. As the model improves, yesterday’s medium-difficulty task may become too easy, requiring ongoing recalibration.

    5. An RL Recipe for Long, Stale, and Coarsely Scored Rollouts

    Long trajectories, partially off-policy samples, and sparse rewards require targeted changes to a standard RL recipe.

    Length-Normalized Advantage Estimation

    Long trajectories should not automatically receive larger updates simply because they contain more steps. Length normalization helps avoid an incentive to prolong tasks.

    Cost-Aware Reward Shaping

    Alongside success rewards, apply marginal penalties for trajectory length, unproductive tool calls, and repeated operations. This makes efficient task completion part of the optimization objective rather than an after-the-fact requirement, directly supporting movement toward the performance–cost Pareto frontier.

    KL Constraints and Stale-Weight Correction

    Use importance weighting and KL penalties to control policy drift when learning from rollouts generated by older weight versions. These mechanisms help prevent stale data from pulling the policy away from its current behavior.

    Curriculum-Based Difficulty Scheduling

    Begin with shorter tasks or subsets with higher success rates, then gradually expand to hours-long tasks. This reduces the risk of training instability early in the process.

    6. A Shared Coding Harness for Training and Evaluation

    The work highlights an often-overlooked issue: mismatches between training and evaluation environments are a major source of unreliable agent RL results.

    A unified harness means that:

    • Tool-call protocols, filesystem views, timeouts, and retry policies are identical during training and evaluation.
    • Sandbox isolation, resource limits, logging, and trajectory replay use the same implementation.
    • Environment changes, such as dependency upgrades, affect training and evaluation together, avoiding gains that depend on training-only behavior.

    Teams building their own harness should treat trajectory replay and deterministic reproduction as first-class capabilities. When a trajectory receives an unexpected reward, being able to reproduce it offline and identify the cause is essential for debugging long-horizon agents.

    7. Evaluation and Cost Accounting: Treat Cost as a First-Class Metric

    Evaluation should report more than Pass@1. It should also include:

    1. Success rate averaged across repeated trials: For example, average results over five trials to reduce the influence of randomness.
    2. Average per-task cost: Convert token consumption and tool-call overhead into cost using publicly listed inference prices.
    3. Failure-mode distribution: Track environment errors, timeouts, incorrect fixes, and abandonment separately, then use those findings to improve environment filtering.

    The reported transfer results are also noteworthy. Training on terminal tasks improved performance on two other software engineering benchmarks. This suggests that RL in realistic long-horizon environments can support cross-task generalization rather than merely fitting a particular benchmark.

    8. Practical Steps for Resource-Constrained Teams

    Smaller teams can apply the methodology in the following order:

    1. Define both objectives. Put success rate and per-task cost on the evaluation dashboard, and report both for every experiment.
    2. Build asynchronous infrastructure first. Separate training and rollout resources, tolerate stale weights, and accelerate decoding. Together, these determine the throughput ceiling.
    3. Make environment filtering data-driven. Build an automated pipeline for calibrating task difficulty and stability.
    4. Model cost explicitly in the reward. Penalties for unnecessary length and unproductive tool calls are more effective than trimming trajectories afterward.
    5. Use one harness throughout. Share the environment implementation between training and evaluation to keep results trustworthy.
    6. Validate incrementally. Run the complete workflow with a smaller model before scaling to full-parameter training at the 300-billion-parameter level.

    9. Conclusion

    This experiment shows that efficient reinforcement learning for long-horizon agents is not limited to frontier labs. With approximately 64 high-end accelerators, carefully designed asynchronous infrastructure, reliable environment signals, cost-aware RL, and a shared training and evaluation harness, it is possible to train an agent approaching frontier-level performance within days while substantially reducing per-task cost relative to a high-inference-effort baseline.

    For resource-constrained teams, the limiting factor is not just cluster size. It is the engineering discipline required to turn every GPU-hour into useful learning signal.