Long-horizon interaction requires agents to make multiple decisions in a changing environment. Outcome-based GRPO lacks fine-grained guidance for intermediate decisions. Recent methods distill completed trajectories into reusable skills and use hindsight-conditioned OPD to provide dense token-level credit. However, skill-induced probability shifts do not necessarily represent reward-aligned credit; especially after an erroneous action changes subsequent interaction states, skill-conditioned supervision may become mismatched with the current state. To address this mismatch, we propose \methodname{}, which routes two complementary hindsight skills according to trajectory outcomes and error boundaries: Positive skills capture successful workflows to reinforce successful trajectories and pre-error decisions, while Negative skills capture failure-specific corrections to target decisive errors. The post-error suffix is optimized exclusively by GRPO, retaining outcome-based learning without extending potentially mismatched hindsight supervision. Extensive experiments demonstrate competitive task performance and support effective fine-grained credit allocation.
Figures & tables
Figure 1: OPD signals versus GiGPO-based step advantages on Qwen2.5-1.5B-Instruct failed trajectories. Each point represents one interaction turn.
Figure 2: Overview of ETRO’s trajectory-aware routing of Positive and Negative hindsight credit.
Method
ALFWorld
Search QA
WebShop
Succ.
NQ
Triv
Pop
Hotp
2Wk
MuS
Bam
Avg.
Score
Succ.
Qwen2.5-1.5B-Instruct
GRPO
65.7
16.6
34.1
15.9
16.1
24.8
3.4
58.1
24.1
72.0
62.0
GRPO+OPSD
71.1
16.9
34.3
16.4
16.3
24.8
3.4
56.9
24.1
84.9
73.4
Skill-SD
68.0
16.7
35.4
14.8
16.7
25.2
3.9
11.2
17.7
80.6
68.8
RLSD
67.2
13.9
29.4
12.4
14.2
21.1
3.0
9.5
14.8
80.5
63.3
Table 1: Results on ALFWorld, Search QA, and WebShop across Qwen2.5-Instruct model scales (%). Higher values indicate better performance.
Table 4
Figure 3: Qwen2.5-1.5B-Instruct training dynamics on WebShop for pure GRPO, full-trajectory Positive and Negative OPD, and ETRO. Training reward is reported in [0,1] . Validation uses a 15-turn interaction limit.
Method
α
Success (%)
Score
ETRO
0
80.8
87.9
Suffix Positive
0.25
79.0
85.1
Suffix Positive
0.5
78.4
85.2
Suffix Positive
1
77.6
84.6
Suffix Negative
0.25
76.6
82.7
Suffix Negative
0.5
74.4
80.6
Table 4: Post-error OPD weight sweep on WebShop using Qwen2.5-1.5B-Instruct, with λ=0.001 .
Metric
Rate (%)
Boundary acceptance
92.0
Exact-turn agreement
84.0
Workflow validity
92.0
Correction validity
90.0
Table 5: Writer quality on WebShop, evaluated against human references by GPT-5.6 sol (%).
Figure 4: Comparison of Negative-skill conditioning regions on WebShop using Qwen2.5-1.5B-Instruct.
Recent agentic reinforcement learning methods use hindsight to complement sparse outcome rewards. However, a completed rollout can yield many such signals, leaving their appropriate allocation across turns unclear. We introduce TRIAL, a trajectory-relative hindsight distillation framework with a unified turn-aligned scoring protocol. For each decision turn, TRIAL extracts an outcome view of that decision's realized consequence and evaluates the same response under ordinary and hindsight-conditioned contexts. The signed log-probability gap determines the direction and local strength of token-level supervision, while turn-level magnitudes are normalized jointly over the realized trajectory. The resulting allocation multipliers have an eligible-token-weighted mean of one, redistributing dense supervision across turns while fixing its average multiplier. Experiments on WebShop and ALFWorld with different backbones show that TRIAL outperforms GRPO across all eight combinations of backbone, environment, and evaluation metric, while achieving the best or tied-best performance among six methods on six of them. On WebShop with Qwen3-1.7B, TRIAL improves the success rate from 56.4% to 75.2% and the task score from 78.7% to 85.7%. Controlled ablations further show that trajectory-relative turn allocation provides substantial gains beyond those of dense hindsight distillation alone.
Haoyu Zheng, Yun Zhu, Qing Wang +1
Zhejiang University · Tencent · Shanghai AI Laboratory
Outcome-based reinforcement learning provides a stable optimization backbone for language agents, but its sparse trajectory-level rewards provide little guidance on which intermediate decisions should be reinforced or suppressed. On-policy self-distillation offers dense token-level supervision, yet existing skill-conditioned variants often rely on external skill memories or retrieved privileged context, which are costly to maintain and can be mismatched with the state distribution induced by the current policy in multi-turn interaction. We propose OPID (On-Policy Skill Distillation), a framework that extracts skill supervision directly from completed on-policy trajectories. OPID represents trajectory hindsight as hierarchical skills: episode-level skills capture global workflows or failure-avoidance rules, while step-level skills capture local decision knowledge at critical timesteps. A critical-first routing mechanism uses step-level skills when critical decisions are identified and falls back to episode-level skills as default guidance otherwise. The selected skill is injected into the interaction history, allowing the old policy to re-score the same sampled response under both original and skill-augmented contexts. The resulting log-probability shift yields a token-level self-distillation advantage, which is combined with the outcome advantage for policy optimization. OPID thus preserves RL as the primary training objective while introducing dense, distribution-matched hindsight supervision. Experiments on ALFWorld, WebShop and Search-based QA demonstrate that OPID generally improves agent performance, sample efficiency, and robustness over outcome-only RL and existing skill-distillation baselines. Our code is available at https://github.com/jinyangwu/OPID/tree/main.
Shuo Yang, Jinyang Wu, Zhengxi Lu +8
1Tsinghua University · 2Zhejiang University · 3The Chinese University of Hong Kong +2
Training multi-turn LLM agents with reinforcement learning typically relies on trajectory-level rewards, which assign a uniform advantage to every step and cannot identify which decisions led to success or failure. Self-distillation methods can provide finer-grained supervision by augmenting RL with privileged information. However, existing approaches usually apply the same type of privileged information to every step in an indistinguishable manner, ignoring a key asymmetry: routine steps need little additional guidance, while critical error steps require corrective direction that environment feedback alone cannot provide. We propose AHEAD, a step-aware framework that matches different supervision sources to different step types. The teacher receives environment feedback on all steps as a grounded dense signal, and additionally receives LLM-generated corrective hints on error steps to supply the direction that environment feedback lacks. The method introduces minimal changes to the standard GRPO algorithm. Across ALFWorld, WebShop, and Search-based QA, and across three model scales, AHEAD raises task success (+13.3 points on ALFWorld and +11.0 on WebShop at 7B over GRPO), reaches a given success rate in fewer training steps, and solves tasks within tighter interaction budgets than outcome-only RL and prior self-distillation baselines.