Prompt Sapper: LLM-Empowered Software Engineering Infrastructure for AI-Native Services

Zhenchang Xing, Qing Huang, Yu Cheng, Liming Zhu, Qinghua Lu, Xiwei XuarXiv 2023 · DOI

Introduction

The emergence of Large Language Models (LLMs) like GPT-4 has ushered in a new era of artificial intelligence. However, developing reliable and complex AI-native services remains a "black art." Developers often rely on "prompt magic"—long, brittle text strings that lack the discipline of traditional software engineering. Furthermore, a significant "bottleneck of personal AI" exists: while foundation models (FMs) act as a new AI operating system, non-technical domain experts lack the high-level programming environments needed to build their own services. Prompt Sapper addresses these challenges by providing a systematic infrastructure for "human-AI collaborative intelligence."

The Evolution to Software 3.0

The authors define a paradigm shift in how software is constructed. Software 1.0 relies on manual code, while Software 2.0 involves neural networks learned from data. Prompt Sapper introduces Software 3.0, where "prompt-as-code" allows users to express intent directly in natural language (NL).

Software 1.0/2.0: Traditional programming and neural network learning paradigms.

In the Software 3.0 paradigm, the traditional program is replaced by an AI Chain, which mediates between a diverse range of users and foundation models. Prompt Sapper fills the critical gap in methodology and tooling that currently hinders this transition.

Software 3.0: AI-native services built via AI chains and natural language.

Methodology: AI Chain Engineering

Prompt Sapper is built upon three pillars designed to transform ad-hoc prompting into a disciplined engineering process:

  1. Promptmanship: A four-stage iterative methodology (Explore, Design, Build, Deploy) that adapts traditional software engineering concepts like requirements analysis and task decomposition to LLMs.
  2. Sapper IDE: A no-code/low-code environment that utilizes LLM "co-pilots" to assist users in analyzing requirements and decomposing complex tasks into modular "workers."
  3. AI Services Marketplace: A platform for sharing and composing AI-native services, extending the collaborative spirit of repositories like GitHub to the AI era.

The technical core is the AI Chain. Rather than using a single "epic prompt," services are broken into modular workers handling specific sub-tasks (e.g., sentiment analysis or summarization). This modularity ensures transparency, testability, and easier debugging.

Key Insights

  • Mechanical Sympathy: Effective AI chain engineers must understand the quirks and capabilities of LLMs, much like high-performance programmers understand hardware.
  • Modularization vs. LLM Maximalism: Breaking tasks into chains prevents the errors associated with asking an AI to perform overly complex tasks in a single step.
  • Human-Centric AI: Prompt Sapper occupies the middle ground between purely human-driven chat and fully autonomous agents, emphasizing human control over high-level requirements and acceptance.

Evaluation and Future Work

The authors demonstrate the utility of Prompt Sapper through various showcase services, such as mental health assistants and movie recommendation tools. These examples highlight that complex logic can be built more intuitively through AI chains than traditional Python code, which often requires managing numerous libraries and APIs.

While Prompt Sapper successfully democratizes AI service creation, future research is needed to address the "DevOps" of AI chains, the inherent ambiguity of natural language intent, and the integration of robust "Responsible AI" features like automated risk assessments.

Summary updated

BibTeX
@misc{xing2023prompt,
  author = {Zhenchang Xing and Qing Huang and Yu Cheng and Liming Zhu and Qinghua Lu and Xiwei Xu},
  title = {{Prompt Sapper: LLM-Empowered Software Engineering Infrastructure for AI-Native Services}},
  year = {2023},
  eprint = {2306.02230},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.02230},
}
Figure