[论文解读] AIOS: LLM Agent Operating System
AIOS 提供一个由 LLM 驱动的操作系统架构,将 LLM 与操作系统功能统一起来,以管理并发的 LLM 代理,包含调度、上下文、内存、存储、工具和访问控制等模块,以及一个 SDK 和开源实现。它验证多代理执行的并发性和一致性,并报告相较于未调度执行的性能提升。
LLM-based intelligent agents face significant deployment challenges, particularly related to resource management. Allowing unrestricted access to LLM or tool resources can lead to inefficient or even potentially harmful resource allocation and utilization for agents. Furthermore, the absence of proper scheduling and resource management mechanisms in current agent designs hinders concurrent processing and limits overall system efficiency. To address these challenges, this paper proposes the architecture of AIOS (LLM-based AI Agent Operating System) under the context of managing LLM-based agents. It introduces a novel architecture for serving LLM-based agents by isolating resources and LLM-specific services from agent applications into an AIOS kernel. This AIOS kernel provides fundamental services (e.g., scheduling, context management, memory management, storage management, access control) for runtime agents. To enhance usability, AIOS also includes an AIOS SDK, a comprehensive suite of APIs designed for utilizing functionalities provided by the AIOS kernel. Experimental results demonstrate that using AIOS can achieve up to 2.1x faster execution for serving agents built by various agent frameworks. The source code is available at https://github.com/agiresearch/AIOS.
研究动机与目标
- 解决多个 LLM 代理的调度、上下文切换和资源分配。
- 通过专用的 LLM 内核将 LLM 推理与类操作系统的服务集成。
- 提供模块化组件(调度器、上下文、内存、存储、工具、访问)以及一个 LLM 系统调用接口。
- 提供一个 SDK,简化在 AIOS 框架内的代理开发。
- 通过实验展示 AIOS 的并发执行可靠性和效率。
提出的方法
- 提出三层架构:应用层、内核(OS 内核和 LLM 内核)以及硬件。
- 实现一个具备模块的 LLM 内核:代理调度器、上下文管理器、内存管理器、存储管理器、工具管理器和访问管理器。
- 暴露一个 LLM 系统调用接口,将代理请求与内核模块连接。
- 开发 AIOS SDK 以简化在 AIOS 运行时中的代理开发和交互。
- 使用多个开源 LLM 主干(Gemma-2b-it、Gemma-7b-it、LLaMA-2-13b-chat-hf)和三個代理(Math、Narrative、Rec)进行评估;使用 BLEU/BERT 和时序指标比较调度执行与非调度执行。
- 实验设置使用 Python 3.9、PyTorch 2.0.1、CUDA 11.8,在 8 块 NVIDIA RTX A5000 GPU 上进行。
实验结果
研究问题
- RQ1当代理被暂停再继续或在代理之间切换时,LLM 输出是否保持一致?
- RQ2与非调度的顺序执行相比,AIOS 调度如何影响等待时间和周转时间?
- RQ3在保持上下文和隐私的同时,AIOS 是否能高效地管理并发代理执行?
主要发现
- 在多代理并行执行与单代理执行之间,LLM 输出保持完美一致(BLEU=1.0,BERT=1.0,覆盖所有主干)。
- AIOS 调度相比于未调度执行,减少后续调度的代理请求的等待时间和周转时间,在并发下显示出更好的响应平衡。
- 该架构使在多个 LLM 主干(Gemma-2b-it、Gemma-7b-it、LLaMA-2-13b-chat-hf)之间实现一致的并发执行成为可能。
- 系统引入一个显式的 LLM 内核,具备上下文快照/恢复、内存隔离和工具访问等模块,有助于可扩展的多代理协调。
- 开源实现可在项目代码库(GitHub)获得。
- 实验结果表明,调度提高了效率,尤其是在 LLM 规模增大时以及多代理同时发出请求时。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。