Official implementation of "OFA-MAS: One-for-All Multi-Agent System Topology Design based on Mixture-of-Experts Graph Generative Models", accepted by WWW 2026.
Existing multi-agent systems typically rely on manually designed communication topologies and fixed roles, making it challenging to adapt to diverse and complex tasks. We propose OFA-MAS (One-for-All Multi-Agent System), a novel framework that frames multi-agent system design as a conditional autoregressive graph generation task. Utilizing a Mixture-of-Experts (MoE) graph generative model, OFA-MAS automatically determines the optimal agent composition and directed communication structures dynamically for any given task.
BASE_URL = "" # the BASE_URL of OpenAI LLM backend
API_KEY = "" # for OpenAI LLM backendThe complete workflow consists of data processing, two-stage pre-training, fine-tuning, and evaluation.
Convert LLM-generated JSONL data into PyTorch Geometric graph data and pre-compute role embeddings:
python -m experiment.OFA.process_llm_data --input_file experiment/OFA/llm_generated_ofa_data.jsonl --output_dir ../PTData/Train the model to understand general valid multi-agent topologies without task conditioning (task inputs are masked):
python -m experiment.OFA.pretrain_stage1_ofaTrain the model to generate specific graph topologies conditioned on given task embeddings:
python -m experiment.OFA.pretrain_ofaFine-tune the pre-trained graph generative model on specific domains or downstream tasks:
python -m experiment.OFA.finetune_ofaEvaluate the generated Multi-Agent System topologies on downstream tasks (e.g., General Evaluation or GAIA benchmark):
python -m experiment.OFA.evaluate_ofa
If you compare with, build on, or use aspects of this work, please cite the following:
@inproceedings{li2026ofa,
title={OFA-MAS: One-for-All Multi-Agent System Topology Design based on Mixture-of-Experts Graph Generative Models},
author={Li, Shiyuan and Liu, Yixin and Zheng, Yu and Li, Mei and Nguyen, Quoc Viet Hung and Pan, Shirui},
booktitle={Proceedings of the ACM Web Conference 2026},
pages={1333--1344},
year={2026}
}