The Menu Is an Execution Prior: State-Path Tool Menus for Online Agents

The Menu Is an Execution Prior: State-Path Tool Menus for Online Agents

菜单即执行先验:面向在线智能体的状态路径工具菜单

Abstract: Language models act through tools, yet practical agents face libraries containing thousands of interfaces. We introduce the tool menu as the short, ordered subset of available tools shown to an agent before execution. The agent can call only tools in this menu. Multi-step tasks require the final action and the prerequisite tools that create its inputs in a usable order. Current constructors rank tools by request relevance, which can surface the final action while omitting or delaying less obvious producers.

摘要: 语言模型通过工具进行操作,但实际的智能体往往面临包含数千个接口的工具库。我们引入了“工具菜单”的概念,即在执行前向智能体展示的、简短且有序的可用工具子集。智能体仅能调用此菜单中的工具。多步任务需要最终操作以及以可用顺序创建其输入的先决工具。当前的构建器通常根据请求相关性对工具进行排序,这可能会突出显示最终操作,却忽略或延迟了那些不太明显的“生产者”工具。

We introduce the state path, a pre-execution route from the observable request state to the desired outcome, and propose State-Path Tool Menu to learn it. Our framework treats the menu as an execution prior over these routes. Its encoder represents which tools can run from the current state, how their outputs satisfy later inputs, and which orders recur in training paths. A retriever covers an executable entry, the missing-input producers, and the final action. A reranker then places producers before consumers.

我们引入了“状态路径”的概念,即从可观察的请求状态到预期结果的预执行路线,并提出了用于学习该路径的“状态路径工具菜单”(State-Path Tool Menu)。我们的框架将菜单视为这些路径上的执行先验。其编码器能够表示哪些工具可以在当前状态下运行、它们的输出如何满足后续输入,以及哪些顺序在训练路径中反复出现。检索器负责涵盖可执行的入口、缺失输入的生产者工具以及最终操作。随后,重排序器将生产者工具置于消费者工具之前。

On ToolBench, our menu raises online success from 0.737 to 0.898 and outperforms retrieval, reranking, generation, and routing baselines without changing the agent. The State-Path menu also covers more complete chains with 32 tools than the official list covers with 128, and its success gain persists across executor families with different model capacities. Our code is at this https URL.

在 ToolBench 测试集上,我们的菜单将在线成功率从 0.737 提升至 0.898,且在无需更改智能体架构的情况下,优于检索、重排序、生成和路由等基准方法。此外,状态路径菜单仅需 32 个工具即可覆盖比官方列表 128 个工具更完整的执行链,且这种成功率的提升在不同模型能力的执行器系列中均保持稳定。我们的代码已开源至此链接。