多智能体编程中的对话模式理解:以斐波那契游戏开发为例
Understanding Conversational Patterns in Multi-agent Programming: A Case Study on Fibonacci Game Development
AI总结:
本文通过分析12种开源LLM组合中设计者与程序员智能体的对话,揭示了多智能体交互的效率、一致性和有效性三个关键维度,发现DeepSeek-R1:DeepSeek-R1对能从首次迭代起稳定收敛到正确解,而其他组合则存在发散或错误共识问题。
摘要:
大型语言模型(LLM)越来越多地应用于软件工程(SE),但它们在自主、面向角色的协作方面的潜力仍远未得到充分探索。理解多个基于LLM的智能体如何协调、保持角色对齐并收敛到解决方案对SE至关重要,因为简单地让智能体交互并不能可靠地产生正确或稳定的结果。最近的实证研究表明,非结构化或理解不足的交互动态可能导致错误传播、对错误解决方案的过早共识,或阻止收敛的长期分歧,即使在交互早期存在正确的部分解决方案。作为解决这一未被充分探索领域的初步步骤,我们对两个智能体(设计者和程序员)之间的对话进行了系统分析,涉及来自7个开源LLM(Gemma 2、Gemma 3、LLaMA 3.2、LLaMA 3.3、DeepSeek-R1、MiniCPM和Qwen3)的12种模型组合。我们的系统方法揭示了多智能体交互的三个关键维度:效率(收敛的速度和稳定性)、一致性(通过BLEU和ROUGE可视化的角色对齐程度)和有效性(编译成功和错误解决的程度)。结果表明,DeepSeek-R1:DeepSeek-R1对从第一次迭代起就独特地收敛到正确解,并一致地保持到最终迭代,而LLaMA 3.2:LLaMA 3.2和Qwen3:Qwen3对尽管偏离了正确解,但表现出强烈的设计者:程序员角色对齐。其他对偏离了任务,从未收敛到结果。这些发现推进了对智能体编程的理解,并强调了进一步研究理解和校准收敛及停止条件的必要性,这对于未来的自主SE至关重要。
英文摘要:
Large Language Models (LLMs) are increasingly applied to software engineering (SE), yet their potential for autonomous, role-oriented collaboration remains largely underexplored. Understanding how multiple LLM-based agents coordinate, maintain role alignment, and converge on solutions is critical for SE, as naively allowing agents to interact does not reliably lead to correct or stable outcomes. Recent empirical studies show that unstructured or poorly understood interaction dynamics can result in error propagation, premature consensus on incorrect solutions, or prolonged disagreement that prevents convergence, even when correct partial solutions are present early in the interaction. As an initial step towards addressing this underexplored area, we undertake a systematic analysis of conversations between two agents, a Designer and a Programmer across 12 model combinations from 7 open-source LLMs (Gemma 2, Gemma 3, LLaMA 3.2, LLaMA 3.3, DeepSeek-R1, MiniCPM, and Qwen3). Our systematic approach reveals three key dimensions of multi-agent interaction: efficiency (the speed and stability of convergence), consistency (the degree of role alignment visualized by BLEU and ROUGE), and effectiveness (the extent of compilation success and error resolution). Results show that the DeepSeek-R1:DeepSeek-R1 pair was unique in converging to the correct solution from the very first iteration and sustaining it consistently to the final iteration, while LLaMA 3.2:LLaMA 3.2 and Qwen3:Qwen3 demonstrated strong Designer:Programmer role alignment despite of diverging from the correct solution. The other pairs deviated from the task, never to converge to a result. These findings advance understanding of agentic programming and highlight the need for further research on understanding and calibrating convergence and stop conditions essential for future autonomous SE.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。