Large Language Models Can Self-Improve At Web Agent Tasks

Ajay Patel, Markus Hofmarcher, Claudiu Leoveanu-Condrei, Marius-Constantin Dinu, Chris Callison-Burch, Sepp Hochreiter · Submission to ICLR 2025 · Rejected

TL;DR

Large language models (LLMs) can self-improve at complex, multi-step web agent tasks without requiring human-annotated trajectories. By filtering self-generated trajectories using environment feedback and self-critiques, and supplementing them with fully synthetic out-of-domain tasks, the authors achieve up to a 31% relative improvement on the WebArena benchmark.

What Problem Does This Paper Address?

Building autonomous LLM agents that navigate real-world environments like web browsers is notoriously difficult. Standard prompting alone struggles with long-horizon sequential decision-making, and supervised fine-tuning is held back by the high cost of collecting human demonstrations across complex websites.

While LLMs have successfully "self-improved" (training on their own outputs) on traditional NLP benchmarks like math reasoning or translation, it has been unclear whether self-improvement works for interactive, multi-step agent settings. Furthermore, standard binary metrics (did the agent solve the task or not?) fail to capture whether a model actually acquired new capabilities, grew more robust, or degraded trajectory efficiency.

Methods

The authors introduce a fully unsupervised pipeline for collecting and generating synthetic training data for web agents:

  1. In-Domain Trajectory Collection ($D_{\text{IN-DOMAIN}}$): The base LLM generates trajectories on the WebArena benchmark. Low-quality runs are filtered out using completely unsupervised signals:
  2. Self-critique: The model states a task is "impossible" or that it cannot proceed.
  3. Model refusals: Actions like stop[N/A] or empty stops.
  4. Environment errors: Unparsable syntax or environment crashes. The remaining "plausible" trajectories are sampled evenly across initial, intermediate, and final steps.

  5. Out-of-Domain Task Generation ($D_{\text{OUT-OF-DOMAIN}}$): Using the plausible trajectories as few-shot seeds, the base LLM hallucinates entirely new web tasks, high-level action plans, target URLs, and synthetic accessibility-tree observations for websites outside the WebArena suite (ensuring cosine semantic distance $< 0.70$ from existing tasks).

  6. Fine-Tuning: The base agent is fine-tuned via QLoRA (4-bit quantization, rank 8) across three mixtures: Mixture A (in-domain only), Mixture B (in-domain + out-of-domain), and Mixture C (out-of-domain only).
  7. New Evaluation Metrics:
  8. Capability Score: Clusters WebArena's 812 tasks into 136 distinct capabilities (e.g., "compare driving vs. walking routes", "fork a repository") using sentence embeddings. An agent earns a point only if it solves at least one non-trivial task in that capability group.
  9. $\text{VERTEX}_{\text{DTW}}$: Extends trajectory similarity metrics by aligning variable-length action sequences against GPT-4 reference trajectories using Dynamic Time Warping (DTW) with an embedding-based distance decay factor.
       [Base LLM Agent on WebArena]
                    │
      ┌─────────────┴─────────────┐
      ▼                           ▼
[Filter via Errors         [Hallucinate New Tasks,
 & Self-Critique]           Plans & Web Trees]
      │                           │
  (In-Domain)               (Out-of-Domain)
      └─────────────┬─────────────┘
                    ▼
          [QLoRA Fine-Tuning]

Datasets

  • WebArena: A realistic web simulation benchmark comprising 812 multi-step tasks across 6 website categories (e.g., e-commerce, maps, forums, code hosting).
  • Synthetic Datasets:
  • Plausible in-domain trajectories collected and filtered from base model rollouts.
  • Completely generated out-of-domain web navigation tasks and observation trees.

Key Insights and Ideas

  • Unsupervised filtering provides a massive quality boost: Filtering based solely on environment error conditions and self-refusal tokens increased the proportion of successful trajectories in the plausible pool from ~7% to 43% without any human ground truth.
  • In-domain and out-of-domain data provide complementary skills: In-domain training enforces formatting discipline and site-specific navigation, while out-of-domain synthetic data unlocks distinct capabilities that in-domain data misses. Combining both (Mixture B) yielded the strongest overall agent.
  • Iterative self-improvement hits a wall: Fine-tuning over a second round ($M_A^2$) showed diminishing returns. While the second round collected more "plausible" trajectories (131 vs. 58), precision dropped from 43.1% to 25.2%, causing the model to learn from noisy, compounding failures.
  • Out-of-domain data alone causes erratic behavior: Models trained strictly on out-of-domain synthetic pages (Mixture C) produced ~1.6× longer trajectories and ~3.9× more invalid actions, heavily penalizing trajectory quality scores ($\text{VERTEX}_{\text{DTW}}$).

Key Results

Experiments were evaluated across two open-weights base models: Qwen-1.5-72B-Chat and Llama-3-70B-Instruct.

Agent Model Functional Correctness (%) Capability Score (%) $\text{VERTEX}_{\text{DTW}}$
Baseline Trivial Agent 4.68 0.00 —
Qwen-1.5-72B Base ($M$) 7.20 11.62 0.35
+ Mixture A (In-Domain) 8.81 14.19 0.38
+ Mixture B (Combined) 9.57 14.54 0.35
+ Mixture C (Out-of-Domain) 6.11 12.40 0.28
+ Iterative Round 2 ($M_A^2$) 8.37 16.91 0.37
Llama-3-70B Base ($M$) 6.60 12.96 0.28
+ Mixture A (In-Domain) 7.38 15.08 0.28
  • Task Completion: Mixture B provided a 31% relative boost over the base Qwen model (reaching 9.57% functional correctness).
  • Capability Gain: Models expanded their net repertoire by 5 new capabilities (a 24% relative improvement in capability score).
  • Trajectory Preservation: In-domain mixtures maintained or slightly improved trajectory alignment ($\text{VERTEX}_{\text{DTW}}$ of 0.38 vs. 0.35) relative to GPT-4 references.

Limitations and Future Work

  • Error reinforcement: Unsupervised filtering cannot eliminate all incorrect trajectories; faulty actions can still be reinforced during fine-tuning.
  • Reference quality: $\text{VERTEX}_{\text{DTW}}$ compares against GPT-4 trajectories rather than human gold standards, which limits its diagnostic ceiling.
  • Heuristic capability grouping: Capability clustering depends on sentence-similarity models and intent templates, which may not cleanly partition every operational skill.
  • Lack of iterative scaling: The failure of multi-round self-training indicates that better verifiers or environment-grounded reward models will be necessary for compounding, recursive self-improvement.

Summary updated

BibTeX
@misc{patel2024large,
  author = {Ajay Patel and Markus Hofmarcher and Claudiu Leoveanu-Condrei and Marius-Constantin Dinu and Chris Callison-Burch and Sepp Hochreiter},
  title = {{Large Language Models Can Self-Improve At Web Agent Tasks}},
  year = {2024},
  eprint = {2405.20309},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.20309},
}

Loading related content...

Figure