Introduction
Large Language Model (LLM) agents have demonstrated remarkable capabilities in following instructions and solving reasoning tasks. However, their performance often degrades significantly when faced with long-horizon tasks—those requiring dozens of sequential steps. HiAgent addresses this by introducing a hierarchical working memory management framework that mimics human cognitive "chunking," effectively doubling the success rate on complex benchmarks.
The Challenge: Context Distraction in Long-Horizon Tasks
The standard approach for LLM agents involves maintaining a "flat" working memory, where every action taken and every observation received is appended to the context window. In tasks requiring 30 or more steps, this leads to a massive, redundant prompt. This "noise" causes context distraction, where the agent loses track of high-level goals and begins generating non-executable or repetitive actions. Eventually, the "signal" of the strategic goal is drowned out by the "noise" of past details.
The HiAgent Framework
HiAgent draws inspiration from human cognitive science, specifically the concept of chunking information into manageable units. Instead of a linear log, HiAgent organizes memory into a hierarchy of subgoals.
The framework operates through four primary mechanisms:
- Subgoal Formulation: Before acting, the LLM generates a high-level subgoal (e.g., "clear blocks on blue block").
- Memory Chunking: Detailed action-observation logs are maintained only for the current active subgoal.
- Observation Summarization: Once a subgoal is achieved, HiAgent prompts the LLM to summarize that entire "chunk" into a concise statement. The detailed logs for that chunk are then removed from the active context and replaced by the summary.
- Trajectory Retrieval: If the agent encounters an error or needs specific details from the past, it can proactively trigger a retrieval module to "recall" the full details of a previous subgoal chunk.
This keeps the "working memory" lean, focusing only on the current subgoal's details and the high-level summaries of past progress, effectively denoising the agent's history.
Experimental Evaluation
The researchers evaluated HiAgent using five long-horizon tasks from the AgentBoard benchmark, which typically require more than 20 steps to complete:
- Blocksworld: Robotic manipulation to reach a target configuration.
- Gripper: Moving objects between different rooms.
- Tyreworld: A complex simulation of changing a car tire involving tools and jacks.
- Barman: A bartender simulation involving mixing and pouring cocktails.
- Jericho: A suite of text-based adventure games.
Key Results and Insights
HiAgent significantly outperformed the standard "flat" memory approach across the board:
- Success Rate: Achieved a 2x increase in average success rate (42% vs. 21%). In the "Tyreworld" task, the success rate jumped from 10% to 60%.
- Efficiency: Reduced the average number of steps to complete a task by 3.8.
- Computational Savings: Reduced the context length (token count) by 35% and total run time by 19%.
- Maintaining Executability: One of the most striking findings is that HiAgent maintains an executability rate of over 80% even in late-stage steps, whereas standard agents' ability to generate valid actions plummets as tasks get longer.
Conclusion
By treating subgoals as memory chunks and utilizing summarization as a denoising filter, HiAgent effectively bypasses the architectural "lost in the middle" weakness of LLMs. This hierarchical approach not only improves performance but also makes long-horizon agent execution more computationally efficient. Future work will explore scaling this to even longer horizons and integrating more sophisticated vector-based retrieval systems for messy, real-world environments.
Summary updated