Towards Engineering Multi-Agent LLMs: A Protocol-Driven Approach
Zhenyu Mao, Jacky Keung, Fengji Zhang, Shuo Liu, Yifei Wang, Jialong Li
TL;DR
The paper tackles the fragility of multi-agent LLMs in software engineering by introducing SEMAP, a protocol layer that enforces explicit behavioral contracts, structured messaging, and lifecycle guided execution with verification atop the A2A infrastructure. By instantiating design by contract, semantically typed communication, and state-machine driven task control, SEMAP mitigates under-specification, coordination misalignment, and improper verification observed in prior MAS LLM frameworks. Empirical results across function-level and deployment-level code development as well as vulnerability detection show substantial reductions in failure counts, with up to 69.6% fewer failures in function-level development and meaningful reductions in vulnerability tasks, demonstrating improved robustness and stability across collaboration rounds. The contributions offer a scalable, domain-specialized protocol that enhances reliability of automated SE workflows and provide a pathway for extensibility to larger datasets, deeper workflows, and formal protocol verification.
Abstract
The increasing demand for software development has driven interest in automating software engineering (SE) tasks using Large Language Models (LLMs). Recent efforts extend LLMs into multi-agent systems (MAS) that emulate collaborative development workflows, but these systems often fail due to three core deficiencies: under-specification, coordination misalignment, and inappropriate verification, arising from the absence of foundational SE structuring principles. This paper introduces Software Engineering Multi-Agent Protocol (SEMAP), a protocol-layer methodology that instantiates three core SE design principles for multi-agent LLMs: (1) explicit behavioral contract modeling, (2) structured messaging, and (3) lifecycle-guided execution with verification, and is implemented atop Google's Agent-to-Agent (A2A) infrastructure. Empirical evaluation using the Multi-Agent System Failure Taxonomy (MAST) framework demonstrates that SEMAP effectively reduces failures across different SE tasks. In code development, it achieves up to a 69.6% reduction in total failures for function-level development and 56.7% for deployment-level development. For vulnerability detection, SEMAP reduces failure counts by up to 47.4% on Python tasks and 28.2% on C/C++ tasks.
