The emergence of foundation models, such as large language models (LLMs) GPT-4 and text-to-image models DALL-E, has opened up numerous possibilities across various domains. People can now use natural language (i.e. prompts) to communicate with AI to perform tasks. While people can use foundation models through chatbots (e.g., ChatGPT), chat, regardless of the capabilities of the underlying models, is not a production tool for building reusable AI services. APIs like LangChain allow for LLM-based application development but require substantial programming knowledge, thus posing a barrier. To mitigate this, we propose the concept of AI chain and introduce the best principles and practices that have been accumulated in software engineering for decades into AI chain engineering, to systematise AI chain engineering methodology. We also develop a no-code integrated development environment, Prompt Sapper, which embodies these AI chain engineering principles and patterns naturally in the process of building AI chains, thereby improving the performance and quality of AI chains. With Prompt Sapper, AI chain engineers can compose prompt-based AI services on top of foundation models through chat-based requirement analysis and visual programming. Our user study evaluated and demonstrated the efficiency and correctness of Prompt Sapper.
翻译:基础模型(如大型语言模型GPT-4和文本到图像模型DALL-E)的出现,为各领域开辟了众多可能性。人们现在可以通过自然语言(即提示词)与AI交互以执行任务。尽管人们可通过聊天机器人(如ChatGPT)使用基础模型,但无论底层模型能力如何,聊天模式并非构建可复用AI服务的生产工具。LangChain等API允许基于大语言模型的应用开发,但需要大量编程知识,从而形成障碍。为解决此问题,我们提出AI链概念,并将软件工程数十年来积累的最佳原则与实践引入AI链工程,以系统化AI链工程方法论。我们还开发了无代码集成开发环境Prompt Sapper,该工具在构建AI链过程中自然融入上述AI链工程原则与模式,从而提升AI链的性能与质量。借助Prompt Sapper,AI链工程师可通过基于聊天的需求分析与可视化编程,在基础模型之上组合基于提示词的AI服务。我们的用户研究评估并证明了Prompt Sapper的高效性与正确性。