Long-程 Agent Reinforcement Learning on a 100-GPU Cluster: Environment, Algorithm, and Harness Alignment
This article explains how to run full-parameter long-horizon agent reinforcement learning on a roughly 100-GPU cluster, based on a 300B-class sparse model with about 17B activated parameters per token. It covers why inference-heavy reasoning tiers hit diminishing returns, how to select the base model and freeze the vision encoder and sparse attention indexer, how to build a task pool with difficulty bucketing and deterministic checkers, and how to handle long, stale, low-precision rollouts with clipped importance sampling, logprob correction, and length-aware credit assignment. It also stresses using one harness for training, inference, and evaluation, and summarizes the cost, validation, and infrastructure checklist.
1. Why Long-Horizon Agent Training Is Expensive and Hard
Over the past year, the capability frontier of terminal and coding agents has been pushed up quickly, but the gains often come with a sharp rise in inference cost. A common pattern in the industry is that on terminal task benchmarks, the strongest reasoning tier can cost tens of times more per task than a mid-tier model, while the Pass@1 improvement is far from proportional. In other words, simply increasing the inference budget is entering a region of diminishing returns. The real opportunity is to improve training efficiency and inference efficiency at the same time, pushing the whole curve toward the performance–cost Pareto frontier.
The Pareto frontier here means that at the same Pass@1 level there is no cheaper option, or at the same cost there is no option with a higher pass rate. Pushing that frontier outward leaves only two paths: make the model complete tasks with fewer samples and shorter trajectories, or make training itself cheap enough that “trading reinforcement learning for capability” holds on a hundred-GPU-class cluster.
2. Starting Point: A Mid-Scale Model That Is “Fast and Wide”
A repeatedly validated engineering judgment is that the base model for full-parameter reinforcement learning does not have to be the largest and strongest one. Instead, pick a sparse model from the model card that has a relatively large total parameter count but a small number of activated parameters per token. There are three reasons:
- Small activated parameters mean high inference throughput during rollout, keeping sampling cost under control.
- Large total parameters mean sufficient capacity, giving reinforcement learning enough plasticity to reshape the behavior distribution.
- Sparse structures naturally fit long-trajectory scenarios, because the time cost of long-horizon tasks comes mainly from decoding rather than training.
A typical configuration is a sparse architecture with about 300B total parameters and about 17B activated parameters per token. During training, all language parameters are updated (including the multi-token prediction layer), while the vision encoder and the sparse attention indexer are frozen. Updating the latter two together would significantly amplify memory and communication pressure, with limited benefit for terminal tasks.
A schematic split of the training scope:
Trainable: all parameters of the language backbone + multi-token prediction layerFrozen : vision encoder tower, sparse attention indexerGoal : concentrate limited memory and bandwidth on the behavior policy itself
3. Key One: Environment Filtering That Keeps Every Task “Just Learnable”
The most common failure mode in long-horizon agent reinforcement learning is not a weak algorithm but an unreliable reward signal. If a task is too easy, the model saturates early and its gradient contribution approaches zero. If a task is too hard, rollouts almost all fail, the variance of advantage estimation explodes, and training diverges. The core of environment engineering is therefore to build a task pool with a reasonable difficulty distribution:
- Difficulty bucketing: bucket tasks by historical pass rate, keep tasks in the middle range first, and dynamically retire tasks that are saturated or always unsolved.
- Verifiable signals: prefer tasks with deterministic checks (unit tests, build artifacts, file-state assertions) and avoid subjective scoring that introduces noise.
- Truncatable trajectories: set a reasonable maximum step count and timeout per task so a few tasks cannot consume the entire sampling budget.
- Isolation and reproducibility: run each task in its own sandbox and snapshot the initial state so that repeated sampling starts from identical conditions.
A simplified filtering logic in engineering terms:
def keep(task, pass_rate, lo=0.15, hi=0.75):# Too-easy tasks have no gradient value; too-hard tasks have excessive varianceif not (lo <= pass_rate <= hi):return Falsereturn task.has_deterministic_checker and task.max_steps <= 64
4. Key Two: An Algorithm Recipe for “Long, Stale, Low-Precision” Rollouts
Long-horizon rollouts have three natural properties that require targeted design:
- Long: a single trajectory can involve dozens of tool calls, making the sequence extremely long, with memory and attention cost as the main bottleneck.
- Stale: there is a time gap between sampling and parameter updates, so the data is off-policy.
- Low precision: low-precision inference is used for throughput, so logprobs carry systematic bias.
Corresponding strategies:
- Use clipped importance sampling to correct off-policy bias and keep stale data from pushing the policy off course.
- Add probability correction or consistency checks for low-precision inference, reducing the chance that logprob error is mistaken for an advantage signal.
- Apply length-aware hierarchical optimization that splits overly long trajectories into manageable segments and performs credit assignment, easing sparse rewards.
- Share one deterministic configuration between training and evaluation to avoid the drift where “it runs in training but fails in evaluation.”
5. Key Three: One Programming Framework Shared by Training, Optimization, and Evaluation
The third and often underestimated factor is the agent harness. The same model can show a significant Pass@1 difference under different harnesses, because tool descriptions, error-propagation formats, and context-trimming strategies all change the behavior distribution. If training uses framework A and evaluation uses framework B, reinforcement learning is optimizing a mismatched distribution. All three must therefore come from the same source: a unified environment adaptation layer, unified tool interface contracts, and a unified format for observations and error messages, with evaluation results fed back as input to environment filtering to close the loop.
6. Cost and Compute: What Five Days on a Hundred GPUs Means
Completing full-parameter long-horizon reinforcement learning of a 300B-class model within a window of about 64 next-generation accelerator cards and less than five days shows that the bottleneck has shifted from “do we have enough cards” to “is the recipe right.” On the cost side, the lesson is that a self-hosted model should be billed by converting its public price, so it can be compared on the same basis with closed-source high reasoning tiers. Under that basis, after reinforcement learning a mid-to-low reasoning tier can cost more than an order of magnitude less per task while matching Pass@1.
7. A Reusable Implementation Checklist
- Base model: prefer sparse mid-to-large total-parameter models with small activated parameters.
- Environment: difficulty bucketing + deterministic checkers + sandbox isolation.
- Algorithm: clipped importance sampling + low-precision correction + length-stratified credit assignment.
- Framework: the same harness for training, inference, and evaluation, with evaluation feeding back into filtering.
- Validation: cover at least three benchmark types—terminal operations, software engineering fixes, and repository-level tasks—and average over multiple runs.
- Infrastructure: use a container platform for environment orchestration, object storage for trajectories and snapshots, and logging plus monitoring and alerting to track reward curves and failure clusters.
8. Conclusion
Advancing the frontier of long-horizon agent reinforcement learning is essentially about getting environment, algorithm, and framework right at the same time. A hundred-GPU-class cluster is fully capable of producing frontier-level efficiency, as long as you refuse to blindly pile on inference budget and instead rely on verifiable environments, algorithms adapted to long trajectories, and a framework with a consistent basis, turning every sample into effective gradient.
