MAS-on-the-Fly: In-Context Structural Adaptation of LLM-Based Multi-Agent Systems

Guangyi Liu, Linhaojun, Zenghuan, Heng Wang, Quanming Yao


Abstract
Large Language Model (LLM)-based multi-agent systems (MAS) have emerged as a promising paradigm for complex tasks. However, existing works often rely on manual designs or “one-size-fits-all” automation and lack adaptability after deployment. We study in-context structural adaptation, where structured experience conditions both query-dependent system generation and execution-time reconfiguration without updating LLM parameters. We introduce MASFly, which realizes this adaptation through two complementary mechanisms. First, a retrieval-augmented SOP instantiation mechanism retrieves and adapts successful collaboration patterns to construct a query-specific MAS. Second, an experience-enhanced process supervision mechanism uses a dedicated Watcher agent to monitor execution against prior failure experience and reconfigure the system upon abnormal behavior. Experiments demonstrate that MASFly achieves state-of the-art performance, including a 61.7% success rate on TravelPlanner, with strong task adaptability and robustness.
Anthology ID:
2026.emnlp-main.187
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
4282–4303
Language:
URL:
https://aclanthology.org/2026.emnlp-main.187/
DOI:
Bibkey:
Cite (ACL):
Guangyi Liu, Linhaojun, Zenghuan, Heng Wang, and Quanming Yao. 2026. MAS-on-the-Fly: In-Context Structural Adaptation of LLM-Based Multi-Agent Systems. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 4282–4303, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
MAS-on-the-Fly: In-Context Structural Adaptation of LLM-Based Multi-Agent Systems (Liu et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.187.pdf