BunsenFeng/model_collaboration

MoCo: A One-Stop Shop for Model Collaboration Research

63

stars

316

commits

Python

primary language

Sep 9, 2026

updated

README

MoCo Logo

MoCo: A One-Stop Shop for Model Collaboration Research

MoCo is a toolkit for Model Collaboration research, where multiple language models collaborate and complement each other for compositional AI systems.

Technical report: paper

Quick Start

We use uv for package management. Install it first if you haven't already.

uv venv --python 3.11 moco
source moco/bin/activate
uv pip install -r requirements.txt
uv pip install mergekit

Run your first model collaboration experiment (if you don't have 3 GPUs, go to model_collaboration/test_config.json and set "gpu_ids": [0], [0,1], or whatever you have; if your GPU is nice, increase batch_size):

python -m model_collaboration.main -c model_collaboration/test_config.json

You will see the outputs and evaluation results in the model_collaboration/logs/ folder.

You can also directly use the PyPI package version:

moco -c model_collaboration/test_config.json --log_dir model_collaboration/logs/

Supported Methods

MoCo currently supports the following model collaboration algorithms, across API-level, text-level, logit-level, and weight-level collaboration. We provide a sample config for each method in examples/ and please check out docs/user_readme.md for more details about writing configs and the different collaboration methods implemented.

MethodCore IdeaCodeSample ConfigDoc
API: Nudgingone model guides the decoding of anotherlinklinklink
API: Prompt Routingprompt an LM to decide which model to use based on model descriptionslinklinklink
API: Switch Generationmultiple LMs take turns to generate parts of the responselinklinklink
API: Trained Routertrain an LM to route based on the dev setlinklinklink
API: Graph Routingtrain a graph neural network for routinglinklinklink
API: Cascadeuse multiple models in a cascade to improve efficiencylinklinklink
API: Mentor Collaba mentor model guides a smaller student model for generationlinklinklink
API: Co-LLMtrain LMs to defer to another model when uncertainlinklinklink
Text: Multiagent Refinemultiple LMs refine each other's answers iterativelylinklinklink
Text: Mixture of Agentsall LMs propose candidates; dev-best LM aggregates into a final answerlinklinklink
Text: Multiagent Feedbackmultiple LMs provide feedback to each other's answerslinklinklink
Text: Knowledge Cardmodels generate knowledge paragraphs to assist each otherlinklinklink
Text: LLM Blenderuse ranker and fuser LMs to combine multiple answerslinklinklink
Text: Heterogeneous Swarmsoptimize a graph of multiple LLMs for collaborationlinklinklink
Text: Majority Votemajority votelinklinklink
Text: Structured Interactionexecute a structured interaction protocol among LLMslinklinklink
Text: Multiagent Finetuningmultiple LLMs critique, debate, and refine via finetuninglinklinklink
Text: BBMASblackboard-based collaboration among LLMslinklinklink
Text: Sparta Alignmentmodels compete and combat for collective alignmentlinklinklink
Text: Stackelberg Alignmentextension of Sparta with adversarial instruction selectionlinklinklink
Text: SLM-MuxOrchestraing small modelslinklinklink
Text: AggLMRL to train a solution aggregation modellinklinklink
Logit: Logit Fusionmerge the next-token logits from multiple modelslinklinklink
Logit: Logit Contrastivecontrast the logits from best/worst modelslinklinklink
Weight: Greedy Soupiteratively consider adding each model's weights from best to worstlinklinklink
Weight: Dare Tiesthe dare-ties model merging algorithmlinklinklink
Weight: Model Swarmsparticle swarm optimization for models to search in the weight spacelinklinklink
Weight: LoraHubgradient-free optimization of lora combinationslinklinklink
Weight: ExPOmodel weight extrapolationlinklinklink

Please note that MoCo does not aim to be a reproducibility study: we adapt the core ideas behind related papers and employ what works flexibly.

Supported Data

MoCo comes with a lot of evaluation datasets built-in, and you are free to bring your own datasets, or even just generate responses only and take evaluation elsewhere. Essentially, change the task and task_type in the config to use diverse datasets. Check out link for more details.

Contributing to MoCo

We welcome contributions to MoCo!

If you are interested in contributing new model collaboration methods, check out link.

If you are interested in contributing new datasets, check out link.

If you have any suggestions, please open an issue.

MoCo-supported projects

Safety of model collaboration systems: what if one of the models is malicious? link

The single-multi evolution loop: multiple LMs collaborate, distill the collaborative system back into each individual model, and repeat for multi-LLM self-evolution. link

Citation

If MoCo is helpful for you, please consider citing:

@inproceedings{feng2026one,
  title={When one llm drools, multi-llm collaboration rules},
  author={Feng, Shangbin and Ding, Wenxuan and Liu, Alisa and Wang, Zifeng and Shi, Weijia and Wang, Yike and Shen, Shannon Zejiang and Han, Xiaochuang and Lang, Hunter and Lee, Chen-Yu and others},
  booktitle={Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  pages={17048--17063},
  year={2026}
}

@article{feng2026moco,
  title={MoCo: A One-Stop Shop for Model Collaboration Research},
  author={Feng, Shangbin and Bai, Yuyang and Yang, Ziyuan and Wang, Yike and Tan, Zhaoxuan and Yan, Jiajie and Lei, Zhenyu and Ding, Wenxuan and Shi, Weijia and Wang, Haojin and others},
  journal={arXiv preprint arXiv:2601.21257},
  year={2026}
}

Also, please cite the related papers for the methods you employed, as listed in docs/user_readme.md.

Have a nice day.

Contributors

BunsenFeng

182 commits

jiaeyan

24 commits

TamSiuhin

19 commits

Ziyuan-Yang

17 commits

BunsenFeng/model_collaboration

MoCo: A One-Stop Shop for Model Collaboration Research

63

stars

316

commits

Python

primary language

Sep 9, 2026

updated

README

MoCo Logo

MoCo: A One-Stop Shop for Model Collaboration Research

MoCo is a toolkit for Model Collaboration research, where multiple language models collaborate and complement each other for compositional AI systems.

Technical report: paper

Quick Start

We use uv for package management. Install it first if you haven't already.

uv venv --python 3.11 moco
source moco/bin/activate
uv pip install -r requirements.txt
uv pip install mergekit

Run your first model collaboration experiment (if you don't have 3 GPUs, go to model_collaboration/test_config.json and set "gpu_ids": [0], [0,1], or whatever you have; if your GPU is nice, increase batch_size):

python -m model_collaboration.main -c model_collaboration/test_config.json

You will see the outputs and evaluation results in the model_collaboration/logs/ folder.

You can also directly use the PyPI package version:

moco -c model_collaboration/test_config.json --log_dir model_collaboration/logs/

Supported Methods

MoCo currently supports the following model collaboration algorithms, across API-level, text-level, logit-level, and weight-level collaboration. We provide a sample config for each method in examples/ and please check out docs/user_readme.md for more details about writing configs and the different collaboration methods implemented.

MethodCore IdeaCodeSample ConfigDoc
API: Nudgingone model guides the decoding of anotherlinklinklink
API: Prompt Routingprompt an LM to decide which model to use based on model descriptionslinklinklink
API: Switch Generationmultiple LMs take turns to generate parts of the responselinklinklink
API: Trained Routertrain an LM to route based on the dev setlinklinklink
API: Graph Routingtrain a graph neural network for routinglinklinklink
API: Cascadeuse multiple models in a cascade to improve efficiencylinklinklink
API: Mentor Collaba mentor model guides a smaller student model for generationlinklinklink
API: Co-LLMtrain LMs to defer to another model when uncertainlinklinklink
Text: Multiagent Refinemultiple LMs refine each other's answers iterativelylinklinklink
Text: Mixture of Agentsall LMs propose candidates; dev-best LM aggregates into a final answerlinklinklink
Text: Multiagent Feedbackmultiple LMs provide feedback to each other's answerslinklinklink
Text: Knowledge Cardmodels generate knowledge paragraphs to assist each otherlinklinklink
Text: LLM Blenderuse ranker and fuser LMs to combine multiple answerslinklinklink
Text: Heterogeneous Swarmsoptimize a graph of multiple LLMs for collaborationlinklinklink
Text: Majority Votemajority votelinklinklink
Text: Structured Interactionexecute a structured interaction protocol among LLMslinklinklink
Text: Multiagent Finetuningmultiple LLMs critique, debate, and refine via finetuninglinklinklink
Text: BBMASblackboard-based collaboration among LLMslinklinklink
Text: Sparta Alignmentmodels compete and combat for collective alignmentlinklinklink
Text: Stackelberg Alignmentextension of Sparta with adversarial instruction selectionlinklinklink
Text: SLM-MuxOrchestraing small modelslinklinklink
Text: AggLMRL to train a solution aggregation modellinklinklink
Logit: Logit Fusionmerge the next-token logits from multiple modelslinklinklink
Logit: Logit Contrastivecontrast the logits from best/worst modelslinklinklink
Weight: Greedy Soupiteratively consider adding each model's weights from best to worstlinklinklink
Weight: Dare Tiesthe dare-ties model merging algorithmlinklinklink
Weight: Model Swarmsparticle swarm optimization for models to search in the weight spacelinklinklink
Weight: LoraHubgradient-free optimization of lora combinationslinklinklink
Weight: ExPOmodel weight extrapolationlinklinklink

Please note that MoCo does not aim to be a reproducibility study: we adapt the core ideas behind related papers and employ what works flexibly.

Supported Data

MoCo comes with a lot of evaluation datasets built-in, and you are free to bring your own datasets, or even just generate responses only and take evaluation elsewhere. Essentially, change the task and task_type in the config to use diverse datasets. Check out link for more details.

Contributing to MoCo

We welcome contributions to MoCo!

If you are interested in contributing new model collaboration methods, check out link.

If you are interested in contributing new datasets, check out link.

If you have any suggestions, please open an issue.

MoCo-supported projects

Safety of model collaboration systems: what if one of the models is malicious? link

The single-multi evolution loop: multiple LMs collaborate, distill the collaborative system back into each individual model, and repeat for multi-LLM self-evolution. link

Citation

If MoCo is helpful for you, please consider citing:

@inproceedings{feng2026one,
  title={When one llm drools, multi-llm collaboration rules},
  author={Feng, Shangbin and Ding, Wenxuan and Liu, Alisa and Wang, Zifeng and Shi, Weijia and Wang, Yike and Shen, Shannon Zejiang and Han, Xiaochuang and Lang, Hunter and Lee, Chen-Yu and others},
  booktitle={Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  pages={17048--17063},
  year={2026}
}

@article{feng2026moco,
  title={MoCo: A One-Stop Shop for Model Collaboration Research},
  author={Feng, Shangbin and Bai, Yuyang and Yang, Ziyuan and Wang, Yike and Tan, Zhaoxuan and Yan, Jiajie and Lei, Zhenyu and Ding, Wenxuan and Shi, Weijia and Wang, Haojin and others},
  journal={arXiv preprint arXiv:2601.21257},
  year={2026}
}

Also, please cite the related papers for the methods you employed, as listed in docs/user_readme.md.

Have a nice day.

Contributors

BunsenFeng

182 commits

jiaeyan

24 commits

TamSiuhin

19 commits

Ziyuan-Yang

17 commits

Languages

Python

100.0%