Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OFA-MAS

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.

Overview

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.

Quick Start

Add API keys in template.env and change its name to .env

BASE_URL = ""  # the BASE_URL of OpenAI LLM backend
API_KEY = ""   # for OpenAI LLM backend

Run OFA-MAS Pipeline

The complete workflow consists of data processing, two-stage pre-training, fine-tuning, and evaluation.

Step 1: Data Processing

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/

Step 2: Stage 1 - Unconditional Pre-training

Train the model to understand general valid multi-agent topologies without task conditioning (task inputs are masked):

python -m experiment.OFA.pretrain_stage1_ofa

Step 3: Stage 2 - Conditional Pre-training

Train the model to generate specific graph topologies conditioned on given task embeddings:

python -m experiment.OFA.pretrain_ofa

Step 4: Fine-tuning

Fine-tune the pre-trained graph generative model on specific domains or downstream tasks:

python -m experiment.OFA.finetune_ofa

Step 5: Evaluation

Evaluate the generated Multi-Agent System topologies on downstream tasks (e.g., General Evaluation or GAIA benchmark):

python -m experiment.OFA.evaluate_ofa

Citation

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}
}

Acknowledgments

This code refers to GPTSwarm and GDesigner.

About

[WWW 2026] One-for-All Multi-agent Communication Topology Design

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages