HyperAIHyperAI

Command Palette

Search for a command to run...

AGENTOPSD: 에이전트 강화 학습을 위한 재귀적 자기 증류

초록

검증 가능한 보상을 사용하는 강화 학습(RL)은 궤적 수준의 어드밴티지를 구성하지만, 장기간 다중 턴 에이전트 RL에서 결과를 이끄는 소수의 핵심 결정을 제대로 평가하지 못하는 경우가 많다. 최근 일부 연구에서는 신용 할당에 특권적 자기 증류를 도입하여 더 조밀한 지도를 제공하지만, 이러한 국소 신호가 순차적 신용을 어떻게 표현해야 하는지는 여전히 불분명하다. 이에 우리는 에이전트 강화 학습을 위한 비평가 기반의 재귀적 턴 수준 신용 할당 기법인 AgentOPSD를 제안한다. AgentOPSD는 토큰 수준의 교사-학생 로그 확률 차이를 턴 수준의 증거로 집계하고, 로그 오즈 공간에서 베이지안 믿음 상태를 재귀적으로 갱신한다. 이는 희소한 결과 지도를 턴 수준의 신용 신호로 변환하고 연속된 상태 간의 한계 수정을 통해 핵심 턴을 식별하는 원칙적인 재가중치 부여 방식을 제공하며, 추가적인 롤아웃을 필요로 하지 않고 표준 정책 최적화와 완전히 호환된다. 우리는 두 가지 Qwen 모델 규모(3B 및 7B)를 사용하여 ALFWorld, WebShop, Search-QA에서 AgentOPSD를 평가했다. AgentOPSD는 GRPO 및 강력한 자기 증류 기준선 대비 성능을 향상시켜 Qwen2.5-7B로 ALFWorld에서 89.1%의 성공률을 달성했으며, 절제 연구를 통해 이러한 성능 향상이 턴 수준 집계와 이력 의존적 재귀 믿음 갱신에 기인함을 확인했다. 우리의 코드는 https://github.com/ZethWang/AgentOPSD에서 확인할 수 있다.

One-sentence Summary

Tsinghua University, Zhejiang University, and Meituan researchers propose AgentOPSD, a critic-free recursive turn-level credit assignment method that aggregates token-level teacher-student log-probability gaps into turn-level evidence, recursively updates a Bayesian belief state in log-odds space to reweight sparse outcome supervision into turn-level credit signals, identifies pivotal turns, and achieves 89.1%89.1\%89.1% success on ALFWorld with Qwen2.5-7B, outperforming GRPO and self-distillation baselines.

Key Contributions

  • AgentOPSD aggregates token-level teacher–student log-probability gaps into turn-level evidence and recursively updates a Bayesian belief state in log-odds space, converting sparse trajectory-level rewards into turn-level credit signals.
  • The method identifies pivotal turns by the marginal revision between consecutive belief states and redistributes the trajectory-level advantage without requiring additional rollouts or a learned critic.
  • Experiments on ALFWorld, WebShop, and Search-QA with two Qwen model scales show that AgentOPSD consistently outperforms GRPO and strong self-distillation baselines, reaching 89.1% success on ALFWorld with Qwen2.5-7B, and ablations attribute the gains to turn-boundary aggregation and history-dependent recursive belief updates.

Introduction

In agentic reinforcement learning, large language models must make decisions across many turns in interactive environments, but training signals often arrive only as sparse terminal rewards. Standard group-relative policy optimization (GRPO) broadcasts a uniform advantage across the entire trajectory, failing to differentiate pivotal actions from routine steps, especially over long horizons. On-policy self-distillation (OPSD) offers denser, token-level supervision, yet its signals are misaligned with environment turn boundaries and lack history-dependent context. The authors propose AgentOPSD, which aggregates token-level teacher–student log-probability gaps into turn-level evidence and recursively updates a Bayesian belief state of eventual success in log-odds space. This approach redistributes the trajectory-level advantage without requiring extra rollouts or a learned critic, providing precise turn-level credit assignment grounded in history-dependent belief revision.

Method

The authors introduce AgentOPSD, a method that enriches the GRPO (Group Relative Policy Optimization) advantage with turn-level credit derived from a Bayesian evidence perspective. The overall pipeline augments the standard sequence-level reward signal by incorporating a self-distillation contrast that estimates how much each action turn supports eventual success, followed by a recursive belief update that accounts for the temporal context. The modified advantage is then fed into a PPO-style clipped objective.

The agent interacts over a K-turn episode, starting from task description xxx and initial observation o0o_0o0. At each turn kkk, the policy πθ\pi_\thetaπθ generates an action aka_kak token by token:

ak=(yk,1,,yk,Lk)πθ(sk),a_k = (y_{k,1}, \dots, y_{k,L_k}) \sim \pi_\theta(\cdot \mid s_k),ak=(yk,1,,yk,Lk)πθ(sk),

where sks_ksk is the interaction history before turn kkk. The episode τ\tauτ receives a binary outcome reward R(τ)R(\tau)R(τ). GRPO samples GGG trajectories for a task and computes a normalized sequence-level advantage for each trajectory iii:

Aseq(i)=R(i)Rˉσ^R+ϵ0,A_{\mathrm{seq}}^{(i)} = \frac{R^{(i)} - \bar{R}}{\widehat{\sigma}_R + \epsilon_0},Aseq(i)=σR+ϵ0R(i)Rˉ,

with Rˉ\bar{R}Rˉ and σ^R\widehat{\sigma}_RσR being the mean and standard deviation of rewards in the group. This scalar advantage is assigned uniformly to all tokens of the trajectory, leaving turn-level credit unresolved.

To decompose the outcome into per-turn importance, the authors propose a tractable hindsight approximation to the ideal Bayesian turn evidence. The ideal evidence would be the log Bayes factor between the success-conditional and failure-conditional likelihoods of aka_kak:

logp(aksk,C)p(aksk,¬C)=logp(Csk,ak)p(Csk),\log \frac{p(a_k \mid s_k, C)}{p(a_k \mid s_k, \neg C)} = \log \frac{p(C \mid s_k, a_k)}{p(C \mid s_k)},logp(aksk,¬C)p(aksk,C)=logp(Csk)p(Csk,ak),

where CCC denotes eventual success. Because these conditional distributions are unavailable, a self-distillation contrast is used. For each turn kkk, the policy is evaluated in two modes: the standard student branch with context hk,t=(sk,yk,<t)h_{k,t} = (s_k, y_{k,<t})hk,t=(sk,yk,<t), and a teacher branch conditioned on a retrieved skill description c+c^+c+ that summarizes useful subgoals and action patterns: hk,t+=(sk,c+,yk,<t)h_{k,t}^+ = (s_k, c^+, y_{k,<t})hk,t+=(sk,c+,yk,<t). The token-level likelihood contrast is

δk,t=logπθ(yk,thk,t+)logπθ(yk,thk,t).\delta_{k,t} = \log \pi_\theta(y_{k,t} \mid h_{k,t}^+) - \log \pi_\theta(y_{k,t} \mid h_{k,t}).δk,t=logπθ(yk,thk,t+)logπθ(yk,thk,t).

The turn-level evidence eke_kek is the sum over tokens:

ek=t=1Lkδk,t=logπθ(aksk,c+)πθ(aksk).e_k = \sum_{t=1}^{L_k} \delta_{k,t} = \log \frac{\pi_\theta(a_k \mid s_k, c^+)}{\pi_\theta(a_k \mid s_k)}.ek=t=1Lkδk,t=logπθ(aksk)πθ(aksk,c+).

This eke_kek approximates the Bayesian evidence; its sign indicates whether the action increases or decreases the belief in eventual success.

Raw per-turn evidence alone does not capture whether the action is pivotal or redundant given earlier turns. Hence, a decaying evidence accumulator is maintained. Starting from a clipped prior belief B0=clip(Rˉ,ϵ0,1ϵ0)B_0 = \operatorname{clip}(\bar{R}, \epsilon_0, 1-\epsilon_0)B0=clip(Rˉ,ϵ0,1ϵ0) (with Rˉ\bar{R}Rˉ being the group success rate), the log-odds are updated recursively:

c0=0,ck=γck1+ek,k=logit(B0)+ck,c_0 = 0,\quad c_k = \gamma c_{k-1} + e_k,\quad \ell_k = \operatorname{logit}(B_0) + c_k,c0=0,ck=γck1+ek,k=logit(B0)+ck,

where γ(0,1]\gamma \in (0,1]γ(0,1] is a decay factor that down-weights older turns, and Bk=σ(k)B_k = \sigma(\ell_k)Bk=σ(k). The importance of turn kkk is its marginal revision:

ΔBk=BkBk1=σ(k)σ(k1).\Delta B_k = B_k - B_{k-1} = \sigma(\ell_k) - \sigma(\ell_{k-1}).ΔBk=BkBk1=σ(k)σ(k1).

This revision is then aligned with the sequence-level outcome signal to obtain a signed credit:

qk=sign(Aseq)ΔBk.q_k = \operatorname{sign}(A_{\mathrm{seq}}) \, \Delta B_k.qk=sign(Aseq)ΔBk.

The magnitude ΔBk|\Delta B_k|∣ΔBk reflects how much the belief shifts, while the sign preserves the direction of the verifier’s outcome signal.

To prevent large swings and to make the credit relative within a trajectory, the raw qkq_kqk values are standardized inside each episode. A bounded multiplier is then applied:

μq(i)=1Kij=1Kiqj(i),σq(i)=1Kij=1Ki(qj(i)μq(i))2,zk(i)=qk(i)μq(i)σq(i)+ϵ0,wk(i)=clip ⁣(1+bzk(i),1b,1+b).\begin{aligned} \mu_q^{(i)} &= \frac{1}{K_i}\sum_{j=1}^{K_i} q_j^{(i)}, \quad \sigma_q^{(i)} = \sqrt{\frac{1}{K_i}\sum_{j=1}^{K_i} (q_j^{(i)} - \mu_q^{(i)})^2},\\[4pt] z_k^{(i)} &= \frac{q_k^{(i)} - \mu_q^{(i)}}{\sigma_q^{(i)} + \epsilon_0}, \quad w_k^{(i)} = \operatorname{clip}\!\Big(1 + b\,z_k^{(i)},\, 1-b,\, 1+b\Big). \end{aligned}μq(i)zk(i)=Ki1j=1Kiqj(i),σq(i)=Ki1j=1Ki(qj(i)μq(i))2,=σq(i)+ϵ0qk(i)μq(i),wk(i)=clip(1+bzk(i),1b,1+b).

The reshaped turn-level advantage is a convex combination of the original sequence-level advantage and the weighted version:

A~k(i)=Aseq(i)[(1λ)+λwk(i)],\widetilde{A}_k^{(i)} = A_{\mathrm{seq}}^{(i)} \big[ (1-\lambda) + \lambda\, w_k^{(i)} \big],Ak(i)=Aseq(i)[(1λ)+λwk(i)],

where b(0,1)b \in (0,1)b(0,1) controls the clipping range and λ[0,1]\lambda \in [0,1]λ[0,1] sets the strength of the reshaping. Every token in turn kkk inherits A~k(i)\widetilde{A}_k^{(i)}Ak(i).

The training objective is the standard PPO clipped loss, but with the reshaped advantage:

LAgentOPSD(θ)=1Gi=1G1tMi,ttMi,tmin ⁣(ri,tA~κi(t)(i),  clip(ri,t,1ε,1+ε)A~κi(t)(i))+βLKL,\mathcal{L}_{\text{AgentOPSD}}(\theta) = -\frac{1}{G} \sum_{i=1}^{G} \frac{1}{\sum_t M_{i,t}} \sum_t M_{i,t} \min\!\Big(r_{i,t} \widetilde{A}_{\kappa_i(t)}^{(i)},\; \operatorname{clip}(r_{i,t}, 1-\varepsilon, 1+\varepsilon) \widetilde{A}_{\kappa_i(t)}^{(i)}\Big) + \beta \mathcal{L}_{\mathrm{KL}},LAgentOPSD(θ)=G1i=1GtMi,t1tMi,tmin(ri,tAκi(t)(i),clip(ri,t,1ε,1+ε)Aκi(t)(i))+βLKL,

where ri,tr_{i,t}ri,t is the importance ratio against the rollout policy, κi(t)\kappa_i(t)κi(t) maps each token to its turn, Mi,tM_{i,t}Mi,t is a mask for valid response tokens, and the KL penalty term is added with coefficient β\betaβ. No separate distillation loss is required; the self-teacher evidence influences learning solely through the reshaped advantage.

Experiment

The evaluation spans ALFWorld, Search-QA, and WebShop environments with Qwen2.5-3B/7B models, comparing AgentOPSD against training-free, group-relative RL, and self-distillation baselines all under identical skill access. The main results show that gains stem from turn-level credit construction via belief revision rather than privileged skills, and the advantage grows with trajectory length, where uniform credit degrades faster. Mechanism ablations confirm that turn-level belief tracking, recursive state update, signed outcome alignment, and prior anchoring each contribute, and hyperparameter sweeps indicate the method is robust except to the credit reshaping weight. Overall, the approach localizes pivotal decisions in long-horizon tasks by accumulating a teacher-student gap into a belief state and assigning credit according to belief revision.

GRPO achieves the best overall performance across ALFWorld, Search-QA, and WebShop, outperforming skill‑augmented Skill‑GRPO and vanilla baselines. Removing skills at inference (OPSD) collapses on Search‑QA and WebShop, while the belief prior anchor and the reshaping weight λ are critical for stable credit assignment in long‑horizon tasks. GRPO consistently outperforms Skill‑GRPO, yielding higher success rates on ALFWorld, higher accuracy on Search‑QA, and a higher score on WebShop. Without skills at inference, OPSD fails on Search‑QA and WebShop, with near‑zero scores, but retains some ALFWorld capability. The empirical prior B0 is essential: removing it reduces the success rate to 78.9, indicating that anchoring stabilizes belief revision for long‑horizon tasks. Among hyperparameters, the reshaping weight λ is the most influential; reducing λ from 0.5 degrades performance, while evidence decay and policy clipping have little effect.

Removing any single component from AgentOPSD reduces the success rate from the full 89.1%, with the signed direction and state-prior anchor causing the largest drops. Turn-level tracking and recursive state revision provide smaller but consistent gains, confirming that each mechanism contributes to the method's performance. Dropping the state-prior anchor lowers success to 78.9%, the largest decline, showing its role in stabilizing early belief updates. Removing the signed direction and using only magnitude reduces success to 80.5%, indicating that outcome-aligned sign is critical. Replacing turn-level belief tracking with per-token accumulation reduces success to 85.9%, and replacing recursive revision with the raw local gap drops it to 82.8%.

GRPO consistently outperforms Skill-GRPO and vanilla baselines across ALFWorld, Search-QA, and WebShop, while removing skills at inference (OPSD) results in near-zero scores on Search-QA and WebShop, indicating that skill guidance and the belief prior anchor are crucial for stable credit assignment in long-horizon tasks. The empirical B0 anchor proves essential: dropping it reduces success to 78.9%, and the reshaping weight λ is the most influential hyperparameter, with reductions from 0.5 harming performance. Ablation of AgentOPSD confirms that the state-prior anchor and outcome-aligned signed direction cause the largest drops from the full 89.1% success rate, while turn-level tracking and recursive revision contribute smaller but consistent gains, validating the role of each mechanism.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp