Command Palette
Search for a command to run...
SEED: SELF-EVOLVING ON-POLICY DISTILLATION FOR AGENTIC REINFORCEMENT LEARNING
SEED: SELF-EVOLVING ON-POLICY DISTILLATION FOR AGENTIC REINFORCEMENT LEARNING
Abstract
Large language models are increasingly trained as interactive agents for longhorizon tasks involving multi-turn interaction, tool use, and environment feedback. Outcome-based reinforcement learning (RL) provides a practical optimization paradigm, but its sparse trajectory-level rewards offer limited guidance on intermediate decisions, leaving a supervision gap between episode-level outcomes and token-level policy learning. We propose SEED (SElf-Evolving On-Policy Distillation), a self-evolving framework that converts completed on-policy trajectories into training-time hindsight skills and distills their behavioral effect back into the policy model. SEED first fine-tunes the policy to analyze completed trajectories and generate natural-language skills that capture reusable workflows, decisive observations, or failure-avoidance rules. During RL, the current policy both collects trajectories and serves as the analyzer that extracts hindsight skills from them. Policy updates therefore improve subsequent decision making and skill analysis together, allowing hindsight supervision to evolve with the policy. SEED then re-scores the sampled actions under ordinary and skill-augmented contexts, converting the skill-induced probability shift into a dense token-level on-policy distillation signal. This signal is jointly optimized with outcome-based RL, keeping the auxiliary supervision aligned with the current trajectory distribution. Extensive experiments on text-based and vision-based agentic tasks show that SEED consistently improves performance and sample efficiency, exhibiting robust generalization to unseen scenarios.
One-sentence Summary
Tsinghua University, Zhejiang University, et al. propose SEED (SElf-Evolving On-Policy Distillation), a self-evolving framework that converts completed on-policy trajectories into natural-language hindsight skills and distills their behavioral effect into a dense token-level supervision signal jointly optimized with outcome-based reinforcement learning, thereby bridging the supervision gap and significantly improving performance and sample efficiency in agentic tasks.
Key Contributions
- SEED is a self-evolving on-policy distillation framework that transforms completed on-policy trajectories into hindsight skills and distills their behavioral guidance back into the policy, allowing decision-making and skill analysis to co-evolve during agentic reinforcement learning.
- A policy-synchronized hindsight on-policy distillation mechanism converts skill-induced log-probability shifts on sampled actions into dense token-level supervision and jointly optimizes this signal with outcome-based RL.
- Experiments on embodied interaction, web navigation, search-based QA, and visual reasoning and planning benchmarks show consistent improvements in task performance, sample efficiency, and robustness over representative baselines.
Introduction
Large language model agents increasingly operate in multi-turn settings where they must reason, act, use tools, and incorporate environmental feedback over long horizons. Reinforcement learning has become a key post-training paradigm for these agents because it directly optimizes policies against task-level outcomes. However, outcome-based RL provides only sparse, trajectory-level rewards: it signals whether an episode succeeded but cannot identify which intermediate decisions, tool calls, or observations were effective. This leaves a supervision gap between coarse episode outcomes and fine-grained token-level policy learning. Prior hindsight learning methods attempt to exploit completed trajectories for richer feedback, but they typically treat hindsight as static experience, external memory, or fixed inference-time prompts, which cannot adapt as the policy improves and encounters new states and failure modes.
The authors introduce SEED (SElf-Evolving On-Policy Distillation), a framework that converts completed on-policy trajectories into natural-language hindsight skills and distills their behavioral guidance back into the policy through a self-evolving training loop. During RL, the same model collects trajectories and analyzes them to extract reusable workflows, decisive observations, and failure-avoidance rules. Because the policy and the analyzer share the same checkpoint, both decision-making and hindsight supervision co-evolve. SEED then uses the extracted skills to rescore sampled actions under ordinary and skill-augmented contexts, producing a dense token-level on-policy distillation signal that is jointly optimized with the outcome-based RL objective. This allows the policy to internalize reusable guidance without external memory or extra inference-time prompts. Evaluations across embodied interaction, web navigation, search-based QA, and visual reasoning show consistent improvements in task performance, sample efficiency, and robustness.
Method
The authors present SEED, a self-evolving on-policy distillation (OPD) framework designed for agentic reinforcement learning. SEED is motivated by the observation that completed agent trajectories contain rich hindsight information. Even when rewards are sparse, a full trajectory often reveals useful behavioral patterns, failure causes, and reusable strategies that are not directly available at intermediate decision steps. SEED converts such hindsight information into hindsight skills and distills their behavioral effect back into the ordinary policy.
As shown in the figure below, SEED consists of two main training stages. First, hindsight-skill supervised fine-tuning (SFT) equips a single policy model to analyze completed trajectories. Second, the current policy snapshot both collects on-policy trajectories and analyzes them into hindsight skills. The same sampled actions are then re-scored under ordinary and skill-augmented contexts to construct a token-level OPD signal, which is optimized jointly with RL.
Problem Formulation The authors formulate long-horizon agentic tasks as partially observable Markov decision processes (S,A,O,T,Ω,R,γ). At timestep t, the agent receives an observation ot∈O and maintains an interaction history ht=(o0,a0,o1,a1,…,ot). The policy generates the next action according to at∼πθ(⋅∣ht). A completed trajectory is denoted by τ={(ot,at,rt)}t=0T−1, with an episode-level outcome R(τ)∈R. In many agentic environments, R(τ) is sparse and becomes available only after task completion. The standard reinforcement learning objective is J(θ)=Eτ∼πθ[R(τ)]. SEED bridges the granularity gap between trajectory-level feedback and token-level decisions by deriving an auxiliary training-time token-level signal from hindsight skills extracted after trajectory completion.
Hindsight Skill Supervised Fine-Tuning The first stage initializes the policy with the ability to analyze full interaction histories and express reusable behavioral guidance as natural-language hindsight skills. The authors first collect an offline pool of trajectories using a base policy without skill augmentation. For a set of training tasks Qsft={qj}j=1M, they run K0 rollouts with the base policy πθbase to form the offline trajectory pool B. Each trajectory contains the task description, observations, actions, rewards, and final outcome, collected without any hindsight skill in the decision context.
Given a completed trajectory τ, an external analyzer Aext produces a hindsight-skill annotation sτ=Aext(τ). For a successful trajectory, sτ captures reusable strategies or workflows, while for a failed trajectory, it encodes corrective or avoidance guidance. The annotation is retained only if it is correctly formatted, forming the accepted SFT set Dsft. The policy model is then fine-tuned to predict the hindsight skill from the completed trajectory using the standard negative log-likelihood objective: Lsft(θ)=−E(xτ,sτ)∼Dsft[∑ℓ=1∣sτ∣logπθ(sτ,ℓ∣xτ,sτ,<ℓ)] The resulting checkpoint θsft initializes the later RL policy. During RL, the trajectory analyzer is instantiated directly from the current policy checkpoint, allowing the same model to act in the environment and generate hindsight skills without a separately trained analyzer.
Self-Evolving On-Policy Distillation The second stage performs agentic RL with an additional token-level OPD signal. At the start of each update, SEED freezes the current policy as πθold. This snapshot collects trajectories and parameterizes the analyzer that extracts their hindsight skills. A trainable policy πθ, initialized from πθold, is then optimized with both the environment-driven RL and OPD objectives.
For each task prompt q, SEED samples a group of N trajectories using the frozen policy: Gq={τq(1),τq(2),…,τq(N)}. The analyzer agent, instantiated from the same policy snapshot πθold, analyzes each completed trajectory and generates a hindsight skill sq(n)=Aθold(xτq(n)). This shared parameterization creates the self-evolving loop, where refreshing θold changes both the trajectories encountered by the actor and the model capability used for skill analysis.
To construct the distillation objective, SEED keeps the original on-policy actions fixed and re-scores them under a skill-augmented context. Let H be a deterministic context augmentation function. At timestep t in trajectory τq(n), the skill-augmented history is h~q,n,t=H(hq,n,t,sq(n)). The same policy computes two token-level log-probabilities on the same sampled action tokens. The skill-conditioned teacher branch log-probability is obtained by re-scoring the sampled action under the skill-augmented history: ℓq,n,t,ℓskill=logπθ(aq,n,t,ℓ∣h~q,n,t,aq,n,t,<ℓ) The ordinary student branch log-probability under the original interaction history is: ℓq,n,t,ℓθ=logπθ(aq,n,t,ℓ∣hq,n,t,aq,n,t,<ℓ) The authors define the detached skill-induced log-probability shift Δq,n,t,ℓ=sg[ℓq,n,t,ℓskill−ℓq,n,t,ℓθ], where sg[⋅] denotes stop-gradient. This shift is mapped to a confidence gate gq,n,t,ℓ=σ(βopdΔq,n,t,ℓ). The OPD loss is defined as a confidence-gated sampled-token distillation objective: Lopd(θ)=Eq,n,t,ℓ[mq,n,t,ℓ⋅gq,n,t,ℓ⋅(sg[ℓq,n,t,ℓskill]−ℓq,n,t,ℓθ)] Because both the gate and the teacher log-probability are detached, minimizing this objective increases the ordinary policy's likelihood of teacher-endorsed on-policy tokens, internalizing the skill's behavioral effect.
In addition to OPD, SEED optimizes the policy with a group-relative RL objective. For each group Gq, the trajectory-level group-relative advantage is computed as Aq,nrl=(R(τq(n))−μq)/(σq+ϵ). The final training objective combines environment-driven agentic RL with hindsight-skill OPD: LSEED(θ)=Lrl(θ)+λopdLopd(θ) The updated policy then becomes πθold for the next iteration, closing the self-evolving loop. At inference time, the deployed agent acts only from the ordinary interaction history at∼πθ(⋅∣ht). All hindsight skills are used only as training-time guidance, meaning deployment requires no analyzer, no skill bank, no retrieval module, and no augmented decision prompt.
Experiment
SEED is evaluated on three long-horizon agentic benchmarks—ALFWorld, WebShop, and Search-based QA—covering embodied control, web navigation, and tool-augmented question answering. Compared to outcome-only RL and static distillation baselines, SEED's dense token-level hindsight supervision from a self-evolving trajectory analyzer yields consistent improvements across all domains. Experiments show that internalizing skills through distillation is more effective than providing them as prompts, that the method accelerates convergence and reduces unproductive exploration, and that it achieves superior sample efficiency and generalization to unseen environments. Ablations confirm that each component—hindsight-skill SFT, self-evolving on-policy distillation, and on-policy skill extraction—is critical, with on-policy skills being the most important.
SEED substantially improves over outcome-only reinforcement learning by providing dense token-level hindsight supervision, with consistent gains across ALFWorld, Search-based QA, and WebShop. Internalizing skills into the policy yields better performance than supplying them as prompts during evaluation, and self-evolving distillation from the policy's own trajectories outperforms static distillation approaches. SEED outperforms GRPO and Skill-GRPO on all three long-horizon benchmarks, with especially large margins on ALFWorld and WebShop. Self-evolving hindsight distillation, which adapts to the policy's changing behavior, proves more effective than using a fixed skill library.
Ablation experiments on ALFWorld show that all three core components of SEED are essential for its strong average performance. The largest degradation comes from replacing on-policy skill distillation with a static offline library, which lowers the average by over 7 points. Removing hindsight-skill SFT or self-evolving OPD also causes substantial drops of around 5–6 points, confirming that initial trajectory analysis and continuous distillation from the evolving policy are both critical. Replacing on-policy skills with a static offline library causes the largest performance drop, reducing the average from 91.8 to 84.4. Removing hindsight-skill SFT decreases the average by 5.8 points, showing that initial trajectory-analysis capability provides an important foundation for self-evolution.
The evaluation uses three long-horizon benchmarks—ALFWorld, Search-based QA, and WebShop—to validate SEED’s dense token-level hindsight supervision and self-evolving skill distillation. Internalizing skills into the policy outperforms using them as prompts, and self-evolving distillation from the policy’s own trajectories surpasses static approaches. Ablation studies confirm that all three core components (on-policy skill distillation, hindsight-skill SFT, and self-evolving OPD) are essential, with the largest drop from replacing on-policy skills with a static library.