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支持基于LLM的应用开发,但其需要大量编程知识,因此构成了障碍。为缓解这一问题,我们提出AI链的概念,并将软件工程领域数十年来积累的最佳原则与实践引入AI链工程,以系统化AI链工程方法论。我们还开发了无代码集成开发环境Prompt Sapper,该工具能自然地将这些AI链工程原则与模式融入AI链构建过程,从而提升AI链的性能与质量。借助Prompt Sapper,AI链工程师可通过基于聊天的需求分析与可视化编程,在基础模型之上组合基于提示词的AI服务。我们的用户研究评估并验证了Prompt Sapper的效率和准确性。