arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.14290cs.CRcs.AIcs.CLcs.SE
收藏

网络代理应采用计划-然后执行范式

Web Agents Should Adopt the Compile-and-Execute Paradigm

UC Berkeley(加州大学伯克利分校)

Julien Piet, Annabella Chow, Yiwei Hou, Muxi Lyu, Sylvie Venuto, Jinhao Zhu, Raluca Ada Popa, David Wagner

AI总结:

本文提出网络代理应默认采用计划-然后执行范式,而非ReAct架构。该范式通过预先制定任务特定程序,避免运行时网页内容的干扰,提升安全性和效率。

摘要:

ReAct已成为LLM代理的默认架构,但作者认为这对网络代理而言是错误的默认选择。相反,网络代理应默认采用计划-然后执行范式:在观察运行时网页内容前,承诺一个任务特定的程序,然后执行它。原因在于网页内容混合了多方输入。一个电子商务产品页面可能结合卖家列表、客户评价和广告。在ReAct中,所有内容在决定下一步行动时都会流入模型,为提示注入攻击提供了直接路径。计划-然后执行改变了这一边界:不可信的数据可能影响预定义执行图中的值或分支,但不能重新定义用户任务或在运行时导致模型合成新动作。作者分析了流行的WebArena网络代理基准,发现所有任务都兼容计划-然后执行范式,而80%的任务可以仅通过纯程序化计划完成,无需任何运行时LLM子程序。本文识别了采用计划-然后执行范式的主障碍:为使其有效,工具必须清晰映射到语义操作,其效果在执行前已知,使代理有足够的信息进行规划。网页本身不自然暴露这种接口。浏览器工具如点击、输入和滚动有页面依赖性意义。在这一层进行规划是短视的:代理只能看到当前页面上的操作,后续操作只能在它行动后出现。缩小这一差距需要类型化的接口,将网站交互从点击和键盘输入转换为任务层面的操作。这是一个基础设施问题,而非建模问题。网络任务不需要默认的反应性;它们需要类型化、完整、可审计的网站API。

英文摘要:

ReAct has become the default architecture across LLM agents, and many existing web agents follow this paradigm. We argue that it is the wrong default for web agents. Instead, web agents should default to compile-and-execute: commit to a task-specific program before observing runtime web content, then execute it. The reason is that web content mixes inputs from many parties. An e-commerce product page may combine a seller's listing, customer reviews, sponsored advertisements, and platform-generated recommendations. Under ReAct, all of this content flows into the model when deciding on the next action, creating a direct path for prompt injections to steer the agent's control flow. Compile-and-execute changes this boundary: untrusted data may influence values or branches inside a predefined execution graph, but it cannot redefine the user task or cause the model to synthesize new actions at runtime. We analyze WebArena, a popular web agent benchmark, and find that all tasks are compatible with compile-and-execute, while 81% can be completed with a purely static program, without any runtime LLM subroutine. We identify the main barrier to adopting compile-and-execute on the web: For it to work well, tools must map cleanly to semantic actions, with effects known before execution, so a compiler has enough information to emit a program. The web does not naturally expose that interface. Browser tools such as click, type, and scroll have page-dependent meanings. Planning at this layer is near-sighted: the agent can only see actions on the current page, and later actions appear only after it acts. Closing this gap requires typed interfaces that turn website interactions from clicks and keystrokes to task-level operations. This is an infrastructure problem, not a modeling problem. Web tasks do not need reactivity by default; they need typed, complete, auditable website APIs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑