Minstrel: Structural Prompt Generation with Multi-Agents Coordination for Non-AI Experts

Ming Wang,Yuanzhong Liu,Xiaoyu Liang,Yijie Huang,Daling Wang,Xiaocui Yang,Sijia Shen,Shi Feng,Xiaoming Zhang,Chaofeng Guan,Yifei Zhang
2024-09-20
Abstract:LLMs have demonstrated commendable performance across diverse domains. Nevertheless, formulating high-quality prompts to assist them in their work poses a challenge for non-AI experts. Existing research in prompt engineering suggests somewhat scattered optimization principles and designs empirically dependent prompt optimizers. Unfortunately, these endeavors lack a structural design, incurring high learning costs and it is not conducive to the iterative updating of prompts, especially for non-AI experts. Inspired by structured reusable programming languages, we propose LangGPT, a structural prompt design framework. Furthermore, we introduce Minstrel, a multi-generative agent system with reflection to automate the generation of structural prompts. Experiments and the case study illustrate that structural prompts generated by Minstrel or written manually significantly enhance the performance of LLMs. Furthermore, we analyze the ease of use of structural prompts through a user survey in our online community.
Computation and Language
What problem does this paper attempt to address?
### Problems the Paper Attempts to Solve The paper primarily aims to address the challenges faced by non-AI experts when using large language models (LLMs). Specifically, although LLMs perform excellently in various tasks, designing high-quality prompts to effectively utilize these models' capabilities remains a challenge for non-AI experts. Existing research proposes scattered optimization principles in prompt engineering and relies on empirical prompt optimization methods, but lacks structural design, leading to high learning costs and hindering iterative updates of prompts. To tackle this challenge, the paper proposes the following solutions: 1. **LangGPT**: A structured prompt design framework that combines the systematic and reusable characteristics of programming languages with the flexibility and scalability of natural language. 2. **Minstrel**: A multi-agent generation tool that automatically generates structured prompts based on multi-agent collaboration. Minstrel achieves automatic optimization of structured prompts through the collaboration of three working groups (analysis group, design group, and testing group). Experimental results show that both manually designed and Minstrel automatically generated structured prompts can significantly improve the performance of LLMs in executing tasks. User surveys also demonstrate the ease of use and user satisfaction with these structured prompts.