arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.15834cs.PLcs.AIcs.DCcs.PFcs.SE
收藏

通过推测性工具调用优化代理语言模型推理

Optimizing Agentic Language Model Inference via Speculative Tool Calls

Lawrence Livermore National Laboratory(劳伦斯利弗莫尔国家实验室);University of Maryland(马里兰大学)

Daniel Nichols, Prajwal Singhania, Charles Jekel, Abhinav Bhatele, Harshitha Menon

AI总结:

本文通过推测性工具调用优化代理语言模型推理,提升推理吞吐量并提供理论分析与工具缓存API。

摘要:

语言模型(LMs)越来越依赖外部工具。基于LM的代理框架经常通过这些工具与环境交互,以搜索文件、运行代码、调用API等。此外,现代基于推理的LM使用如网络搜索和Python代码执行等工具来增强其推理能力。尽管工具大大提高了LM的能力,但它们也引入了推理过程中的性能瓶颈。在本文中,我们引入了新的系统优化来解决此类性能瓶颈,通过推测性工具调用并强制序列留在推理引擎中以最小化开销。我们的优化使在为LM代理托管推理时的吞吐量提高了每秒数百个标记。我们对算法进行了理论分析,以提供关于推测配置的见解,这些配置将产生最佳性能。此外,我们推荐一个新的

英文摘要:

Language models (LMs) are becoming increasingly dependent on external tools. LM-based agentic frameworks frequently interact with their environment via such tools to search files, run code, call APIs, etc. Further, modern reasoning-based LMs use tools such as web search and Python code execution to enhance their reasoning capabilities. While tools greatly improve the capabilities of LMs, they also introduce performance bottlenecks during the inference process. In this paper, we introduce novel systems optimizations to address such performance bottlenecks by speculating tool calls and forcing sequences to remain resident in the inference engine to minimize overheads. Our optimizations lead to throughput improvements of several hundred tokens per second when hosting inference for LM agents. We provide a theoretical analysis of our algorithms to provide insights into speculation configurations that will yield the best performance. Further, we recommend a new "tool cache" API endpoint to enable LM providers to easily adopt these optimizations.

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

↑