TL;DR
Hierarchy-of-Groups Policy Optimization (HGPO) is a novel reinforcement learning algorithm that significantly improves how Large Language Model (LLM) agents learn long-horizon tasks. By organizing rollout steps into a hierarchy based on their historical context, HGPO eliminates the biased advantage estimations found in current methods. This approach leads to state-of-the-art performance on complex agentic benchmarks without requiring extra computational resources.
The Challenge: Context Inconsistency in Long-Horizon Tasks
Training LLM agents to perform multi-step tasks—like navigating a website or cleaning a house—usually relies on Reinforcement Learning (RL). Recently, "group-based" RL methods like GRPO (Group Relative Policy Optimization) have become popular because they do not require a separate "critic" model, making them highly memory-efficient.
However, when applying these methods to long-horizon tasks, researchers face a dilemma:
- Trajectory-wise optimization (evaluating the whole sequence at once) leads to "context explosion," where the text input becomes too long for the model to handle efficiently.
- Stepwise optimization (treating each step independently) is more scalable but suffers from a critical flaw: Context Inconsistency.
Context inconsistency occurs when the RL algorithm groups together steps that share the same current state but have entirely different histories. For example, if two agents are in the same room, but one just arrived and the other has been searching for ten minutes, their "relative advantage" should not be calculated against each other. Doing so introduces significant bias, which severely degrades the agent's learning.
Introducing Hierarchy-of-Groups Policy Optimization (HGPO)
To bridge the gap between biased stepwise updates and high-variance trajectory updates, the authors propose Hierarchy-of-Groups Policy Optimization (HGPO).
HGPO tackles the problem through two main mechanisms:
- Context-aware Hierarchical Grouping: Instead of placing all steps into one large group, HGPO creates a hierarchy of groups based on historical overlap.
- Level 0: Steps sharing only the same current state.
- Level $k$: Steps sharing the same current state and the exact same last $k$ steps of history.
- Adaptive Weighting: The algorithm calculates a relative advantage for a step at every level of this hierarchy. It then aggregates these advantages using an adaptive weighting scheme.
Higher-level groups (more shared history) provide highly accurate, low-bias comparisons but contain fewer samples, leading to higher variance. Lower-level groups have abundant samples but higher bias. HGPO adaptively balances this bias-variance trade-off. Crucially, this entire process is "critic-free" and relies on simple hashmap lookups of existing rollout data, adding virtually zero computational overhead (less than 0.001% of total execution time).
Experimental Setup
The researchers evaluated HGPO on two primary agentic benchmarks using the Qwen2.5-1.5B-Instruct and Qwen2.5-7B-Instruct models:
- ALFWorld: A synthetic environment where agents must perceive and act in simulated households to complete multi-step physical tasks (e.g., "put a clean sponge in the cabinet").
- WebShop: A complex, web-based environment where agents navigate a simulated e-commerce site with 1.1 million products to find and purchase items based on specific user instructions.
Key Insights and Results
HGPO consistently outperformed existing methods like PPO, RLOO, and GRPO across all tests.
- State-of-the-Art Performance: On ALFWorld in-distribution tasks, HGPO (with Qwen2.5-7B) achieved a remarkable 95.96% success rate, outperforming the previous best hierarchical method (GiGPO) and drastically beating standard prompting methods like ReAct (31.2%). On WebShop, HGPO improved task success rates by roughly 4-5% over GiGPO across different model sizes and context lengths.
- Stronger Generalization: HGPO demonstrated superior performance on out-of-distribution tasks, suggesting that more accurate advantage estimation helps the model learn robust, generalizable logic rather than just memorizing specific successful paths.
- The Scarcity of "Oracle" Steps: The authors found that "Oracle" steps—where agents share the exact same prompt and full history—are exceedingly rare in long-horizon rollouts. Relying solely on these makes training unstable due to small sample sizes, highlighting the necessity of HGPO's hierarchical approach.
- Outsized Impact on Smaller Models: Interestingly, HGPO provides larger performance gains for smaller models (1.5B). Smaller models tend to generate more redundant or "noisy" steps; HGPO’s hierarchical structure is particularly effective at filtering this noise to provide a cleaner learning signal.
Limitations and Future Work
While highly effective, HGPO currently relies on "raw" history (exact state/action strings) to define its groups. Many advanced agents use summarized or compressed memory modules. Extending hierarchical grouping to these "fuzzy" or summarized contexts remains a non-trivial challenge for future work. Additionally, while the current weighting scheme adapts based on context depth, future iterations could potentially use the statistical uncertainty of the advantage estimate to weight the hierarchy even more effectively.
Summary updated