LLM-Tool 编译器:用于融合并行函数调用
An LLM-Tool Compiler for Fused Parallel Function Calling
AI总结:
受硬件乘加运算融合原理启发,提出 LLM-Tool 编译器,在运行时选择性融合相似工具操作,提升并行函数调用效率,实现并行调用量提升四倍,令牌成本和延迟分别降低 40% 和 12%。
摘要:
最先进的大型语言模型(LLM)中的顺序推理已将 Copilot 的能力从对话任务扩展到复杂的函数调用,管理数千个 API 调用。然而,组合式提示倾向于将任务分解为多个步骤,每个步骤都需要与 GPT API 进行一次往返,这导致系统延迟和成本增加。尽管并行函数调用的最新进展改善了每次 API 调用的工具执行,但它们可能需要在提示级别进行更详细的上下文指令和任务分解,从而导致更高的工程和生产成本。受乘加(MAD)运算的硬件设计原理启发,该原理从编译器的角度将多个算术运算融合为单个任务,我们提出了 LLM-Tool 编译器,它选择性地在运行时将相似类型的工具操作融合到单个函数下,将它们作为统一任务呈现给 LLM。这种选择性融合固有地增强了并行性和效率。在一个大规模 Copilot 平台上进行基准测试,LLM-Tool 编译器实现了比现有方法多达四倍的并行调用,分别将令牌成本和延迟降低了高达 40% 和 12%。
英文摘要:
State-of-the-art sequential reasoning in Large Language Models (LLMs) has expanded the capabilities of Copilots beyond conversational tasks to complex function calling, managing thousands of API calls. However, the tendency of compositional prompting to segment tasks into multiple steps, each requiring a round-trip to the GPT APIs, leads to increased system latency and costs. Although recent advancements in parallel function calling have improved tool execution per API call, they may necessitate more detailed in-context instructions and task breakdown at the prompt level, resulting in higher engineering and production costs. Inspired by the hardware design principles of multiply-add (MAD) operations, which fuse multiple arithmetic operations into a single task from the compiler's perspective, we propose LLM-Tool Compiler, which selectively fuses similar types of tool operations under a single function at runtime, presenting them as a unified task to the LLM. This selective fusion inherently enhances parallelization and efficiency. Benchmarked on a large-scale Copilot platform, LLM-Tool Compiler achieves up to four times more parallel calls than existing methods, reducing token costs and latency by up to 40% and 12%, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。