Single-Trajectory Asynchronous Optimization: Improving RL Training Efficiency for Large-Model Agents

    As large models evolve from chat assistants into agents that perform long-horizon, multi-step tasks, the bottleneck in post-training has shifted. This article examines why conventional group-based reinforcement learning pipelines struggle with long agent trajectories, and how a single-trajectory, asynchronous training approach reduces off-policy bias, improves generalization, and boosts end-to-end training throughput by more than 2.3x. It also distills practical engineering lessons for teams building agent RL pipelines on their own infrastructure.

    1. Why Agent RL Is Hard

    As large models evolve from “chat assistants” into agents capable of executing multi-step tasks, the core tension in the post-training stage is shifting. In traditional RL training, the loop of generating a response, computing a reward, and updating parameters is relatively compact, with trajectories typically spanning only a few thousand tokens. In long-horizon agent tasks—such as software engineering, multi-turn tool calling, and complex reasoning—a single complete trajectory can span tens or even hundreds of thousands of tokens and involve extensive environment interaction.

    This creates three pressures on the training system:

    1. High sampling cost. To obtain stable policy gradient estimates, classic methods such as GRPO sample a group of multiple trajectories for the same input task, then use the relative advantage within the group as a baseline. The longer the trajectories and the more complex the tasks, the more the compute cost of group sampling grows—linearly or worse.
    2. Off-policy contamination. The multiple trajectories produced by group sampling lag behind parameter updates in time. The samples used in training often come from an “old policy,” and growing off-policy divergence introduces bias into gradient estimates and undermines convergence stability.
    3. Low system utilization. Generation time for long trajectories varies enormously. In a synchronous training framework, the generation side and the training side wait on each other, leaving GPUs idle for large portions of time.

    2. Core Idea: From Group Sampling to Single-Trajectory Sampling

    The core idea of single-trajectory asynchronous optimization is straightforward: generate exactly one rollout per input task that can be used for training immediately, without relying on within-group comparisons to construct advantage estimates.

    This change produces benefits at several levels:

    2.1 Reducing Off-Policy Effects

    Group sampling requires “batching up” trajectories before training them together, which inherently introduces a time gap between samples and policy versions. Single-trajectory sampling compresses the generate-train granularity to a minimum: samples can enter the training pipeline as soon as they are generated. Combined with asynchronous scheduling, the policy version gap is kept within a narrower range, so gradient estimates stay closer to the true behavior of the current policy.

    2.2 Improving Generalization

    Group sampling performs relative comparisons within a group, so the advantage signal is essentially a “horizontal comparison on the same task,” and the model tends to learn relative preferences specific to that task. In single-trajectory mode, the advantage signal relies more on task-level rewards and a global baseline, so the optimization objective is closer to the policy’s absolute performance. This helps capabilities transfer to longer agent execution trajectories—which is exactly what long-horizon RL aims for: keeping RL-driven gains sustained across longer execution chains.

    2.3 Training Stability

    At the scale of hundred-billion-parameter models and tens of thousands of training steps, stability is the top priority. A single-trajectory method, combined with a sound advantage estimator and truncation strategy, can train stably for thousands of steps in a large-scale pipeline without collapsing—an essential property for real-world deployment.

    3. System Side: Asynchronous Scheduling and Context Compression

    Algorithmic innovation only translates into real throughput when paired with system optimization. Under a single-trajectory asynchronous framework, the training pipeline runs in a mode where generation and training proceed continuously in parallel:

    • Joint scheduling between the router and the training system. Long-horizon agent tasks exhibit extreme variance in trajectory length, so dynamic load balancing between the generation side and the training side is needed to prevent some workers from becoming bottlenecks on overly long trajectories.
    • Context compression. Long trajectories often contain large amounts of redundant observations and intermediate outputs. Compressing the context before it enters training significantly reduces sequence length and GPU memory usage on the training side, while preserving the interaction information that matters for decision-making.
    • Continuous evolution of the training framework. Open-source, extensible training frameworks—such as the lightweight slime-style frameworks common in the community—iterate on both algorithmic and system efficiency, and are a key enabler of throughput gains.

    Together, these optimizations deliver more than a 2.3x improvement in end-to-end training throughput for long-horizon coding RL tasks. That number means more than saving compute: within the same compute budget, you can cover more tasks and more rounds of exploration.

    4. Engineering Lessons

    For teams building agent RL training pipelines on their own platforms, several reusable lessons stand out:

    1. Decouple generation from training first. An asynchronous architecture—in which the generation cluster and the training cluster scale independently and connect through queues and version management—is the foundation of throughput optimization.
    2. Control policy version drift. Asynchronous does not mean unmanaged. Explicitly track the policy version of each sample, and apply importance weighting or discard stale samples to prevent off-policy errors from accumulating.
    3. Keep the base model consistent. In post-training iterations, keeping the base model fixed and improving it only through RL makes it easier to attribute capability gains and to compare the effects of different algorithm versions.
    4. Build reproducible evaluation baselines. Reward noise is high in long-horizon tasks. Fix your evaluation task set and sampling temperature so you can reliably judge whether an algorithmic change is genuinely effective.
    5. Leverage elastic cloud resources. Using container platforms for elastic scaling, object storage for trajectory data, message queues to decouple generation from training, and monitoring and alerting to keep long-running tasks stable can dramatically reduce pipeline operational overhead.

    5. Takeaway

    Single-trajectory asynchronous optimization represents a pragmatic path for agent RL training: at the algorithm level, a smaller sampling granularity yields lower off-policy bias and stronger generalization; at the system level, asynchronous scheduling and context compression yield several-fold end-to-end throughput gains. As agent tasks grow longer and more complex, “algorithm–system co-design” will become the defining theme of post-training infrastructure for large models—and it deserves close attention and hands-on practice from every engineer working on large-model training.