A Real-World WebAgent with Planning, Long Context Understanding, and Program Synthesis

TL;DR

WebAgent combines HTML-T5 planning with Flan-U-PaLM code synthesis, raising real-world web-task success by over 50%.

cs.LG 🔴 Advanced 2023-07-24 28 views
Izzeddin Gur Hiroki Furuta Austin Huang Mustafa Safdari Yutaka Matsuo Douglas Eck Aleksandra Faust
WebAgent HTML-T5 Program Synthesis Long Context Web Automation

Key Findings

Methodology

WebAgent is a modular closed loop. HTML-T5 receives the instruction, action history, and raw HTML, predicts the next canonical sub-instruction, and extracts relevant HTML snippets. Flan-U-PaLM, a 540B model, converts those grounded inputs into executable Python/Selenium programs. HTML-T5 uses LongT5-style local-global attention and long-span denoising pretraining on CommonCrawl HTML, followed by self-experience fine-tuning for real websites.

Key Results

  • On real estate, social-media, and map websites, WebAgent achieves 65%, 70%, and 80% task success, with attribute-coverage scores of 87.6%, 85.8%, and 93.8%, substantially exceeding single-Flan-U-PaLM and planning-only or summarization-only variants.
  • On MiniWoB++ 12K across 56 tasks, HTML-T5's architecture and pretraining produce strong gains; the paper reports an 18.7% success-rate improvement over the prior language-model agent. On Mind2Web, HTML-T5 reaches state-of-the-art offline planning performance, surpassing reported GPT-4-based baselines.
  • Ablations show local-global attention reaches 53.6% at sequence length 4096 versus 35.3% for dense attention. A long-span mixture with μ={8,64} obtains 82.46% on the real-estate setting, outperforming mixtures containing short μ=3 spans.

Significance

The paper targets three persistent barriers in real-world web agents: open-ended actions, 7K–14K-token HTML pages, and weak HTML-specific inductive bias in general-purpose LLMs. It demonstrates that planning, task-conditioned compression, and executable code generation are complementary rather than interchangeable. Academically, the work argues for domain-specialized pretraining and closed-loop self-experience. Industrially, it points beyond fixed action classification toward agents that can synthesize browser programs for unfamiliar interfaces, although safety and cost remain important deployment constraints.

Technical Contribution

The main contributions are HTML-T5, local-global attention, long-span HTML denoising, and self-experience supervision. Local attention captures nearby tag-attribute relations, while transient global representations summarize information across windows and reflect HTML hierarchy. Pretraining uses 4096 input tokens, 910 output tokens, 15% corruption, and especially spans with means 8 and 64. Rule-based scripts provide planning and retrieval targets; Flan-U-PaLM generates programs; execution feedback removes program, retriever, and URL failures before HTML-T5 fine-tuning.

Novelty

Unlike MindAct, which combines DeBERTa/Flan-T5 summarization with discrete action selection, WebAgent unifies an HTML-specialist model, closed-loop planning, and open-ended Python execution on live websites. The fundamental novelty is the system-level coupling of structural HTML bias, task decomposition, and executable interaction, trained through automatically collected real-world experience rather than only static demonstrations.

Limitations

  • Evaluation covers only three website types, with 260, 230, and 410 training episodes for real estate, social media, and maps. This limited domain and template coverage leaves generalization to unseen commercial sites uncertain.
  • The 540B Flan-U-PaLM dependency implies substantial inference cost. The paper does not fully quantify latency, security, visual interaction, authentication, anti-bot defenses, or robust recovery from dynamic page changes.

Future Work

Future work should broaden websites and instruction distributions, learn stronger adaptive planners and automatic success judges, and add program verification and sandboxed execution. Vision-HTML fusion, persistent memory, safer permission policies, and smaller code models could improve robustness, privacy, latency, and affordability while preserving the benefits of structural HTML specialization.

AI Executive Summary

Real-world web automation is much harder than simulator navigation. Simulators often expose roughly 0.5K tokens of simplified HTML and a predefined action set, whereas real pages contain 7K–14K tokens, distracting markup, dynamic layouts, and actions that cannot be enumerated in advance. The paper introduces WebAgent to execute multi-step natural-language instructions on such websites.

WebAgent forms a closed loop. HTML-T5 predicts the next canonical sub-instruction and extracts task-relevant HTML snippets; Flan-U-PaLM then turns them into Python/Selenium code. The new HTML-T5 uses LongT5-style local-global attention and is pretrained on 3.41M CommonCrawl-derived HTML examples with long-span denoising, emphasizing span means μ=8 and 64. After execution, the resulting page is fed back for another planning step.

On real estate, social-media, and map websites, WebAgent reaches 65%, 70%, and 80% success, with attribute coverage of 87.6%, 85.8%, and 93.8%, improving over weaker modular baselines by more than 50%. HTML-T5 reports an 18.7% gain over the prior agent on MiniWoB++ and state-of-the-art performance on Mind2Web. Ablations show 53.6% for local-global attention versus 35.3% for dense attention at length 4096. The broader lesson is that reliable web agents require structural HTML bias, long-context compression, adaptive planning, and open-ended program synthesis working together—not a single prompted generalist model.

Deep Analysis

Background

LLMs have enabled reasoning and simulated web navigation. Work by Gur, Furuta, and others, as well as MindAct, showed that prompting or fine-tuning can solve structured tasks. However, those settings rely on short, simplified HTML and predefined actions. Real pages are about 15 times longer on average, contain irrelevant markup and dynamic structure, and require general interaction abilities that ordinary T5, Flan-T5, or GPT-style agents do not reliably provide.

Core Problem

The agent must interpret complex language, maintain state across pages, process 7K–14K-token HTML, and perform actions that cannot be listed beforehand. Direct long-document prompting is expensive or exceeds context limits; regular-expression retrieval loses semantic relations; discrete action classification cannot cover arbitrary inputs, scrolling, submissions, or page-specific interactions.

Innovation

First, WebAgent closes the loop between planning, HTML summarization, and execution. Second, HTML-T5 encodes HTML hierarchy with local-global attention. Third, long-span denoising with μ=8 and 64 avoids wasting corruption on fragments such as </ or id=. Fourth, self-experience combines scripted planning, model-generated programs, and environmental filtering, reducing the need for manual step-level annotation.

Methodology

  • �� Input: user instruction, previous sub-instructions, and current HTML.
  • �� Planning: HTML-T5 predicts a canonical next step, such as “type 7500 into max rent.”
  • �� Summarization: it identifies relevant data-ref IDs or elements and returns compact snippets.
  • �� Synthesis: Flan-U-PaLM generates Python Selenium actions including send_keys, click, submit, and scrolling.
  • �� Execution: the browser runs the program and returns new HTML.
  • �� Training: HTML-T5 is pretrained on 3.41M CommonCrawl examples and fine-tuned on 260/230/410 real-site episodes; execution, retrieval, and URL failures are filtered.

Experiments

Real-world evaluation uses real-estate, social-media, and map sites, with approximately 20, 10, and shorter steps per episode. Twenty natural-language instructions are evaluated using task success and attribute coverage. HTML-T5 is also tested on MiniWoB++ 12K over 56 tasks and the offline Mind2Web planning benchmark. Comparisons include dense Flan-T5, Long-T5 variants, prior agents, MindAct, and Synapse. Ablations vary attention type, sequence length, and denoising-span mixtures.

Results

WebAgent obtains 65%/70%/80% success and 87.6%/85.8%/93.8% attribute coverage across the three real sites, versus only 10%/20%/10% success for a single Flan-U-PaLM baseline. On MiniWoB++, dense attention reaches 35.3% at length 4096, while local-global attention reaches 53.6%. On the real-estate task, μ={8,64} scores 82.46%, above 78.07% without HTML denoising. These results support both structural attention and closed-loop specialization.

Applications

The approach fits property search, social-platform retrieval, route planning, form filling, enterprise back-office workflows, and information collection. Deployment requires browser sandboxing, permission control, page-change monitoring, and reliable task verification. Its main advantage is handling unfamiliar interfaces where a fixed action vocabulary is inadequate, rather than merely replaying known button sequences.

Limitations & Outlook

The study uses limited domains, template-like instructions, and human-supervised execution; the 540B Flan-U-PaLM component is expensive. It does not fully report latency, security, visual interaction, authentication, anti-bot behavior, or severe program failures. Future systems should expand cross-domain evaluation, add vision and verification, learn automated feedback, support recovery and memory, and replace the giant code model with smaller efficient synthesizers.

Plain Language Accessible to non-experts

Imagine a travel assistant who can operate almost any service counter. You say, “Find two-bedroom, two-bathroom homes in New York under $7,500.” Instead of memorizing the entire building directory, the assistant breaks the request into small jobs: open the housing site, enter the city, choose bedrooms and bathrooms, and set the price limit.

A second helper scans the messy webpage and keeps only the useful boxes and buttons. A third helper translates “click the price filter” into an exact instruction that the browser can perform. After each action, the website changes, so the team looks again and decides what comes next.

Training works like an apprenticeship. The system studies many webpages, hides long pieces, and learns to reconstruct them. It then practices on generated tasks; failed scripts and bad searches are removed. Thus it learns not only where buttons appeared before, but how webpage parts fit together and how a task unfolds.

The system succeeds on real estate, social-media, and map websites at 65%, 70%, and 80%. The important idea is teamwork: one model plans, one finds the relevant information, and one performs the action.

ELI14 Explained like you're 14

Picture a ridiculously complicated web game. Your mission is: “On a map site, find the second cycling route from San Jose to Mountain View.” A basic robot may know only a fixed list of buttons. Add an advertisement, a new menu, or a redesigned page, and it gets completely lost.

WebAgent works like a small squad. HTML-T5 is the team captain: it reads the mission and says, “enter the starting point,” “enter the destination,” “choose cycling,” and “click the second route.” It ignores most of the page’s messy code and searches for the part that matters right now.

Flan-U-PaLM is the coder. It turns the captain’s instruction into Python commands that a browser can execute: find a box, type text, click something, or scroll down. After one move, the page changes, so the squad checks again and plans the next move. It is more like completing a game quest than guessing one answer.

Researchers also trained the system on lots of HTML from CommonCrawl, hiding longer chunks so it could learn webpage patterns. It reached 65%, 70%, and 80% success on three real websites and improved MiniWoB++ performance by 18.7%. Pretty impressive! But it is expensive, and strange page changes can still confuse it.

Glossary

WebAgent

A modular agent that follows natural-language instructions by operating real websites. It combines planning, HTML summarization, and executable Python synthesis.

The paper's complete system.

HTML-T5

An encoder-decoder language model specialized for long HTML documents. It performs next-step planning and task-conditioned snippet extraction.

The domain-expert module in WebAgent.

Local-global attention

Local attention models nearby tokens, while transient global representations aggregate information across windows. This reduces long-context cost while matching HTML hierarchy.

The HTML-T5 encoder mechanism.

Long-span denoising

A pretraining objective that masks contiguous token spans and asks the model to reconstruct them. HTML-T5 emphasizes means 8 and 64 because short spans often contain low-information markup fragments.

CommonCrawl HTML pretraining.

Self-experience supervision

A semi-supervised procedure that generates trajectories through scripted planning and model-written programs, then filters them using environmental feedback. It reduces manual step-level labeling.

Alignment to real websites.

Grounded program synthesis

Generating executable code conditioned on both a natural-language subtask and actual webpage elements. WebAgent uses Flan-U-PaLM to produce Python Selenium scripts.

The solution to open-ended web actions.

Open Questions Unanswered questions from this research

  • 1 It remains unclear whether the system can reliably handle authentication, CAPTCHAs, pop-ups, anti-bot defenses, and rapidly changing commercial pages; long-term cross-site tests are needed.
  • 2 The 540B model creates major cost and latency barriers. Smaller code models, caching, and program reuse must be tested for comparable success.
  • 3 Filtering obvious failures is not enough for safety. Fine-grained rewards, formal program checks, permission policies, and recovery from partial failure remain open problems.

Applications

Immediate Applications

Natural-language property search

Users describe location, budget, rooms, and housing purpose; WebAgent fills filters and gathers results. A browser sandbox, account permissions, and page-change monitoring are required, but repetitive customer-service clicks could be greatly reduced.

Enterprise browser workflows

Organizations can automate dashboards, forms, community filtering, route lookup, and data collection. They provide allowed URLs, permissions, and a few examples; HTML-T5 locates elements while Flan-U-PaLM synthesizes the browser program.

Long-term Vision

General-purpose web assistant

A future agent could complete shopping, booking, reimbursement, and research tasks across websites. Realization depends on safe authorization, privacy protection, CAPTCHA handling, error recovery, auditability, and predictable execution.

Abstract

Pre-trained large language models (LLMs) have recently achieved better generalization and sample efficiency in autonomous web automation. However, the performance on real-world websites has still suffered from (1) open domainness, (2) limited context length, and (3) lack of inductive bias on HTML. We introduce WebAgent, an LLM-driven agent that learns from self-experience to complete tasks on real websites following natural language instructions. WebAgent plans ahead by decomposing instructions into canonical sub-instructions, summarizes long HTML documents into task-relevant snippets, and acts on websites via Python programs generated from those. We design WebAgent with Flan-U-PaLM, for grounded code generation, and HTML-T5, new pre-trained LLMs for long HTML documents using local and global attention mechanisms and a mixture of long-span denoising objectives, for planning and summarization. We empirically demonstrate that our modular recipe improves the success on real websites by over 50%, and that HTML-T5 is the best model to solve various HTML understanding tasks; achieving 18.7% higher success rate than the prior method on MiniWoB web automation benchmark, and SoTA performance on Mind2Web, an offline task planning evaluation.

cs.LG cs.AI cs.CL