Abstract
ChatDev introduces a virtual software development company powered by large language models (LLMs). By organizing specialized agents—such as CEOs, programmers, and testers—into a structured "chat chain," the framework decomposes the complex software engineering lifecycle into a series of manageable dialogues. This multi-agent collaborative approach significantly mitigates "coding hallucinations" and improves the executability and quality of generated software compared to traditional single-agent systems.
Introduction
While Large Language Models (LLMs) like GPT-4 have demonstrated remarkable capabilities in generating code snippets, synthesizing entire software systems remains a formidable challenge. A primary obstacle is "coding hallucination," where models produce syntactically plausible but logically incomplete or unexecutable code. Furthermore, traditional automated software engineering often treats design, coding, and testing as isolated tasks, leading to technical inconsistencies.
ChatDev addresses these issues by treating software development as a social, collaborative process. It establishes a virtual company where agents with distinct personas interact through natural language to move from high-level requirements to functional software.
The Chat Chain Framework
The core innovation of ChatDev is the Chat Chain, which reimagines the classic waterfall development model as a sequence of structured subtasks.
Agentization and Role-Playing
Each subtask involves two agents: an Instructor and an Assistant. Agents are assigned specific social roles via system prompts, such as a Reviewer focused on logic or a Programmer specialized in GUI design. This specialization ensures that each phase of the development cycle is handled by an "expert" persona.
Structured Dialogue
The development process is subdivided into granular steps. For instance, the "Testing" phase is split into "Code Review" (static analysis) and "System Testing" (dynamic execution). Agents engage in multi-turn dialogues until they reach a consensus, ensuring that decisions are vetted through collaborative reasoning.
Dehallucination and Memory Management
To prevent agents from making unfounded assumptions, ChatDev employs a communicative dehallucination mechanism. If a requirement is ambiguous, the Assistant agent proactively requests clarification from the Instructor. To manage context limits, the system utilizes a dual-memory approach: short-term memory for active dialogues and long-term memory to pass only finalized solutions between phases, reducing noise and computational overhead.
Evaluation and Key Results
The effectiveness of ChatDev was evaluated using the Software Requirement Description Dataset (SRDD), comprising 1,200 diverse software task prompts.
ChatDev was compared against state-of-the-art baselines, including GPT-Engineer (single-agent) and MetaGPT (multi-agent with static instructions). The results highlight significant improvements:
- Executability: ChatDev achieved an 88% executability rate, far surpassing MetaGPT (~41%) and GPT-Engineer (~36%).
- Software Quality: Using a composite metric of completeness, executability, and consistency, ChatDev (0.3953) more than doubled the performance of its competitors (~0.15).
- Efficiency: While multi-agent collaboration incurs higher token costs and takes approximately 2-3 minutes per project, the resulting software is substantially more robust and feature-rich.
Discussion and Insights
The study reveals that natural language serves as an effective bridge for high-level design, while programming languages provide the necessary ground truth for technical optimization. Assigning specific personas proved vital; for example, "GUI designer" agents autonomously implemented graphical interfaces even when not explicitly prompted.
However, limitations remain. Agents can struggle with highly complex algorithmic logic or extremely vague requirements. Additionally, the "chatty" nature of the collaboration increases computational costs. Future work will focus on enhancing agent reasoning capabilities and exploring more complex software architectures.
Conclusion
ChatDev demonstrates that the "social" collaboration of specialized LLM agents can effectively navigate the complexities of software engineering. By breaking down the development lifecycle into a communicative chat chain, the framework provides a scalable and effective path toward autonomous software generation.
Summary updated