Beyond Pixels: Exploring DOM Downsampling for LLM-Based Web Agents
Thassilo M. Schiepanski, Nicholas Piël
TL;DR
This work tackles the core problem of scaling LLM-based web agents by serializing web application state via DOM snapshots, which preserve structural UI information but can be prohibitively large. It introduces D2Snap, a DOM downsampling algorithm that conserves UI features across node types (container, content, interactive) and supports adaptive configurations using TextRank for text, semantic thresholds for attributes, and hierarchical merging. Empirical evaluation on the Online-Mind2Web dataset shows that D2Snap can achieve performance on par with or better than grounded GUI baselines (up to 73% success in best configurations) while reducing input size to within typical model context windows; hierarchy emerges as a key UI signal for LLMs. The study also finds limited benefit from vision inputs and highlights dataset size and cross-origin constraints as important considerations, outlining future work to blend DOM snapshots with scoped visuals and to broaden evaluation across more web tasks.
Abstract
Frontier LLMs only recently enabled serviceable, autonomous web agents. At that, a model poses as an instantaneous domain model backend. Ought to suggest interaction, it is consulted with a web-based task and respective application state. The key problem lies in application state serialisation - referred to as snapshot. State-of-the-art web agents are premised on grounded GUI snapshots, i.e., screenshots enhanced with visual cues. Not least to resemble human perception, but for images representing relatively cheap means of model input. LLM vision still lag behind code interpretation capabilities. DOM snapshots, which structurally resemble HTML, impose a desired alternative. Vast model input token size, however, disables reliable implementation with web agents to date. We propose D2Snap, a first-of-its-kind DOM downsampling algorithm. Based on a GPT-4o backend, we evaluate D2Snap on tasks sampled from the Online-Mind2Web dataset. The success rate of D2Snap-downsampled DOM snapshots (67%) matches a grounded GUI snapshot baseline (65%) - within the same input token order of magnitude (1e3). Our best evaluated configurations - one token order above, but within the model's context window - outperform this baseline by 8%. Our evaluation, moreover, yields that DOM-inherent hierarchy embodies a strong UI feature for LLMs.
