Multiscale Policy Optimization for Long-Horizon LLM Agents

Summary (Overview)

  • Core Problem: Long-horizon LLM agents interact with environments through complete assistant turns (e.g., search queries, tool calls) while generating each action token-by-token. Existing RL methods either use group-relative rewards that ignore turn/token distinctions (GRPO, DAPO, GSPO) or token-level critics that don't explicitly separate within-turn generation from turn-level interaction (PPO, VAPO, SAO).

  • Key Observation: Critic values vary primarily across turns rather than within turns—between-turn variance accounts for a median of 89.5% of the critic's token-weighted within-trajectory value variance across 2,048 trajectories and 16,323 turns.

  • Main Contribution: Proposes Multiscale Policy Optimization (MPO), combining Multiscale Advantage Estimation (MAE) with turn-level importance sampling to align credit assignment and policy updates at the turn scale while preserving token-specific credit.

  • Theoretical Foundation: Derives a turn-level policy improvement bound (Theorem 1) and shows token-level surrogates incur an additional within-turn distribution-shift penalty under the same KL constraints (Theorem 2).

  • Results: Consistent performance gains over strong RL baselines (GRPO, GSPO, PPO, VAPO, SAO) across search, tool-use, and automation tasks with both 4B and 30B-A3B models, achieving the highest scores on all nine metrics at both model scales.

Introduction and Theoretical Foundation

Background and Motivation

LLM agents solve tasks by alternating between assistant outputs (turns) and environment observations. Each turn is generated token-by-token autoregressively. Learning from a terminal task reward involves two scale choices:

  1. Credit assignment: Connecting final outcomes to interactions across the trajectory while distinguishing tokens within each interaction
  2. Policy updates: Accounting for changes in complete-output probabilities while retaining local token distinctions

Formal Setup

The interaction trajectory is defined as:

τ=(o0,a0,o1,a1,…,oT,aT).(1)\tau = (o_0, a_0, o_1, a_1, \ldots, o_T, a_T).\tag{1}

where o0o_0 is the task prompt, ata_t is an assistant output, and ot+1o_{t+1} is environment feedback. The policy factorizes autoregressively:

πθ(at∣ht)=∏i=1Ltπθ(at,i∣ht,i).(5)\pi_\theta(a_t \mid h_t) = \prod_{i=1}^{L_t} \pi_\theta(a_{t,i} \mid h_{t,i}).\tag{5}

The agent receives a single terminal reward R(τ)R(\tau) with no intermediate rewards:

rt,i:={R(τ),t=T,i=LT,0,otherwise.(4)r_{t,i} := \begin{cases} R(\tau), & t = T, i = L_T, \\ 0, & \text{otherwise}. \end{cases}\tag{4}

Key Theoretical Results

Lemma 1 (Objective consistency): Under lossless token refinement, identical reward/stopping rules, and γ=1\gamma = 1, the macro and token descriptions have the same task return, with:

∇θlog⁡πθ(at∣ht)=∑i=1Lt∇θlog⁡πθ(at,i∣ht,i).(7)\nabla_\theta \log \pi_\theta(a_t \mid h_t) = \sum_{i=1}^{L_t} \nabla_\theta \log \pi_\theta(a_{t,i} \mid h_{t,i}).\tag{7}

Theorem 1 (Monotonic improvement at turn scale): With αM=sup⁡t,hDTV(π′(⋅∣h),π(⋅∣h))\alpha_M = \sup_{t,h} D_{TV}(\pi'(\cdot|h), \pi(\cdot|h)):

J(π′)−J(π)≥SM−2Amax⁡T(T+1)αM2.(10)\mathcal{J}(\pi') - \mathcal{J}(\pi) \geq \mathcal{S}_M - 2A_{\max}T(T+1)\alpha_M^2.\tag{10}

Theorem 2 (Additional cost of token surrogates): The difference between macro and token surrogates is bounded by:

∣SM−ST∣≤2(T+1)Amax⁡tokLmax⁡(Lmax⁡−1)αT2.(11)|\mathcal{S}_M - \mathcal{S}_T| \leq 2(T+1)A_{\max}^{\text{tok}}L_{\max}(L_{\max}-1)\alpha_T^2.\tag{11}

Takeaway: Under the same KL constraints, token-surrogate improvement bounds incur an additional within-turn distribution-shift penalty relative to turn-surrogate bounds.

Methodology

Multiscale Advantage Estimation (MAE)

MAE operates in two stages, both reusing the critic Vt,i=V(ht,i)V_{t,i} = V(h_{t,i}):

Stage 1: Turn-Level Credit Propagation

Summing TD residuals within a turn cancels internal value predictions:

δtturn=∑i=1Ltδt,i=1{t=T}R(τ)+Vt+1,1−Vt,1.(16)\delta_t^{\text{turn}} = \sum_{i=1}^{L_t} \delta_{t,i} = \mathbf{1}\{t=T\}R(\tau) + V_{t+1,1} - V_{t,1}.\tag{16}

Applying GAE on the macro time axis:

Atturn=δtturn+λAt+1turn=∑ℓ=0T−tλℓδt+ℓturn.(17)A_t^{\text{turn}} = \delta_t^{\text{turn}} + \lambda A_{t+1}^{\text{turn}} = \sum_{\ell=0}^{T-t} \lambda^\ell \delta_{t+\ell}^{\text{turn}}.\tag{17}

Stage 2: Within-Turn Credit Allocation

A local trace restricted to the current turn:

At,iintra=∑j=iLtλintraj−iδt,j.(18)A_{t,i}^{\text{intra}} = \sum_{j=i}^{L_t} \lambda_{\text{intra}}^{j-i} \delta_{t,j}.\tag{18}

The final allocation solves a constrained least-squares projection:

AtMAE=argmin⁡w∈RLt12∥w−βAtintra∥22,s.t.1Lt∑i=1Ltwi=Atturn,(19)\mathbf{A}_t^{\text{MAE}} = \underset{\mathbf{w} \in \mathbb{R}^{L_t}}{\operatorname{argmin}} \frac{1}{2}\|\mathbf{w} - \beta\mathbf{A}_t^{\text{intra}}\|_2^2, \quad \text{s.t.} \quad \frac{1}{L_t}\sum_{i=1}^{L_t} w_i = A_t^{\text{turn}},\tag{19}

yielding the closed-form solution:

At,iMAE=Atturn+β(At,iintra−A‾tintra).(20)\boxed{A_{t,i}^{\text{MAE}} = A_t^{\text{turn}} + \beta\left(A_{t,i}^{\text{intra}} - \overline{A}_t^{\text{intra}}\right).}\tag{20}

Turn-Level Importance Correction

The token and complete-turn importance ratios are:

ρt,i(θ)=πθ(at,i∣ht,i)π(at,i∣ht,i),ρt(θ)=∏i=1Ltρt,i(θ).(22)\rho_{t,i}(\theta) = \frac{\pi_\theta(a_{t,i} \mid h_{t,i})}{\pi(a_{t,i} \mid h_{t,i})}, \qquad \rho_t(\theta) = \prod_{i=1}^{L_t} \rho_{t,i}(\theta).\tag{22}

To retain token-specific credit under complete-turn weighting, a stop-gradient construction is used:

ρ~t,i(θ)=ρt,i(θ)sg⁡[∏j≠iρt,j(θ)],(23)\tilde{\rho}_{t,i}(\theta) = \rho_{t,i}(\theta)\operatorname{sg}\left[\prod_{j \neq i} \rho_{t,j}(\theta)\right],\tag{23}

with the gradient property:

∇θρ~t,i(θ)=ρt(θ)∇θlog⁡πθ(at,i∣ht,i).(24)\nabla_\theta \tilde{\rho}_{t,i}(\theta) = \rho_t(\theta) \nabla_\theta \log \pi_\theta(a_{t,i} \mid h_{t,i}).\tag{24}

The final MPO update uses a clipped surrogate:

LMPO(θ)=E^t,i[min⁡(ρ~t,i(θ)A^t,iMAE,clip⁡(ρ~t,i(θ),1−ϵ,1+ϵ)A^t,iMAE)].(25)\mathcal{L}_{\text{MPO}}(\theta) = \hat{\mathbb{E}}_{t,i}\left[\min\left(\tilde{\rho}_{t,i}(\theta)\hat{A}_{t,i}^{\text{MAE}}, \operatorname{clip}(\tilde{\rho}_{t,i}(\theta), 1-\epsilon, 1+\epsilon)\hat{A}_{t,i}^{\text{MAE}}\right)\right].\tag{25}

Empirical Validation / Results

Experimental Setup

  • Models: Qwen3-4B-Thinking and Qwen3-30B-A3B-Instruct
  • Tasks: Search (BrowseComp-Plus, GAIA, HLE), Claw-Eval, Automation Bench
  • Baselines: GRPO, GSPO, PPO, VAPO, SAO, and MPO w/ token IS (ablation)

Main Results (Table 1)

Qwen3-4B-Thinking:

MethodBrowseComp-Plus pass@1GAIA pass@1HLE pass@1Claw-Eval pass@3Automation Bench pass@1
Base8.8424.925.5325.220.00
GRPO39.3433.928.5164.454.33
PPO40.8531.717.2263.2511.67
VAPO43.2333.917.5464.3511.50
SAO43.7535.628.1964.5212.06
MPO (Ours)48.0839.479.9266.9113.33

Qwen3-30B-A3B-Instruct:

MethodBrowseComp-Plus pass@1GAIA pass@1HLE pass@1Claw-Eval pass@3Automation Bench pass@1
Base21.6925.247.4732.190.17
GRPO41.8331.038.3368.235.00
PPO45.2035.708.3170.1414.17
VAPO46.7338.339.2571.3113.77
SAO45.3639.629.9172.7214.20
MPO (Ours)50.3243.4210.0373.2215.00

Ablation Studies

Turn-scale propagation (λ\lambda): Optimal at λ=0.80\lambda = 0.80; increasing to 0.85 or decreasing to 0.60 both hurt performance.

Within-turn trace (λintra\lambda_{\text{intra}}): Optimal at λintra=0.95\lambda_{\text{intra}} = 0.95; both 0.90 and 1.00 reduce all scores.

Local refinement strength (β\beta):

β\betaBrowseComp-Plus pass@1GAIA pass@1HLE pass@1
0.041.8034.207.88
0.544.1337.248.26
1.048.0839.479.92
1.546.2338.268.93
2.045.1437.058.11

Test-Time Scaling

MPO maintains advantages at larger sampling budgets (pass@k for k ∈ {1, 2, 4, 8, 16, 32}). On 4B, MPO's pass@32 reaches 75.90 on BrowseComp-Plus, 69.90 on GAIA, and 34.00 on HLE, exceeding the stronger of GRPO and PPO by 3.61, 5.82, and 5.80 points respectively.

Theoretical and Practical Implications

Theoretical Contributions

  1. Turn-level improvement bound: Establishes that macro-action surrogates with complete-turn importance ratios provide valid monotonic improvement guarantees for LLM agents.

  2. Token surrogate penalty: Identifies that token-level surrogates incur an additional within-turn distribution-shift penalty of 2(T+1)Amax⁡tokLmax⁡(Lmax⁡−1)αT22(T+1)A_{\max}^{\text{tok}}L_{\max}(L_{\max}-1)\alpha_T^2 under the same KL constraints.

  3. Multiscale credit structure: Demonstrates empirically that critic values are primarily structured at turn boundaries (89.5% of variance between turns), motivating the turn-anchored approach.

Practical Implications

  1. Distinct credit horizons: Interaction and generation require different decay rates—λ\lambda decays per interaction while λintra\lambda_{\text{intra}} decays per token, with optimal values of 0.80 and 0.95 respectively.

  2. Mean-preserving allocation: The centered local correction preserves turn-level credit while refining token distinctions, balancing long-range credit propagation with fine-grained allocation.

  3. Stop-gradient importance weighting: Enables complete-turn probability correction while retaining token-specific gradients, aligning credit assignment with the actual interaction objective.

Conclusion

MPO organizes LLM-agent policy optimization across two scales: complete turns (macro actions) and tokens (generation steps). The MAE component combines cross-turn credit propagation with mean-preserving local allocation, while the update aligns complete-turn importance correction with token-specific gradients. Key findings include:

  • Turn-level credit propagation with moderate local refinement (β=1.0\beta = 1.0) provides the best performance
  • Distinct decay rates for interactions (λ=0.80\lambda = 0.80) and tokens (λintra=0.95\lambda_{\text{intra}} = 0.95) are essential
  • Turn-level importance weighting outperforms token-level weighting, confirming the theoretical analysis
  • Benefits persist under increased sampling (pass@k scaling)

Future directions suggested by this work include exploring adaptive multiscale coefficients, extending the framework to asynchronous training settings, and investigating whether the turn-token distinction generalizes to other hierarchical action structures in agentic systems.

Related papers