We introduce a new approach to agent programming, the development of LLM-based agents. Current approaches to agent programming often entangle two aspects of agent design: the core workflow logic and the inference-time strategy (e.g., tree search). We introduce "probabilistic angelic nondeterminism" ("PAN"), a programming model that disentangles these two concerns, allowing the programmer to describe the agent workflow and independently experiment with different inference-time strategies by simply changing a few inputs. We provide an implementation of PAN in Python as the EnCompass framework, which uses a Python decorator to compile agent workflow programs into a search space. We present three case studies that demonstrate how the framework lets the programmer quickly improve the reliability of an agent and easily switch between different inference-time strategies, all with little additional coding.
翻译:我们提出了一种新的智能体编程方法,用于开发基于大语言模型(LLM)的智能体。当前智能体编程方法通常将智能体设计的两个层面混为一谈:核心工作流逻辑与推理时策略(例如树搜索)。我们引入“概率天使非确定性”(“PAN”)编程模型,该模型将这两个关注点解耦,使程序员能够描述智能体工作流,并通过仅修改少量输入即可独立实验不同的推理时策略。我们在Python中实现了PAN,即EnCompass框架,该框架使用Python装饰器将智能体工作流程序编译为搜索空间。我们通过三个案例研究展示该框架如何使程序员能够快速提升智能体的可靠性,并轻松在不同推理时策略间切换,所有这些仅需少量额外编码。