Single-Trajectory Asynchronous Optimization for Efficient Agent Reinforcement Learning

    This article introduces single-trajectory asynchronous optimization, a training paradigm for reinforcement learning on long-horizon Agent tasks. It explains why group-based sampling methods such as GRPO-style approaches face compute waste, low data utilization, and amplified off-policy effects in multi-turn Agent workloads. The article then describes the core design—one rollout per input task with immediate asynchronous training—and the mechanisms used to stabilize it: Direct Dual-sided Importance Sampling (DIS), stronger value-model updates and constraints, and action-token-only advantage propagation. It also covers engineering requirements such as decoupled sampling and training pipelines, context compression, joint scheduling, and load balancing, and summarizes the tradeoffs among sample freshness, variance control, generalization, and throughput.

    1. Background: New Challenges from Long-Horizon Agent Training

    As large-model capabilities evolve from single-turn question answering to multi-turn Agent execution, reinforcement learning in the post-training stage faces a new set of problems. Typical Agent tasks—such as long-horizon coding, tool calling, and multi-step mathematical reasoning—often require a model to complete dozens of interactions within a single trajectory. Both the context length and execution time of a single trajectory far exceed those in traditional RLHF scenarios. In this setting, widely adopted group-based sampling methods such as GRPO-style approaches expose clear bottlenecks.

    The basic approach of group-based sampling is to generate multiple rollouts in parallel for the same input task and then use relative advantages within the group as the training signal. This strategy works well for short trajectories, but in long-horizon Agent tasks it encounters difficulties at three levels:

    1. Severe compute waste. Multiple trajectories for the same task are highly similar in content, and each trajectory must complete multiple rounds of interaction in full. Sampling cost grows linearly or even superlinearly with trajectory length.
    2. Low data utilization. Samples within a group must be collected before relative advantages can be computed and training can begin, leaving many completed trajectories waiting and reducing GPU utilization.
    3. Amplified off-policy effects. While waiting for other samples in the group, policy parameters continue to update. By the time training uses these samples, they are already stale, and the bias in gradient estimation increases accordingly.

    Single-trajectory asynchronous optimization is a training paradigm proposed to address these problems.

    2. Core Idea: Single-Rollout Sampling + Asynchronous Training

    The key change in single-trajectory asynchronous optimization is straightforward: each input task samples only one rollout, and that trajectory can be used for training immediately after it is generated, without waiting for other samples in a group.

    This change delivers three benefits:

    • Reduced off-policy impact. Because there is no intra-group waiting, the time window between sample generation and consumption is greatly shortened. The data used for training deviates significantly less from the current policy, and gradient estimation is closer to the on-policy state.
    • Improved generalization. Group-based sampling inherently relies on comparison signals from “multiple answers to the same task,” which can cause the model to overfit to relative differences within a task. Single-trajectory sampling, combined with explicit advantage estimation, shifts the learning signal from “relative within a group” to “absolute for a trajectory,” which helps the model learn decision patterns that are consistent across tasks.
    • Improved system throughput. The training pipeline is no longer constrained by group formation. Sampling and training can be fully pipelined. Together with techniques such as context compression, end-to-end training throughput for long-horizon coding reinforcement learning can improve by multiples.

    In engineering practice, this type of method has been validated to train stably for thousands of steps on models with hundreds of billions of parameters and MoE architectures. It also consistently outperforms group-based sampling and its variants on Agent coding and mathematical reasoning benchmarks, showing good training stability.

    3. Key Technical Mechanisms

    Although single-trajectory sampling simplifies the data flow, it introduces new problems: the gradient estimate from a single trajectory naturally has higher variance, and asynchronous scheduling introduces off-policy bias. To address these issues, the framework designs several coordinated mechanisms.

    1. Direct Dual-sided Importance Sampling (DIS)

    In asynchronous training, the policy version used to generate rollouts differs from the policy version used during training. Directly using its gradient introduces systematic bias. Importance sampling is a classic way to correct this bias, but traditional one-sided correction only handles one direction: reweighting old samples under the new policy.

    Dual-sided importance sampling corrects both directions of the gradient source: it corrects the ratio between the sampling distribution and the target distribution, and it also applies symmetric treatment to bias introduced by operations such as clipping and normalization. This preserves the throughput advantages of asynchronous training while keeping off-policy bias within a range acceptable for stable training. In practice, importance weights are usually clipped to prevent extreme weights from individual trajectories dominating the update direction.

    2. Systematic Strengthening of the Value Model

    Single-trajectory training lacks intra-group comparisons, so the quality of advantage estimation becomes critical to training success. The framework strengthens the value model from three angles:

    • Higher update frequency: For every policy-model update, the value model is updated twice. The value function follows policy changes more quickly, ensuring that the baseline used to compute advantages is as accurate as possible and directly reducing the variance of policy gradients.
    • Limited parameter update scope: The parameters of the attention module are frozen, and only the projection parts of the mixture-of-experts layers are optimized. The representations carried by the attention module are already sufficiently general; restricting their updates avoids representation drift in the value model under small-sample, high-variance conditions and reduces training fluctuation.
    • Larger pretraining data scale: Before entering the reinforcement learning stage, the value model is pretrained on a larger-scale dataset so that it has more reliable prior estimation capability for long-horizon task returns.

    3. Advantage Propagation for Multi-Turn Agent Trajectories

    Agent trajectories typically take the form of long sequences such as “observation → action → observation → action…”. If standard token-level generalized advantage estimation (GAE) propagates advantage signals across the entire sequence, observation tokens dilute and distort the learning signal on actions.

    The framework’s approach is: skip advantage propagation for observation-information tokens and propagate advantage signals only between model-generated action tokens. Intuitively, the degrees of freedom that the model can truly learn are concentrated in the actions it generates itself. Observation content is provided by the environment and does not carry decision responsibility. With this treatment, advantage signals are more concentrated and cleaner, and the direction of policy updates in multi-turn trajectories is clearer.

    4. Engineering Deployment Considerations

    To run this method in real large-scale training clusters, algorithm design alone is not enough. The following engineering support is typically required:

    1. Decoupled sampling–training asynchronous pipeline. Split trajectory generation (inference cluster) and gradient updates (training cluster) into independent stages, connected through a task queue, so that the training side always has fresh samples available.
    2. Context compression. Long-horizon Agent trajectories often have contexts of hundreds of thousands of tokens. By compressing historical interactions into a compact representation, per-step training cost can be greatly reduced without losing key decision information.
    3. Joint scheduling and load balancing. In an asynchronous system, pace matching between the Router (responsible for dispatching tasks to inference instances) and the training system is critical. Joint scheduling is needed to avoid either side becoming a bottleneck and to dynamically balance the load across instances.
    4. Continuous evolution of the training framework. Algorithm iteration and system efficiency improvements should advance together, for example by optimizing data transfer paths, restart and recovery mechanisms, and elastic scaling capabilities for asynchronous reinforcement learning tasks.

    A simplified asynchronous training main loop can be illustrated as follows:

    1. while step < max_steps:
    2. batch = replay.pull_fresh_rollouts(min_freshness=1) # Pull only fresh samples
    3. adv = compute_advantage(
    4. batch, value_model,
    5. action_only=True, # Propagate advantage only across action tokens
    6. dual_clip=True, # Dual-sided importance sampling
    7. )
    8. update_policy(policy_model, batch, adv, frozen=["attn"])
    9. for _ in range(2): # Double the value-model update frequency
    10. update_value(value_model, batch)
    11. replay.update_version(policy_model.version)

    5. Summary

    Single-trajectory asynchronous optimization represents a different technical route from group-based sampling: it replaces “many but stale” samples with “few but fresh” samples, compensates for single-sample variance with stronger value estimation and finer advantage propagation, and trades asynchronous pipelines and context compression for system throughput. For teams building long-horizon Agent training capabilities, the core lesson is that algorithm design (bias correction and variance control) and system design (asynchronous scheduling and load balancing) must be considered as an integrated whole. Only then can stability, generalization, and efficiency be achieved simultaneously in large-scale reinforcement learning training.