一句话:提出首个基于需求开发与形式化的多智能体框架 ReDeFo,以形式规约衔接自然语言需求与可执行代码,保障生成代码可靠性。
自动代码生成长期被视为软件工程的圣杯,大语言模型(LLM)的出现推动了该领域的突破性进展。然而,现有仅依赖 LLM 的方法生成的代码质量仍不足,无法保证满足实际需求,且缺乏系统的需求开发与建模策略。近期基于 LLM 的智能体展现出强大能力,有助于使 LLM 输出与用户需求对齐。本文提出首个面向可靠代码生成的多智能体框架 ReDeFo,其核心是将需求开发与形式化相结合。该框架包含三个智能体,并将形式化方法的知识与技术融入从需求到代码的生成流水线,以加强质量保障。ReDeFo 的关键在于使用形式规约弥合可能含糊的自然语言需求与精确可执行代码之间的鸿沟,从而支持对正确性的严格推理、发现隐藏缺陷,并在整个开发过程中强制满足关键性质。
Automated code generation has long been considered the holy grail of software engineering. The emergence of Large Language Models (LLMs) has catalyzed a revolutionary breakthrough in this area. However, existing methods that only rely on LLMs remain inadequate in the quality of generated code, offering no guarantees of satisfying practical requirements. They lack a systematic strategy for requirements development and modeling. Recently, LLM-based agents typically possess powerful abilities and play an essential role in facilitating the alignment of LLM outputs with user requirements. In this paper, we envision the first multi-agent framework for reliable code generation based on Requirements Development and Formalization, named ReDeFo. This framework incorporates three agents, highlighting their augmentation with knowledge and techniques of formal methods, into the requirements-to-code generation pipeline to strengthen quality assurance. The core of ReDeFo is the use of formal specifications to bridge the gap between potentially ambiguous natural language requirements and precise executable code. ReDeFo enables rigorous reasoning about correctness, uncovering hidden bugs, and enforcing critical properties throughout the development process.
DOI 原文 ·
@inproceedings{paperbot9538,
title = {Requirements Development and Formalization for Reliable Code Generation: A Multi-Agent Vision},
author = {Xu Lu and Weisong Sun and Yiran Zhang and Ming Hu and Cong Tian and Zhi Jin and Yang Liu},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00345}
}