Flows: Building Blocks of Reasoning and Collaborating AI
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.
Introduction. Scaling up language models has brought about a revolutionary transformation in the field of artificial intelligence (AI) [6, 12]. In particular, the success of large language models (LLMs) lies in their remarkable emergent ability to adapt to information within their context (i.e., prompt) [6, 21, 47]. By strategically crafting the context, LLMs can be conditioned to perform complex reasoning [31, 47] and effectively utilize external tools [40], significantly enhancing their capabilities. Some of the most exciting recent developments involve defining control flows, wherein an LLM controls a set of tools, orchestrated to solve increasingly complex tasks. Examples of such control flows include ReAct[50], AutoGPT [36], or BabyAGI [30]. However, these examples represent but a few of the many conceivable control flows, offering only a glimpse into the vast potential of structured LLM interactions. To fully realize this potential, it is essential to develop principled ways of designing and studying such interactions.
Discussion / Conclusion. Simplicity in implementation and design. The encapsulated Flow state and the standardized message-based interface between Flows make Flows highly modular. From the practical perspective, as demonstrated in our experiments, this results in a substantial (i) reduction of complexity in the design and implementation of open-ended interactions; (ii) flexibility in composing and swapping sub-Flows, making it easy to add complexity in a controlled manner. Furthermore, FlowViz simplifies development by offering an intuitive way to inspect Flow execution, while FlowVerse provides a repository of Flows that can be readily used in isolation or as a starting point in developing new Flows or extending existing ones. Meta-reasoning Flows supporting autonomous behavior. In our experiments, we focus on the ability to design and implement Flows defining a complex but completely specified behavior.