LASER: LLM Agent with State-Space Exploration for Web Navigation

Kaixin Ma, Hongming Zhang, Hongwei Wang, Xiaoman Pan, Wenhao Yu, Dong Yu

TL;DR

LASER is a novel LLM agent framework that models web navigation as a state-space exploration rather than a rigid, forward-only sequence of actions. By defining explicit high-level states and state-specific action spaces, LASER enables flexible backtracking and error recovery, achieving near-human performance on web shopping tasks without requiring few-shot in-context examples.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown great promise as interactive agents for tasks like web browsing and virtual home navigation. However, standard prompting methods (like ReAct) typically assume a "forward-only" execution paradigm. These agents are trained or prompted using a few "oracle" trajectories—perfect, error-free step-by-step paths.

The core issue is that if the agent makes a single mistake at test time, it lands in an unfamiliar state not covered by its in-context examples. Lacking a mechanism to recover or backtrack, the agent often gets stuck in loops or fails catastrophically. Furthermore, typical setups present the LLM with a global action space, leading the model to frequently attempt invalid actions (e.g., trying to click a "next page" button when none exists).

Methods

Instead of treating web navigation as a free-form text generation task, the authors introduce LASER (LLM Agent with State-Space ExploRation), which formalizes the environment as a state transition system.

  1. State-Space Formulation: The authors define a small set of high-level states that characterize the environment layout (e.g., Search, Results, Item, and Finish).
  2. State-Specific System Instructions: Rather than using costly in-context examples, LASER uses a zero-shot approach. For each state, the agent is given a generic structural layout of the page (using placeholders) along with a high-level goal and operating instructions.
  3. Restricted Action Spaces: To prevent the LLM from executing invalid actions, the action space is strictly bounded based on the current state. LASER leverages GPT-4’s native function-calling capability to enforce these constraints, ensuring the model only selects valid, executable functions.
  4. Backtracking & Memory Buffer: If an item does not match the user's requirements, the agent can explicitly execute a backtracking action (e.g., Reject Item or Back to Search). A memory buffer tracks these rejected items, serving as a backup strategy if the agent runs out of its interaction budget.
Figure 1: LASER’s state transition diagram on the Web- shop Task. Solid circle represent states, and the arrows represent possible state transitions. This formulation enables flexible backtracking and relieves the limitation of forward-only examples, allowing the model to better handle unfamiliar scenarios and recover from errors.

Datasets

The authors evaluated LASER on two environments:

  • WebShop: A simulated e-commerce platform containing over 1.18 million products and human-annotated shopping instructions, used to evaluate success rate and partial reward matching.
  • Amazon.com: To test sim-to-real transfer, the authors scraped real product pages from Amazon and converted them into the WebShop format, evaluating the agent on 100 test instructions with human-verified scoring.

Key Insights and Ideas

  • High-Level Principles Over Low-Level Examples: Providing the LLM with structural rules and state-specific goals (high-level generalizable knowledge) is far more efficient than feeding it long, case-by-case oracle trajectories.
  • In-Context Examples Can Distract: Surprisingly, ablation studies showed that adding a one-shot example to LASER actually decreased performance. Because the state-space constraints already ensure valid actions, extra examples serve as noise rather than helpful guidance.
  • Robustness to Trajectory Length: Traditional agents degrade rapidly over long interaction sequences. Thanks to its explicit backtracking capabilities, LASER maintains a much steadier performance profile even when it takes many steps to resolve a task.

Key Results

  • WebShop Benchmark: LASER achieved a 50.0% success rate and a 75.6 reward score, significantly outperforming the ReAct baseline (34.0% success rate) and even beating WebGUM (45.0%), a model explicitly fine-tuned on 1,000 human demonstrations.
  • Sim-to-Real Transfer: On real-world Amazon pages, LASER achieved a 62.0% success rate, closing the gap to human expert performance (65.0%). It actually performed better on the real website than in the simulation, likely due to Amazon's superior underlying search engine.
Figure 2: Left: LASER’s performance for test set episodes of different lengths. Right: The distribution of the number of steps LASER takes to complete tasks

Limitations and Future Work

  • Manual State Engineering: LASER requires human developers to manually define the states and permissible actions for the target environment. This makes it highly effective for specific domains (like e-commerce or travel booking) but less suited as a general-purpose, open-world web agent.
  • Narrow Task Scope: The evaluation focused entirely on product purchasing. It remains to be seen how well this framework handles multi-state tasks like tracking orders or managing user accounts.
  • Real-World Safety Risks: Executing high-stakes actions (like clicking a real "Buy Now" button) carries financial risks. The authors note that for real-world deployment, LASER would require strict human-in-the-loop verification or self-feedback modules to prevent costly mistakes.

Summary updated

BibTeX
@misc{ma2023laser,
  author = {Kaixin Ma and Hongming Zhang and Hongwei Wang and Xiaoman Pan and Wenhao Yu and Dong Yu},
  title = {{LASER: LLM Agent with State-Space Exploration for Web Navigation}},
  year = {2023},
  eprint = {2309.08172},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.08172},
}
Figure