AIOS编译器:将LLM作为解释器用于AI智能体的自然语言编程与流程编程
AIOS Compiler: LLM as Interpreter for Natural Language Programming and Flow Programming of AI Agents
AI总结:
本文提出CoRE系统,利用LLM作为解释器,统一自然语言、伪代码和流程编程,构建语言智能体,并引入外部记忆和工具调用以增强执行能力。
摘要:
自编程语言诞生以来,其发展趋势一直是提高可读性并降低程序员的入门门槛。顺应这一趋势,自然语言有望成为一种极具灵活性和易用性的编程语言,有助于实现编程的民主化。然而,自然语言固有的模糊性、歧义性和冗长性给开发一个能够准确理解编程逻辑并执行用自然语言编写的指令的解释器带来了重大挑战。幸运的是,大型语言模型(LLM)的最新进展已展现出在解释复杂自然语言方面的卓越能力。受此启发,我们开发了一个用于代码表示与执行(CoRE)的新颖系统,该系统采用LLM作为解释器来理解和执行自然语言指令。所提出的系统将自然语言编程、伪代码编程和流程编程统一在同一表示之下,用于构建语言智能体,同时LLM作为解释器来解析和执行智能体程序。在本文中,我们首先定义了将自然语言指令结构化组织的编程语法。在执行过程中,我们引入外部记忆以减少冗余。此外,我们为所设计的解释器配备了调用外部工具的能力,以弥补LLM在专业领域或获取实时信息时的局限性。本工作已开源,代码可在https://github.com/agiresearch/CoRE、https://github.com/agiresearch/OpenAGI和https://github.com/agiresearch/AIOS获取。
英文摘要:
Since their inception, programming languages have trended towards greater readability and lower barriers for programmers. Following this trend, natural language can be a promising type of programming language that provides great flexibility and usability and helps towards the democracy of programming. However, the inherent vagueness, ambiguity, and verbosity of natural language pose significant challenges in developing an interpreter that can accurately understand the programming logic and execute instructions written in natural language. Fortunately, recent advancements in Large Language Models (LLMs) have demonstrated remarkable proficiency in interpreting complex natural language. Inspired by this, we develop a novel system for Code Representation and Execution (CoRE), which employs LLM as interpreter to interpret and execute natural language instructions. The proposed system unifies natural language programming, pseudo-code programming, and flow programming under the same representation for constructing language agents, while LLM serves as the interpreter to interpret and execute the agent programs. In this paper, we begin with defining the programming syntax that structures natural language instructions logically. During the execution, we incorporate external memory to minimize redundancy. Furthermore, we equip the designed interpreter with the capability to invoke external tools, compensating for the limitations of LLM in specialized domains or when accessing real-time information. This work is open-source at https://github.com/agiresearch/CoRE, https://github.com/agiresearch/OpenAGI, and https://github.com/agiresearch/AIOS.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。