High-Performance Agentic RL on 100 GPUs in Five Days: An Engineering Playbook

    This article breaks down a reproducible methodology for running long-horizon agentic reinforcement learning on a budget of roughly 100 high-end GPUs in under five days. It covers three pillars that keep compute from being wasted: environment filtering and difficulty calibration, an optimization recipe tailored to long, stale, and low-precision rollouts, and a unified harness shared by training and evaluation. It also explains where the cost advantage comes from without sacrificing quality, and closes with a reproducibility checklist for teams working on limited clusters.

    High-Performance Agentic RL on 100 GPUs in Five Days

    1. Background: Long-Horizon Agents Have Steepened the Cost Curve of RL

    Long-horizon agents are moving beyond short interactions like “fix one bug” toward continuous terminal operations and coding collaboration that can last for hours. Longer tasks unlock a step change in capability, but they also make the ledger for reinforcement learning (RL) training deteriorate quickly: a single training sample often corresponds to one complete attempt of roughly three hours with hundreds of tool calls, and any failure along the way wastes GPU time measured in hours.

    Frontier labs can scale RL horizontally across thousands of accelerators, while most teams have a budget of only around a hundred GPUs. So the real question is not “can we do RL,” but: on a limited cluster, how do we squeeze the information efficiency of every expensive trajectory to the limit while pushing inference deployment cost into an acceptable range?

    A representative practice that has recently emerged starts from a sparsified base model with roughly 300 billion total parameters and about 17 billion activated parameters per token, then runs full-parameter reinforcement learning that trains all language parameters (including the multi-token prediction layers) while freezing the vision encoder and the index structure. It reaches a Pass@1 in the mid-40% range on terminal-oriented benchmarks, on par with the strongest closed-source options, while the cost per task is more than an order of magnitude lower than the highest inference-intensity configuration, and the capability transfers to multiple software engineering benchmarks. The entire training run consumed only 64 high-end GPUs in under five days, and the full recipe was published.

    This article strips away the specific product attributes and abstracts the practice into a transferable engineering methodology.

    2. Key Takeaway: A 100-GPU Cluster Can Reach the Pareto Frontier

    The Pareto frontier here refers to the set of solutions on the “quality–cost” plane for which no other solution is simultaneously better and cheaper. To approach this frontier at the scale of a hundred GPUs, the key is not to pile on more cards, but to make three things hold at the same time:

    1. Environment filtering: keep every task in a “has signal, appropriate difficulty” band, avoiding ineffective and noisy samples;
    2. An RL recipe for long trajectories: purpose-built for long, stale, low-precision rollouts;
    3. A unified harness: one agent runtime shared by training, model optimization, and evaluation, eliminating implementation drift.

    Missing any one of the three systematically wastes scarce compute.

    3. Step One: Filtering and Difficulty Calibration for Agentic RL Environments

    Failure modes on long-horizon tasks are highly long-tailed. Pouring a raw task pool straight into RL produces two kinds of waste: overly easy tasks contribute almost no gradient, while overly hard tasks fail almost entirely and the advantage estimate degenerates into noise.

    A practical filtering pipeline looks like this:

    • Verifiability first: prefer tasks with automated checks (unit tests, compilation, state assertions); the reward signal must be objective and reproducible;
    • Difficulty bucketing: probe with the current policy using zero-shot or low-sample runs, bucket tasks by pass rate, and keep tasks in the middle band as the main training set;
    • Decontamination and de-leakage: remove samples that overlap heavily with the evaluation set to avoid “training is evaluation”;
    • Dynamic curriculum: continuously resample as training progresses so the difficulty distribution drifts in sync with current capability.

    Illustrative logic (pseudocode):

    1. def select_tasks(pool, policy, k=4, low=0.1, high=0.9):
    2. kept = []
    3. for t in pool:
    4. if not t.verifiable or t.leakage_score > 0.2:
    5. continue
    6. p = pass_rate(policy, t, samples=k)
    7. if low <= p <= high: # the middle difficulty band is the most informative
    8. kept.append((t, p))
    9. return kept

    The point is that difficulty is not a static label but a dynamic quantity that changes with the policy, so it needs periodic recalibration.

    4. Step Two: An Optimization Recipe for “Long, Stale, Low-Precision” Rollouts

    Three practical constraints of long-horizon RL mean you cannot copy the recipe from short tasks.

    (1) Long: a single trajectory has hundreds of tool calls, putting heavy pressure on memory and sequence length. Common approaches include segmented computation, summary compression of earlier turns, truncating and structuring tool outputs, and keeping fine-grained context only for the key reasoning segments.

    (2) Stale: under asynchronous execution, the policy used for sampling and the policy at update time differ in version (off-policy staleness). Staleness must be controlled explicitly, for example by capping the maximum version lag of in-flight samples, down-weighting old samples, and using clipped importance ratios to keep distribution shift from derailing training.

    (3) Low precision: using low-precision inference and mixed-precision training for throughput introduces numerical noise. Countermeasures include keeping critical normalization and loss accumulation in high precision, standardizing and clipping advantages, applying gradient clipping with a more conservative learning rate, and filtering samples with abnormal scales.

    A general skeleton for advantage estimation and the update:

    1. adv = (reward - reward_baseline) / (reward_std + 1e-6)
    2. adv = clip(adv, -A_max, A_max)
    3. ratio = exp(logp_new - logp_old)
    4. loss = -min(ratio * adv, clip(ratio, 1-e, 1+e) * adv)
    5. loss = loss + beta * kl_penalty # control policy drift
    6. grad = clip_grad_norm(loss, G_max) # suppress low-precision noise

    On the engineering side, also note the following: decouple “environment execution” from “parameter update” into an asynchronous pipeline, buffer long-tail tasks with a queue, and avoid the cluster idling that synchronous waiting causes; give failed trajectories partial credit (such as staged completion) instead of a flat zero reward, otherwise long tasks produce almost no gradient.

    5. Step Three: An Agent Harness Shared by Training and Evaluation

    “Implementation drift” in long-horizon agents is a hidden cost driver: when tool interfaces, timeout settings, and retry policies differ between training and evaluation, offline metrics become disconnected from online behavior.

    A unified harness should cover at least:

    • Standardized tool layer: unified interfaces for command execution, file read/write, and retrieval calls, with globally consistent timeout and output truncation policies;
    • Reproducible environments: containerized sandboxes, pinned dependency versions, and snapshot rollback so repeated runs of the same task are comparable;
    • Trajectory observability: structured logs, per-turn call latency and token consumption, and failure-reason classification, making it easy to tell whether the problem is the model or the environment;
    • Evaluation consistency: training and evaluation go through the same entry point, Pass@1 is averaged over multiple trials, and cost is normalized under a consistent definition.

    Illustrative configuration:

    1. harness:
    2. sandbox: container_snapshot
    3. tool_timeout_s: 120
    4. max_turns: 120
    5. output_truncate: 8k
    6. retries: 1
    7. logging: structured_jsonl
    8. eval:
    9. repeats: 5
    10. metric: pass_at_1

    6. Compute and Cost: Why “Cheap” Does Not Come from Lower Quality

    The cost advantage comes from three effects stacking up, not from sacrificing quality:

    1. Sampling efficiency: environment filtering and difficulty bucketing reduce ineffective trajectories, so the effective gradient density per sample is higher;
    2. Scheduling efficiency: the asynchronous pipeline compresses long-tail idle time and keeps utilization of a hundred GPUs high;
    3. Inference economics: the sparsely activated base model has controllable per-token computation, and combined with sensible batching and caching strategies, the cost per task is far below the highest inference-intensity configuration.

    The emphasis is that quality and cost should be viewed on the same log-scale plot: only when the model sits above the dashed line (closer to the Pareto frontier) is a cost reduction a meaningful engineering win.

    7. Reproducibility Checklist: Getting Started on a Limited Cluster

    • Build a verifiable task pool with automated checks first, then talk about RL;
    • Run difficulty probing with the current policy and lock onto the middle difficulty band;
    • Asynchronous sampling + staleness constraints + advantage clipping form a stable update core;
    • Share one harness between training and evaluation, or the metrics are not trustworthy;
    • Make decisions with the dual “quality–cost” curves rather than the score alone;
    • Keep structured logs throughout so failures can be attributed to the environment or the model.

    8. Conclusion

    The barrier to long-horizon agentic RL is shifting from “do you have a thousand GPUs” to “is the recipe rigorous.” Do the three things well—environment filtering, long-trajectory optimization, and a unified runtime framework—and a budget of around a hundred GPUs over a few days can also approach the quality–cost Pareto frontier. For most teams, this is the more realistic and reusable path today: build sandboxes and pipelines on top of general-purpose capabilities such as container platforms, object storage, logging services, and monitoring and alerting offered by platforms like Baidu AI Cloud, and spend scarce compute on samples that actually carry signal.