Justin Chih-Yao Chen* | Sukwon Yun* | Elias Stengel-Eskin* | Tianlong Chen | Mohit Bansal
*Equal contribution
This repository contains the implementation of Symbolic Mixture-of-Experts, a novel approach for adaptive skill-based routing to enable scalable heterogeneous reasoning across multiple domains.
This repository is tested on Python 3.10.12. All dependencies can be installed as follows:
pip install -r requirements.txt--task: Specifies which dataset to run. Options include:MMLU_ProAIME24GPQAMedMCQA
--gpus: Number of GPUs to use for the experiment--seed: Random seed for reproducibility
Annotate keywords for the validation and testing data:
python annotate_keywords.pyCreate profiles for all models:
- Edit
run_create_profile.shto ensure that the--taskand--gpusarguments are correct - Run the script:
bash run_create_profile.shCreate the aggregator benchmark for all models:
- Edit
run_bench_aggr.shto ensure that the--taskand--gpusarguments are correct - Run the script:
bash run_aggr_bench.shRecruit experts for each instance:
python recruit_agents.py --task GPQA --seed 0Generate the initial responses from the k experts:
CUDA_VISIBLE_DEVICES=0 python expert_inference.py --task GPQA --gpus 1 --seed 0Use the aggregator to generate the final output and evaluate the results:
CUDA_VISIBLE_DEVICES=0 python aggregate.py --task GPQA --aggregator QwenR1 --gpus 1 --seed 0The aggregator we use for each task can be found in the following table (and Table 9 in the paper):
| Dataset | Model |
|---|---|
| MMLU-Pro | LlamaR1 |
| AIME | QwenR1 |
| GPQA | QwenR1 |
| MedMCQA | Qwen |
You can skip Steps 1-4 by downloading the stored outputs here (Google Drive).
Extract all files in skill.zip and placing all the folders in the root directory of this project:
unzip skill.zipAfter extraction, you can proceed directly to Steps 5-7 to complete the experiment.
If you find this work useful, please consider citing us:
@article{chen2025skillmoe,
title={Skill-Based Mixture-of-Experts: Adaptive Routing for Heterogeneous Reasoning via Inferred Skills},
author={Chen, Justin Chih-Yao and Yun, Sukwon and Stengel-Eskin, Elias and Chen, Tianlong and Bansal, Mohit},
journal={arXiv preprint arXiv:2503.05641},
year={2025}
}