The rapid development of large language models is transforming software development. Beyond serving as code auto-completion tools in integrated development environments, large language models increasingly function as foundation models within coding agents in vibe-coding scenarios. In such settings, prompts play a central role in agent-based intelligent software development, as they not only guide the behavior of large language models but also serve as carriers of user requirements. Under the dominant conversational paradigm, prompts are typically divided into system prompts and user prompts. System prompts provide high-level instructions to steer model behavior and establish conversational context, while user prompts represent inputs and requirements provided by human users. Despite their importance, designing effective prompts remains challenging, as it requires expertise in both prompt engineering and software engineering, particularly requirements engineering. To reduce the burden of manual prompt construction, numerous automated prompt engineering methods have been proposed. However, most existing approaches neglect the methodological principles of requirements engineering, limiting their ability to generate artifacts that conform to formal requirement specifications in realistic software development scenarios. To address this gap, we propose REprompt, a multi-agent prompt optimization framework guided by requirements engineering. Experiment results demonstrate that REprompt effectively optimizes both system and user prompts by grounding prompt generation in requirements engineering principles.
翻译:大型语言模型的快速发展正在变革软件开发。除了在集成开发环境中作为代码自动补全工具外,大型语言模型日益成为氛围编码场景中编码智能体的基础模型。在此类场景中,提示在基于智能体的智能软件开发中发挥着核心作用,因为它们不仅指导大型语言模型的行为,还作为用户需求的载体。在当前主流的对话范式下,提示通常分为系统提示和用户提示:系统提示提供高层指令以引导模型行为并建立对话语境,而用户提示则代表人类用户提供的输入和需求。尽管提示至关重要,设计有效的提示仍然具有挑战性,因为这需要同时具备提示工程和软件工程(特别是需求工程)的专业知识。为减轻人工构建提示的负担,学界已提出众多自动化提示工程方法。然而,现有方法大多忽视了需求工程的方法学原则,限制了其在现实软件开发场景中生成符合形式化需求规约制品的能力。为填补这一空白,我们提出REprompt——一个基于需求工程引导的多智能体提示优化框架。实验结果表明,通过将提示生成过程锚定于需求工程原则,REprompt能有效优化系统提示与用户提示。