Prune4Web: DOM Tree Pruning Programming for Web Agent
By: Jiayuan Zhang , Kaiquan Chen , Zhihao Lu and more
Potential Business Impact:
Helps computers understand websites faster and better.
Web automation employs intelligent agents to execute high-level tasks by mimicking human interactions with web interfaces. Despite the capabilities of recent Large Language Model (LLM)-based web agents, navigating complex, real-world webpages efficiently remains a significant hurdle due to the prohibitively large size of Document Object Model (DOM) structures, often ranging from 10,000 to 100,000 tokens. Existing strategies typically rely on crude DOM truncation -- risking the loss of critical information -- or employ inefficient heuristics and separate ranking models, failing to achieve an optimal balance between precision and scalability. To address these challenges, we introduce Prune4Web, a novel paradigm that shifts DOM processing from resource-intensive LLM reading to efficient programmatic pruning. Central to our approach is DOM Tree Pruning Programming, where an LLM generates executable Python scoring scripts to dynamically filter DOM elements based on semantic cues from decomposed sub-tasks. This mechanism eliminates the need for LLMs to ingest raw, massive DOMs, instead delegating traversal and scoring to lightweight, interpretable programs. This methodology achieves a 25x to 50x reduction in candidate elements for grounding, thereby facilitating precise action localization while mitigating attention dilution. Furthermore, we propose a specialized data annotation pipeline and a two-turn dialogue training strategy that jointly optimizes the Planner, Programmatic Filter, and Grounder within a unified framework. Extensive experiments demonstrate state-of-the-art performance. Notably, on our low-level grounding task, Prune4Web dramatically improves accuracy from 46.8% to 88.28%, underscoring its efficacy in real-world web automation.
Similar Papers
FocusAgent: Simple Yet Effective Ways of Trimming the Large Context of Web Agents
Computation and Language
Helps robots find important web info faster, safer.
Evaluating the Use of LLMs for Automated DOM-Level Resolution of Web Performance Issues
Software Engineering
Computers fix website speed problems automatically.
Beyond Pixels: Exploring DOM Downsampling for LLM-Based Web Agents
Artificial Intelligence
Helps AI understand websites better by simplifying their code.