arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.07017cs.CLcs.AI
收藏

异步 LLM 函数调用

Asynchronous LLM Function Calling

Yale University(耶鲁大学)

In Gim, Seung-seob Lee, Lin Zhong

AI总结:

针对同步函数调用阻塞 LLM 推理的问题,本文提出 AsyncLM,通过中断机制、上下文内协议与微调支持并发函数调用,在 BFCL 上将端到端延迟降低 1.6–5.4 倍。

摘要:

大型语言模型(LLM)使用函数调用来连接外部工具和数据源。然而,当前的 LLM 函数调用方法本质上是同步的:每次调用都会阻塞 LLM 推理,从而限制了 LLM 的运行和函数的并发执行。在本研究中,我们提出了 AsyncLM,这是一个用于异步 LLM 函数调用的系统。AsyncLM 通过使 LLM 能够并发地生成和执行函数调用来提升 LLM 的运行效率。AsyncLM 不再等待每次调用完成,而是引入一种中断机制,在函数调用返回时异步通知正在运行中的 LLM。我们设计了一套用于函数调用和中断的上下文内协议,提供了微调策略以使 LLM 适应中断语义,并在 LLM 推理流程中高效实现了这些机制。我们证明,在 Berkeley function calling leaderboard(BFCL)的一组基准任务上,与同步函数调用相比,AsyncLM 可将端到端任务完成延迟降低 1.6 倍至 5.4 倍。此外,我们还讨论了如何扩展中断机制,以实现新型的人类-LLM 或 LLM-LLM 交互。

英文摘要:

Large language models (LLMs) use function calls to interface with external tools and data source. However, the current approach to LLM function calling is inherently synchronous, where each call blocks LLM inference, limiting LLM operation and concurrent function execution. In this work, we propose AsyncLM, a system for asynchronous LLM function calling. AsyncLM improves LLM's operational efficiency by enabling LLMs to generate and execute function calls concurrently. Instead of waiting for each call's completion, AsyncLM introduces an interrupt mechanism to asynchronously notify the LLM in-flight when function calls return. We design an in-context protocol for function calls and interrupts, provide fine-tuning strategy to adapt LLMs to the interrupt semantics, and implement these mechanisms efficiently on LLM inference process. We demonstrate that AsyncLM can reduce end-to-end task completion latency from 1.6x-5.4x compared to synchronous function calling on a set of benchmark tasks in the Berkeley function calling leaderboard (BFCL). Furthermore, we discuss how interrupt mechanisms can be extended to enable novel human-LLM or LLM-LLM interactions.

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

↑