Towards Efficient Agents: A Co-Design of Inference Architecture and System
作者: Weizhe Lin, Hui-Ling Zhen, Shuai Yang, Xian Wang, Renxi Liu, Hanting Chen, Wangze Zhang, Chuansai Zhou, Yiming Li, Chen Chen, Xing Li, Zhiyuan Yang, Xiaosong Li, Xianzhi Yu, Zhenhua Dong, Mingxuan Yuan, Yunhe Wang
分类: cs.CL
发布日期: 2025-12-20
💡 一句话要点
AgentInfer:推理架构与系统协同设计,提升LLM智能Agent效率
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 智能Agent 推理优化 系统协同设计 大型语言模型 推测解码
📋 核心要点
- 现有基于LLM的Agent在实际部署中面临效率瓶颈,主要由于推理循环、上下文增长和异构工具交互带来的系统性延迟。
- AgentInfer通过协同设计推理架构和系统,提出AgentCollab、AgentSched、AgentSAM和AgentCompress四个模块,实现端到端Agent加速。
- 实验表明,AgentInfer在BrowseComp-zh和DeepDiver基准测试上,减少了超过50%的无效token消耗,实现了1.8-2.5倍的整体加速。
📝 摘要(中文)
基于大型语言模型(LLM)的智能Agent在自主多轮推理和工具增强决策方面展现了巨大潜力。然而,实际部署面临严重效率瓶颈,这并非源于孤立的模型推理,而是推理循环、上下文增长和异构工具交互累积的系统性延迟。本文提出了AgentInfer,一个统一的端到端Agent加速框架,桥接了推理优化和架构设计。它包含四个协同组件:AgentCollab,一种分层双模型推理框架,通过动态角色分配平衡大型和小型模型的使用;AgentSched,一种缓存感知混合调度器,在异构请求模式下最小化延迟;AgentSAM,一种基于后缀自动机的推测解码方法,重用多会话语义记忆以实现低开销的推理加速;以及AgentCompress,一种语义压缩机制,异步地提炼和重组Agent记忆,而不会中断正在进行的推理。这些模块共同构成了一个自我进化引擎,能够在长时程推理任务中维持效率和认知稳定性。在BrowseComp-zh和DeepDiver基准测试上的实验表明,通过这些方法的协同合作,AgentInfer减少了超过50%的无效token消耗,实现了1.8-2.5倍的整体加速,同时保持了准确性。这些结果强调,优化Agent任务完成,而非仅仅是每token吞吐量,是构建可扩展、高效和自我改进的智能系统的关键。
🔬 方法详解
问题定义:现有基于LLM的Agent在实际应用中效率低下,主要体现在推理过程中的高延迟和资源消耗。传统的优化方法往往只关注单个模型的推理速度,而忽略了Agent在复杂任务中涉及的多轮交互、上下文管理以及与外部工具的协同。这些因素共同导致了系统性的性能瓶颈,阻碍了Agent的广泛部署。
核心思路:AgentInfer的核心思路是通过协同设计推理架构和系统,从整体上优化Agent的性能。它将Agent的推理过程分解为多个可优化的组件,并针对每个组件设计了相应的加速策略。通过这些策略的协同作用,AgentInfer能够有效地减少无效的计算和通信开销,提高Agent的整体效率。这种协同设计的思想强调了系统级优化的重要性,而非仅仅关注单个模型的性能。
技术框架:AgentInfer包含四个主要模块:AgentCollab、AgentSched、AgentSAM和AgentCompress。AgentCollab采用分层双模型推理框架,根据任务的复杂程度动态地选择大型或小型模型,以平衡性能和资源消耗。AgentSched是一个缓存感知的混合调度器,能够根据异构请求模式优化任务的调度顺序,减少延迟。AgentSAM是一种基于后缀自动机的推测解码方法,通过重用多会话语义记忆来加速推理过程。AgentCompress则负责异步地提炼和重组Agent的记忆,以减少上下文长度,提高推理效率。
关键创新:AgentInfer的关键创新在于其协同设计的思想和模块化的架构。它将Agent的推理过程分解为多个可优化的组件,并针对每个组件设计了相应的加速策略。这种模块化的设计使得AgentInfer具有很强的灵活性和可扩展性,可以方便地集成新的优化方法。此外,AgentInfer还引入了语义压缩和推测解码等先进技术,进一步提高了Agent的推理效率。
关键设计:AgentCollab中的动态角色分配策略,需要根据任务的复杂度和模型的性能进行调整。AgentSched中的缓存策略需要根据实际的请求模式进行优化。AgentSAM中的后缀自动机的构建和维护需要考虑计算复杂度和存储开销。AgentCompress中的语义压缩算法需要保证压缩后的信息能够保留任务相关的关键信息。这些关键设计都需要根据具体的应用场景进行调整和优化。
🖼️ 关键图片
📊 实验亮点
AgentInfer在BrowseComp-zh和DeepDiver基准测试上取得了显著的性能提升。实验结果表明,通过AgentInfer的协同优化,无效token消耗减少了超过50%,整体加速达到了1.8-2.5倍,同时保持了较高的准确性。这些结果证明了AgentInfer在提高Agent效率方面的有效性,并为构建可扩展、高效和自我改进的智能系统提供了新的思路。
🎯 应用场景
AgentInfer的潜在应用领域包括智能客服、自动化办公、智能家居、工业自动化等。通过提高Agent的效率和降低资源消耗,AgentInfer可以使得Agent能够更好地服务于人类,提高生产效率和生活质量。未来,AgentInfer还可以应用于更复杂的任务,例如自动驾驶、医疗诊断等,为人类带来更大的便利。
📄 摘要(原文)
The rapid development of large language model (LLM)-based agents has unlocked new possibilities for autonomous multi-turn reasoning and tool-augmented decision-making. However, their real-world deployment is hindered by severe inefficiencies that arise not from isolated model inference, but from the systemic latency accumulated across reasoning loops, context growth, and heterogeneous tool interactions. This paper presents AgentInfer, a unified framework for end-to-end agent acceleration that bridges inference optimization and architectural design. We decompose the problem into four synergistic components: AgentCollab, a hierarchical dual-model reasoning framework that balances large- and small-model usage through dynamic role assignment; AgentSched, a cache-aware hybrid scheduler that minimizes latency under heterogeneous request patterns; AgentSAM, a suffix-automaton-based speculative decoding method that reuses multi-session semantic memory to achieve low-overhead inference acceleration; and AgentCompress, a semantic compression mechanism that asynchronously distills and reorganizes agent memory without disrupting ongoing reasoning. Together, these modules form a Self-Evolution Engine capable of sustaining efficiency and cognitive stability throughout long-horizon reasoning tasks. Experiments on the BrowseComp-zh and DeepDiver benchmarks demonstrate that through the synergistic collaboration of these methods, AgentInfer reduces ineffective token consumption by over 50%, achieving an overall 1.8-2.5 times speedup with preserved accuracy. These results underscore that optimizing for agentic task completion-rather than merely per-token throughput-is the key to building scalable, efficient, and self-improving intelligent systems.