Abstract
Large Language Model (LLM) agents often struggle to navigate complex, specialized environments using standard prompting or few-shot demonstrations. This paper introduces AutoGuide, a framework that automatically extracts concise, natural language "rules of thumb" from an agent's past successes and failures. By shifting from raw trajectory demonstrations to context-specific guidelines, AutoGuide significantly improves agent performance and efficiency. Evaluated across diverse benchmarks including ALFWorld, WebShop, and WebArena, AutoGuide demonstrates substantial gains in success rates, particularly in long-horizon tasks and real-world multi-modal web navigation.
Introduction
While Large Language Models (LLMs) exhibit impressive general reasoning capabilities, their performance often degrades when deployed in unfamiliar or highly specialized domains, such as navigating specific subreddits or managing complex GitHub repositories. The standard approach to mitigate this is In-Context Learning (ICL), where agents are provided with a few demonstrations of successful task completion.
However, ICL faces three primary bottlenecks:
- Context Limits: Long trajectories quickly exhaust the model's context window.
- Information Overload: Irrelevant details within a demonstration can distract the agent from the core logic.
- Reasoning Complexity: It is difficult for an LLM to autonomously identify the critical "pivot points" within a 20-step successful trajectory.
AutoGuide addresses these gaps by distilling raw experience into actionable, human-readable guidelines that provide agents with "just-in-time" advice tailored to their immediate state.
Methodology
AutoGuide operates through a two-phase process: an offline knowledge extraction phase and an online context-aware selection phase.
1. Offline Phase: Knowledge Extraction from Contrast
The system learns by comparing contrastive trajectories—pairs of successful ($\tau^+$) and failed ($\tau^-$) attempts at the same task.
- Context Identification: An LLM analyzes where the two paths diverged and summarizes that specific state into a concise "Context" (e.g., "On the Reddit main page").
- Guideline Extraction: The LLM then analyzes the difference between the successful and failed actions to derive a conditional rule: "When in [Context], if you want to [Goal], you should [Action]."
- Knowledge Base Construction: These rules are stored in a structured dictionary where the Context serves as the retrieval key.
2. Online Phase: Context-Aware Selection
During execution, the agent does not rely on a static prompt. Instead, at every step:
- The agent identifies its current Context.
- It Retrieves relevant guidelines from the knowledge base.
- A Selection Module filters the top-$k$ most relevant guidelines to inject into the agent's current prompt.
This ensures the agent receives specific advice relevant to its immediate surroundings, preventing the "noise" associated with massive, uncurated manuals.
Experimental Evaluation
The authors evaluated AutoGuide across four challenging benchmarks:
- ALFWorld: Synthetic environments for embodied household tasks.
- WebShop: An e-commerce environment requiring agents to find products based on complex criteria.
- WebArena (Reddit): A realistic web environment requiring long-horizon planning and UI interaction.
- Real-World Multi-Modal Websites: A curated set of tasks on live sites (GitHub, Google Flights, Coursera) using GPT-4V to process both text and visual screenshots.
Key Results
AutoGuide consistently outperformed competitive baselines such as ReAct and ExpeL:
- WebArena (Reddit): AutoGuide achieved a 47.1% success rate, a significant improvement over ReAct (8.0%) and ExpeL (21.8%).
- ALFWorld: Success rates reached 79.1%, compared to 54.5% for ReAct.
- Real-World Web (GitHub): In multi-modal settings, AutoGuide solved 19 out of 30 tasks, while the base agent (SoM) solved only 2.
Discussion and Insights
The Power of Compression
Natural language guidelines serve as a highly efficient form of knowledge transfer. By stripping away the specific noise of a single session, AutoGuide preserves the underlying logic (the "signal") required for generalizable success.
The "Less is More" Principle
A critical finding was that providing all available guidelines—as seen in previous methods like ExpeL—actually degrades performance. Filtering for the immediate context is essential to prevent the LLM from becoming distracted by irrelevant rules.
Cross-Domain Generalization
Interestingly, guidelines learned in one domain (e.g., WebShop) could be successfully applied to others (e.g., WebArena-Shopping). This suggests that AutoGuide captures fundamental navigation and interaction logic that transcends specific site architectures.
Conclusion and Future Work
AutoGuide demonstrates that automated guideline generation is a robust alternative to raw demonstrations for LLM agents. While highly effective, the system currently depends on the diversity of the offline dataset. Future work may explore "closed-loop" systems where agents continually update their guideline dictionaries through autonomous exploration, as well as the development of automated metrics to evaluate guideline quality before deployment.
Summary updated