Smoothed Prefix-Tree Advantages for Sparse-Reward Agents

Language-model agents that shop on websites, push boxes in puzzles, or chain tool calls usually get one number at the very end of an episode, such as success or failure. That makes it hard to tell which of dozens of actions mattered. Current fixes add a second model that scores each step, which costs memory and compute, or they require a known correct answer to check intermediate steps against. We propose a third route that needs no extra network. Sample each group of rollouts as a tree that branches at action boundaries. Estimate the value of every prefix as the average final outcome of the rollouts beneath it. Then smooth these noisy estimates along each path from the root, so that a deep prefix with only two or three descendants borrows strength from its ancestors in proportion to how little data it has. The smoothed differences between a prefix and its parent become step-level credit. Nothing is hand-written, no critic network or process reward model is trained, and the rollout budget is no larger than ordinary group sampling.

The scientific question behind the method is a live disagreement in the literature. One camp reports that binary outcome rewards are enough when the optimizer is careful (Exploring the Limit of Outcome Reward for Learning Mathematical Reasoning). Another reports that outcome-only training needs about 18x more data than step supervision (Process vs. Outcome Reward: Which is Better for Agentic RAG Reinforcement Learning). We test a specific hypothesis: much of that gap is estimation variance in step credit, not missing information. If so, a variance-controlled, network-free estimator should recover most of the benefit of an explicit step-reward model.

Core Claim

Group Relative Policy Optimization (GRPO) is a critic-free method that scores each sampled completion against the mean of its group. It already computes an implicit process reward. GRPO is Secretly a Process Reward Model proves that when completions share a prefix, the group advantage acts as a Monte Carlo estimate of that prefix's value. The paper also shows that prefix frequency biases the gradient, and it fixes this with inverse-frequency reweighting, which it calls λ-GRPO. Its estimates are left raw, though, and in flat sampling shared prefixes arise only by accident. We make prefix sharing deliberate through tree sampling, and we make the resulting value estimates low-variance through data-dependent smoothing over depth.

For a prefix node $s$ with $m(s)$ leaf rollouts beneath it, let $\hat V(s)$ be the mean final return of those leaves, including any step costs. Because each leaf is an on-policy sample, $\hat V(s)$ is unbiased. Its variance scales as $\sigma^2/m(s)$, where $\sigma^2$ is the outcome variance, so it becomes noisy deep in the tree where $m$ is small. We smooth from the root downward:

$$\tilde V(s) = \frac{m(s)\,\hat V(s) + \kappa\,\tilde V(\mathrm{parent}(s))}{m(s) + \kappa},$$

Here $\kappa \ge 0$ controls how strongly a node is pulled toward its parent. We set $\kappa$ by empirical Bayes as the ratio of within-node outcome variance to between-sibling value variance, measured on the current batch, rather than tuning it by hand. The segment of actions that leads from a parent $p$ into a child $c$ receives the step advantage $A(c) = \tilde V(c) - \tilde V(p)$. That advantage is added to the usual group-normalized outcome advantage with a fixed mixing weight.

Unrolling the recursion shows that $\tilde V(c)$ is a weighted average of the raw values at $c$ and at all of its ancestors. The weights decay geometrically with depth, each factor being $\kappa/(m+\kappa)$ at that level. This is a compound estimator over horizons of the kind analyzed in Averaging n-step Returns Reduces Variance in Reinforcement Learning. That paper proves that weighted averages of imperfectly correlated multi-step estimates have lower variance than any single one at matched learning speed. Our estimator differs in two ways. The weights are set by sample counts rather than a fixed λ, and the averaged estimates come from a tree of rollouts rather than a learned critic.

The price of smoothing is a bias that pulls step advantages toward zero. This bias is conservative in direction: with little evidence, a step gets roughly outcome-level credit and no confident step-level push. It is also indifferent to the sign of the reward. That matters because the long N-step surrogate reward of A Long N-step Surrogate Stage Reward for Deep Reinforcement Learning also spreads sparse terminal reward backward, but it assumes nonnegative rewards and a fixed 100-step window. Agent tasks routinely violate both assumptions, since tool failures carry negative rewards and episodes are short and variable in length.

Research Program

The build has three parts.

The first is a tree sampler for multi-turn agents. For each prompt it draws $B$ root rollouts. At a small number of step depths it re-branches from stored prefixes. In WebShop (WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agents) and VisualSokoban, branching is done by deterministically replaying the action prefix. In dialogue, the prefix is simply the conversation history. Shared prefixes are generated once, so a tree yields more leaves per generated token than flat sampling. We report that saving rather than assume it.

The second is the smoothing estimator above, together with an analysis of its mean squared error. We compare it to the raw tree estimator ($\kappa=0$) and to fixed-$\kappa$ variants. The expected result is the standard shrinkage one: smoothing wins when between-sibling differences are small relative to $\sigma^2/m$, and it approaches the raw estimator as $m$ grows.

The third is a variance diagnostic for the outcome-versus-process debate. On held-out prompts we build high-budget reference trees with many leaves per node. We then measure how far each method's step advantages fall from the reference, for flat GRPO, λ-GRPO, raw tree, smoothed tree, and the learned step rewards of iStar. Finally, we relate that error to final task performance as the horizon grows. The horizon is varied through puzzle difficulty in Sokoban and through the step budget in WebShop.

This proposal deliberately does not try to solve reward specification in general. It addresses the narrower manual-engineering burden flagged in Adaptive Reward Design for Reinforcement Learning: replacing dense hand-written rewards with sparse specifications pushes the difficulty back onto credit assignment. Our aim is to make sparse specifications workable without adding milestones by hand. The method does not apply where prefixes cannot be replayed, such as stochastic physical environments, and we state that limit up front.

Baselines

The naive reference point is flat GRPO with outcome reward only, using the same policy model, prompts, and total number of generated tokens per update. This is the configuration the process-reward literature says fails. It tells us how much any step credit helps at all.

The strongest existing competitor is iStar (Agentic Reinforcement Learning with Implicit Step Rewards). iStar trains an implicit process reward model by multi-turn preference optimization on ranked rollouts and combines its step scores with outcome advantages. It targets the same setting, credit assignment for multi-turn agents without step labels, on the same benchmarks. It reports an 86.5% success rate on WebShop against 84.1% for the GiGPO baseline. It also reports 91.7% success on VisualSokoban against 86.3% for standard RLOO, a leave-one-out group baseline, and a 2x reduction in training steps to reach baseline score. We will rerun iStar in our own harness with the same base policy, prompt set, and total generated-token budget per update, plus the same hyperparameter search budget for both methods. Its extra model's forward and backward passes are counted against wall-clock time and peak GPU memory, not hidden.

Beating iStar means two things. First, matching or exceeding its success rate in our rerun, and comparing against its reported 86.5% and 91.7% when setups align. Second, doing so with one resident trainable model instead of two, at equal or lower wall-clock time. If we match accuracy but only save memory, we will report exactly that and nothing more.

λ-GRPO is the closest estimator-level competitor, and we run it under the same budget. Its paper reports that it beat standard GRPO in 15 of 20 math configurations and reached peak validation accuracy in less than half the training steps. Running it isolates whether deliberate tree structure adds anything beyond reweighting the prefixes that happen to be shared.

Two ablations isolate the key ingredient. The raw tree estimator ($\kappa=0$) separates the effect of smoothing from the effect of tree sampling. A fixed-$\kappa$ sweep separates data-dependent weights from a constant, λ-like weight.

A PPO baseline with a learned value network and generalized advantage estimation stands in for the "just train a critic" position. It is charged for the critic's memory.

Why not just…?

Why not just enlarge the flat group until the variance goes away? This is the most serious threat. Larger groups reduce the noise of outcome advantages, but they never create counterfactuals for individual intermediate steps: every step in a trajectory still receives the same credit. Our compute-matched comparison therefore spends the tree's token budget on a bigger flat group instead. If the bigger flat group matches us on success rate at long horizons, the variance-artifact hypothesis is confirmed. The benefit of our specific method would then be refuted, and we would report that outcome.

Why not just train a critic, as in PPO with generalized advantage estimation? A critic gives step credit, and generalized advantage estimation is itself the λ-return smoothing studied in Averaging n-step Returns Reduces Variance in Reinforcement Learning. The costs are one more large model in memory and a learned, biased value estimate under non-stationary targets. These are the costs critic-free methods were designed to avoid, as described in Why Reinforcement Learning for Large Models Is Computationally Expensive. The PPO baseline measures directly whether that price buys accuracy.

Why not just use iStar, or another explicit step-reward model? iStar is strong and currently holds the best numbers on our benchmarks. However, it trains and hosts a second model, and its learned step scores can themselves be exploited by the policy. Explicit process reward models built from tree search, such as Process vs. Outcome Reward: Which is Better for Agentic RAG Reinforcement Learning and Enhancing Decision-Making for LLM Agents via Step-Level Q-Value Models, move heavy search cost upstream. If iStar clearly beats smoothed tree advantages at equal wall-clock time, the right conclusion is that learned generalization across prompts matters more than per-batch variance control. We would say so.

Why not just use raw tree values without smoothing? If trees branch widely enough, raw node values may already be precise, and smoothing would add only bias. The $\kappa=0$ ablation, combined with the reference-tree error measurements, settles this. We expect smoothing to matter mainly at deep nodes and on hard, long-horizon puzzles. If it does not, the contribution reduces to tree sampling alone.

Why not just fine-tune on successful rollouts? Rejection-sampling fine-tuning ignores failures. The ablations of Exploring the Limit of Outcome Reward for Learning Mathematical Reasoning report that dropping negative samples hurts. WebShop imitation-plus-RL agents reached only 29.1% success against 59.6% for humans. We include rejection-sampling fine-tuning at matched samples as a floor.

Proposed Experiments

The main experiments are on WebShop, measuring success rate and average score, and on VisualSokoban, measuring success rate at graded difficulty. Both use the base model scale of the iStar setup and the prompt splits described there. A secondary run on MATH-500 and AIME24 uses reasoning segments as steps, which connects the results to the λ-GRPO and VPS findings (GRPO-VPS: Enhancing Group Relative Policy Optimization with Verifiable Process Supervision for Effective Reasoning). We cite VPS for context but do not treat it as a baseline, because it needs known answers. Every run reports success, tokens generated per update, peak GPU memory, and wall-clock time, over at least three seeds.

Three checks decide the proposal. First, on reference trees, the smoothed estimator must have lower step-advantage error than both the raw tree and λ-GRPO, and the margin should grow with depth. If it does not, the mechanism is wrong. Second, under matched tokens, smoothed tree advantages must beat the enlarged flat group on the longest-horizon Sokoban and WebShop settings. If they do not, the outcome-versus-process gap is a sample-count effect, and structured credit adds nothing. Third, the method must reach iStar-level success in our harness without a second model. If it falls short but closes most of the gap from flat GRPO to iStar, that still answers the scientific question: much of what process reward models provide is variance reduction that the rollouts themselves can supply.