FocusAgent:修剪网页智能体大上下文的简单有效方法
FocusAgent: Simple Yet Effective Ways of Trimming the Large Context of Web Agents
AI总结:
该研究提出FocusAgent,通过轻量级LLM检索器修剪网页智能体的无关上下文,在保持性能的同时减少观测规模超50%,并降低提示注入攻击风险。
摘要:
由大型语言模型(LLM)驱动的网页智能体必须处理冗长的网页观测结果以完成用户目标,这些网页通常超过数万令牌。这会使上下文限制饱和,增加处理的计算成本;此外,处理完整页面还会使智能体面临提示注入等安全风险。现有的修剪策略要么丢弃相关内容,要么保留无关上下文,导致动作预测效果不佳。我们提出FocusAgent,一种简单而有效的方法,它利用轻量级LLM检索器,在任务目标的引导下从无障碍树(AxTree)观测结果中提取最相关的行。通过修剪噪声和无关内容,FocusAgent实现了高效推理,同时降低了对注入攻击的脆弱性。在WorkArena和WebArena基准测试上的实验表明,FocusAgent的性能与强大的基线相当,同时将观测大小减少了50%以上。此外,FocusAgent的一个变体显著降低了提示注入攻击的成功率,包括横幅和弹出式攻击,同时在无攻击环境中保持任务成功性能。我们的结果表明,基于LLM的定向检索是构建高效、有效且安全的网页智能体的实用且稳健策略。
英文摘要:
Web agents powered by large language models (LLMs) must process lengthy web page observations to complete user goals; these pages often exceed tens of thousands of tokens. This saturates context limits and increases computational cost processing; moreover, processing full pages exposes agents to security risks such as prompt injection. Existing pruning strategies either discard relevant content or retain irrelevant context, leading to suboptimal action prediction. We introduce FocusAgent, a simple yet effective approach that leverages a lightweight LLM retriever to extract the most relevant lines from accessibility tree (AxTree) observations, guided by task goals. By pruning noisy and irrelevant content, FocusAgent enables efficient reasoning while reducing vulnerability to injection attacks. Experiments on WorkArena and WebArena benchmarks show that FocusAgent matches the performance of strong baselines, while reducing observation size by over 50%. Furthermore, a variant of FocusAgent significantly reduces the success rate of prompt-injection attacks, including banner and pop-up attacks, while maintaining task success performance in attack-free settings. Our results highlight that targeted LLM-based retrieval is a practical and robust strategy for building web agents that are efficient, effective, and secure.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。