arXiv:2411.01643cs.AIcs.CL2024-11被引 15

让大模型按需注册工具,省下一半算力

EcoAct: Economic Agent Determines When to Register What Action

  • 大模型推理时动态选择要注册的工具
  • 多步任务中计算成本降低超50%
  • 无需改架构,插进现有流程就行

近期进展使大语言模型(LLMs)能作为智能体使用外部工具执行任务,但这需要将工具信息预先注册到模型上下文中。当前方法无差别地将所有候选工具纳入上下文并长期保留,过程对模型不透明,且因无关工具导致上下文过长,效率低下。为此,我们提出EcoAct,一种允许大模型按需选择性注册工具的算法,将注册过程融入推理流程,显著优化上下文使用。大量实验表明,该方法在多步推理任务中可降低超过50%的计算成本,同时保持性能不变。此外,EcoAct仅需对提示词做少量修改即可适配任意推理流水线,适用于现有及未来的大型语言模型智能体。

原文摘要 · Abstract (English)

Recent advancements have enabled Large Language Models (LLMs) to function as agents that can perform actions using external tools. This requires registering, i.e., integrating tool information into the LLM context prior to taking actions. Current methods indiscriminately incorporate all candidate tools into the agent's context and retain them across multiple reasoning steps. This process remains opaque to LLM agents and is not integrated into their reasoning procedures, leading to inefficiencies due to increased context length from irrelevant tools. To address this, we introduce EcoAct, a tool using algorithm that allows LLMs to selectively register tools as needed, optimizing context use. By integrating the tool registration process into the reasoning procedure, EcoAct reduces computational costs by over 50% in multiple steps reasoning tasks while maintaining performance, as demonstrated through extensive experiments. Moreover, it can be plugged into any reasoning pipeline with only minor modifications to the prompt, making it applicable to LLM agents now and future.

大模型智能体工具调用优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。