Solving the Granularity Mismatch: Hierarchical Preference Learning for Long-Horizon LLM Agents

Heyang Gao, Zexu Sun, Erxue Min, Hengyi Cai, Shuaiqiang Wang, Dawei Yin, Xu Chen

TL;DR

Direct Preference Optimization (DPO) for Large Language Model (LLM) agents often struggles because feedback is either too broad (evaluating entire trajectories) or too narrow (evaluating single steps). Hierarchical Preference Learning (HPL) solves this "granularity mismatch" by training agents on semantically coherent "action groups." By pairing this with a dual-layer curriculum, HPL guides the model from simple sub-tasks to complex, long-horizon planning, achieving state-of-the-art performance across multiple agent benchmarks.

What Problem Does This Paper Address?

LLMs are rapidly evolving from simple chatbots into autonomous agents capable of solving multi-step tasks, such as navigating a simulated house or managing a database. To align these agents with human goals, researchers frequently rely on Direct Preference Optimization (DPO), a technique that teaches the model to prefer "good" sequences of actions over "bad" ones.

However, the authors identify a fundamental granularity mismatch in current DPO approaches:

  1. Trajectory-level DPO compares entire successful paths against failed ones. While this provides stable, global signals, it is "blurry"—it fails to tell the agent which specific mistake caused a long sequence to fail.
  2. Step-level DPO evaluates individual actions. While precise, it is incredibly noisy and data-inefficient. For example, if an agent needs to "retrieve an apple from the fridge," the value of simply "opening the door" only makes sense in the context of the actions that follow. Rewarding single steps often misses the forest for the trees.
Comparison of Trajectory, Step, and Group-level DPO

Methods

To balance this trade-off, the authors introduce Hierarchical Preference Learning (HPL), a framework that operates across three synergistic levels: trajectory, step, and a novel intermediate action-group level.

The Hierarchical Preference Learning (HPL) Pipeline

The HPL process follows a two-stage pipeline:

  1. Hierarchical Data Generation: The team uses a reference policy to generate trajectories and then segments them into Action Groups. They tested several segmentation strategies, including simple heuristics (fixed length), uncertainty-based cuts, and Semantic Segmentation. The semantic approach uses a teacher LLM (like GPT-4o) to identify logical sub-tasks, such as "find the object" or "clean the item." For each "winning" group from an expert trajectory, they generate a "losing" suboptimal group to create preference pairs.

  2. Dual-Layer Curriculum Learning: Instead of training on all data at once, HPL employs a 2D curriculum matrix. Training progresses along two axes: Sub-task Complexity (group length) and Sample Difficulty (the reward gap between the good and bad groups). The agent starts with short, easily distinguishable tasks and gradually scales up to long, nuanced sequences.

Datasets

The researchers evaluated HPL on three diverse, long-horizon benchmarks:

  • ALFWorld: An embodied AI simulator where agents perform household tasks (e.g., "put a clean apple in the fridge").
  • WebShop: A web-based environment where agents must navigate an e-commerce site to find and purchase specific products.
  • InterCode-SQL: A coding benchmark where agents interact with a live SQL database to answer complex data queries.

Key Insights and Ideas

  • The "Middle Ground" is the Sweet Spot: The most important finding is that group-level feedback is the primary driver of performance. It provides a "structural prior," focusing the model on reusable skills (like "opening a container") rather than just raw tokens or end-to-end success.
  • Semantics Matter: While even random or fixed-length grouping helps, Semantic Segmentation—where the model understands the goal of a sub-sequence—yields the strongest results. This suggests that aligning agent training with human-logical sub-tasks is highly effective.
  • Curriculum is Not Optional: Ablation studies showed that without the dual-layer curriculum, the model's performance drops significantly. Starting with foundational skills prevents the model from being overwhelmed by the noise of complex, failed trajectories early in training.

Key Results

HPL significantly outperformed existing state-of-the-art methods like ETO (trajectory-level) and IPR (step-level) across all benchmarks:

  • Superior Accuracy: On the Qwen2.5-7B-Instruct model, HPL (Semantic) achieved an average score of 67.28, surpassing the strongest baselines by roughly 3.5 to 3.8 points.
  • Generalization: HPL showed remarkable gains in "unseen" scenarios in ALFWorld, achieving a mean success rate of 84.08%—nearly 6 points higher than the previous best method.
  • Efficiency: By aggregating actions into groups, HPL reduces the variance of reward estimates compared to per-step Monte Carlo rollouts, making it much more data-efficient under limited compute budgets.

Limitations and Future Work

The authors acknowledge a few hurdles in the current framework:

  • Teacher Dependency: The best-performing version of HPL relies on a powerful teacher model (like GPT-4o) to perform semantic segmentation. This adds computational cost and introduces potential bias from the teacher.
  • Hyperparameters: The curriculum requires careful tuning of thresholds for "short" vs. "long" tasks and "easy" vs. "hard" samples, which may vary significantly by domain.
  • Future Directions: The team suggests exploring self-supervised segmentation, where the agent learns to identify its own sub-task boundaries dynamically without needing an external LLM to define them.

Summary updated

BibTeX
@inproceedings{gao2026solving,
  author = {Heyang Gao and Zexu Sun and Erxue Min and Hengyi Cai and Shuaiqiang Wang and Dawei Yin and Xu Chen},
  title = {{Solving the Granularity Mismatch: Hierarchical Preference Learning for Long-Horizon LLM Agents}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=s8usvGHYlk},
}
Figure