PTGPO: Prefix Tree Group Policy Optimization

Ruolin Chen, Yang Li, Jihang Wang, Zhuoya Zhao, Yuchen Liu, Jiaming Xu, Qian ZhangarXiv 2026

TL;DR

PTGPO (Prefix Tree Group Policy Optimization) is a critic-free reinforcement learning method designed to train LLM agents for long-horizon tasks with sparse rewards. By building prefix trees over action sequences, it decomposes coarse trajectory-level rewards into fine-grained step-level credits, significantly outperforming existing group-based RL methods on benchmarks like ALFWorld and WebShop.

What Problem Does This Paper Address?

Training Large Language Model (LLM) agents to perform complex, multi-step tasks (like navigating a website or tidying a house) is notoriously difficult because of the credit assignment problem. In these environments, rewards are usually "sparse"—you only get a signal (success or failure) at the very end of a long sequence of actions.

Existing methods like GRPO (Group Relative Policy Optimization) assign the same "advantage" score to every single action in a successful trajectory. This is noisy; a lucky guess at step 40 shouldn't necessarily validate a mediocre decision at step 2. Newer methods like GiGPO try to group actions by the environment state, but they still struggle when two trajectories share the same state and action but diverge later. As shown in Figure 1, if two agents take the same action in the same state but one succeeds later due to a different subsequent choice, standard grouping methods might incorrectly penalize the first action.

Fig. 1. Comparison of state-group and prefix-tree credit assignment under the undiscounted setting (γ = 1). Identical actions may receive conflicting advantages when their subsequent actions lead to different returns. PTGPO recursively groups trajectory suffixes by action prefix, where node values denote empirical mean returns and edge labels denote child-parent mean differences. Colors indicate identical actions.

Methods

PTGPO introduces a "critic-free" way to get fine-grained signals without needing a separate value-function model. The core idea is the Prefix Tree:

  1. Anchor-State Grouping: The algorithm identifies "anchor states"—points in different trajectories where the agent encountered the same situation.
  2. Tree Construction: For each anchor-state group, it builds a tree where each node represents a sequence of actions (a prefix).
  3. Credit via Innovation: The "credit" for a specific action is calculated as the difference between the average return of the child node (prefix + new action) and its parent node (prefix only). This captures the "innovation"—how much our expected success improved specifically because of that one new action.
  4. Advantage Decomposition: The final learning signal for an action is the sum of its global episode-level reward and these local prefix-tree credits.

This process is illustrated in Figure 2, showing how credits are redistributed to the specific "branching decisions" that actually changed the outcome.

Fig. 2. Illustration of PTGPO advantage decomposition under the undiscounted setting (γ = 1). Episode-level advantages are shared by all actions in the same trajectory, while prefix-tree credits redistribute return residuals to branching decisions that change the conditional mean return. “End” marks the termination of a prefix decomposition.

Datasets

The researchers evaluated PTGPO on three diverse interactive benchmarks:

  • ALFWorld: A text-based embodied environment where agents must complete household tasks (e.g., "put a clean apple in the fridge") through multi-step interaction.
  • WebShop: A simulated e-commerce website where agents navigate menus and search bars to purchase specific items based on user instructions.
  • Sokoban: A classic visual grid-based puzzle game requiring long-term planning to push boxes onto target locations.

Key Insights and Ideas

  • Decisive Branching: The "aha moment" of the paper is that credit shouldn't be assigned based on the current state alone, but on where the trajectory branches. If two paths are identical for five steps and then diverge, the credit (or blame) belongs to the action at the branching point.
  • Carrying Variation Forward: In sparse environments, states often become unique very quickly. PTGPO allows unresolved return variations to be carried forward along a shared action prefix until a branching point is reached that statistically explains the difference in outcomes.
  • Computational Efficiency: Surprisingly, building these trees adds very little overhead. The authors found that prefix-tree construction accounts for only 0.812% of the total training cost, making it a highly practical "plug-and-play" upgrade for group-based RL.

Key Results

PTGPO consistently outperformed both prompting baselines and state-of-the-art RL methods like PPO, GRPO, and GiGPO.

  • ALFWorld: Using Qwen2.5-7B, PTGPO achieved a 96.0% success rate, compared to 77.6% for GRPO and 91.9% for GiGPO.
  • WebShop: PTGPO reached an 82.0% success rate, a significant jump over GRPO's 66.1%.
  • Training Efficiency: As seen in Figure 3(a), PTGPO reaches high success rates much faster than its competitors. For example, on ALFWorld, it hits an 80% success rate in roughly 75 steps, while GiGPO takes 105 and GRPO fails to reach it within the 160-step window.
Fig. 3. (a) Episode Success Rate during Training on ALFWorld. (b) Distribution of maximum expanded tree depth at epoch 160 on ALFWorld.

Limitations and Future Work

  • State Matching: The method relies on identifying "anchor states." While this works well in text-based or grid-based games, it might be more challenging in continuous control environments or tasks with highly high-dimensional observations where "identical" states are rare.
  • Sample Requirements: To expand a node in the prefix tree, you need a minimum number of samples ($\tau_{expand}$). In very complex tasks, it might take many rollouts before enough trajectories share a long enough prefix to provide reliable statistical signals.
  • Future Direction: The authors suggest that exploring more flexible ways to define "state similarity" could further improve the method's robustness in diverse environments.

Summary updated

BibTeX
@misc{chen2026ptgpo,
  author = {Ruolin Chen and Yang Li and Jihang Wang and Zhuoya Zhao and Yuchen Liu and Jiaming Xu and Qian Zhang},
  title = {{PTGPO: Prefix Tree Group Policy Optimization}},
  year = {2026},
  eprint = {2610.14737},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.14737},
}
Figure