WebRouter: Query-specific Router via Variational Information Bottleneck for Cost-sensitive Web Agent
Tao Li, Jinlong Hu, Yang Wang, Junfeng Liu, Xuejun Liu
TL;DR
WebRouter addresses the costly, noisy prompts of LLM-based web agents by introducing a query-specific router trained with a cost-aware variational information bottleneck (ca-VIB). It compresses prompts using a stochastic masking mechanism and jointly optimizes for accuracy and operational cost, enabling per-query model selection that favors cost-efficient LLMs. On five WebVoyager sites, WebRouter achieves an 87.8% reduction in cost with only a 3.8% accuracy drop, outperforming strong baselines including RouterDC. This work demonstrates that information-theoretic prompt compression coupled with explicit cost regularization can substantially improve the practicality and scalability of real-world web automation agents.
Abstract
LLM-brained web agents offer powerful capabilities for web automation but face a critical cost-performance trade-off. The challenge is amplified by web agents' inherently complex prompts that include goals, action histories, and environmental states, leading to degraded LLM ensemble performance. To address this, we introduce WebRouter, a novel query-specific router trained from an information-theoretic perspective. Our core contribution is a cost-aware Variational Information Bottleneck (ca-VIB) objective, which learns a compressed representation of the input prompt while explicitly penalizing the expected operational cost. Experiments on five real-world websites from the WebVoyager benchmark show that WebRouter reduces operational costs by a striking 87.8\% compared to a GPT-4o baseline, while incurring only a 3.8\% accuracy drop.
