Recent advances in artificial intelligence (AI) have produced highly capable and controllable systems. This creates unprecedented opportunities for structured reasoning as well as collaboration among multiple AI systems and humans. To fully realize this potential, it is essential to develop a principled way of designing and studying such structured interactions. For this purpose, we introduce the conceptual framework of Flows: a systematic approach to modeling complex interactions. Flows are self-contained building blocks of computation, with an isolated state, communicating through a standardized message-based interface. This modular design allows Flows to be recursively composed into arbitrarily nested interactions, with a substantial reduction of complexity. Crucially, any interaction can be implemented using this framework, including prior work on AI--AI and human--AI interactions, prompt engineering schemes, and tool augmentation. We demonstrate the potential of Flows on the task of competitive coding, a challenging task on which even GPT-4 struggles. Our results suggest that structured reasoning and collaboration substantially improve generalization, with AI-only Flows adding +$21$ and human--AI Flows adding +$54$ absolute points in terms of solve rate. To support rapid and rigorous research, we introduce the aiFlows library. The library comes with a repository of Flows that can be easily used, extended, and composed into novel, more complex Flows. The aiFlows library is available at https://github.com/epfl-dlab/aiflows. Data and Flows for reproducing our experiments are available at https://github.com/epfl-dlab/cc_flows.
翻译:近期人工智能的进展催生了高度可控且能力强大的系统。这为结构化推理以及多个人工智能系统与人类之间的协作创造了前所未有的机遇。为充分释放这一潜力,必须开发一种设计并研究此类结构化交互的原则性方法。为此,我们提出了流程的概念框架:一种对复杂交互进行建模的系统性方法。流程是自包含的计算构建模块,具有隔离的状态,并通过标准化的基于消息的接口进行通信。这种模块化设计使得流程能够递归地组合成任意嵌套的交互,从而大幅降低复杂性。关键在于,任何交互均可通过此框架实现,包括先前关于人工智能-人工智能与人类-人工智能交互、提示工程方案以及工具增强的研究。我们以具挑战性的竞赛编程任务(即使GPT-4也在此任务上表现挣扎)展示了流程的潜力。结果表明,结构化推理与协作显著提升了泛化能力:纯人工智能流程在解题率上增加了+21个绝对百分点,而人类-人工智能流程则增加了+54个绝对百分点。为支持快速严谨的研究,我们推出了aiFlows库。该库附带一个流程仓库,可便捷地使用、扩展并组合成新颖、更复杂的流程。aiFlows库可通过https://github.com/epfl-dlab/aiflows获取;复现实验所需的数据与流程可通过https://github.com/epfl-dlab/cc_flows获取。