Papers › Heterogeneous Swarms: Jointly Optimizing Model Roles and Weights for Multi-LLM Systems

Heterogeneous Swarms: Jointly Optimizing Model Roles and Weights for Multi-LLM Systems

6 Feb 2025arXiv:2502.04510archive 2025-07-28

Shangbin Feng, Zifeng Wang, Palash Goyal, Yike Wang, Weijia Shi, Huang Xia, Hamid Palangi, Luke Zettlemoyer, Yulia Tsvetkov, Chen-Yu Lee, Tomas Pfister

We propose Heterogeneous Swarms, an algorithm to design multi-LLM systems by jointly optimizing model roles and weights. We represent multi-LLM systems as directed acyclic graphs (DAGs) of LLMs with topological message passing for collaborative generation. Given a pool of LLM experts and a utility function, Heterogeneous Swarms employs two iterative steps: role-step and weight-step. For role-step, we interpret model roles as learning a DAG that specifies the flow of inputs and outputs between LLMs. Starting from a swarm of random continuous adjacency matrices, we decode them into discrete DAGs, call the LLMs in topological order, evaluate on the utility function (e.g. accuracy on a task), and optimize the adjacency matrices with particle swarm optimization based on the utility score. For weight-step, we assess the contribution of individual LLMs in the multi-LLM systems and optimize model weights with swarm intelligence. We propose JFK-score to quantify the individual contribution of each LLM in the best-found DAG of the role-step, then optimize model weights with particle swarm optimization based on the JFK-score. Experiments demonstrate that Heterogeneous Swarms outperforms 15 role- and/or weight-based baselines by 18.5% on average across 12 tasks. Further analysis reveals that Heterogeneous Swarms discovers multi-LLM systems with heterogeneous model roles and substantial collaborative gains, and benefits from the diversity of language models.

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2502.04510")

Code

Syntology Ran 9 of 13 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · our draft was wrong; 6 ran · fixture could not drive it.

By repository: found in paper text by Syntology: 13 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

BunsenFeng/heterogeneous_swarm found in paper text by Syntology report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

13 samples harvested; 9 ran; 1 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
2ran · our draft was wrong
6ran · fixture could not drive it
4unverified

Licence: 13 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from BunsenFeng/heterogeneous_swarm. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

assign_gpu BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · honoured contract fingerprinted no licence file found · pointer only · 4efc4f340a8c12ee · report
batch_generate BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · fixture could not drive it no licence file found · pointer only · 2a9ac558452970b5 · report
batch_generate_chat_template BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · fixture could not drive it no licence file found · pointer only · e39027f28fba78ae · report
graph_decode BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · fixture could not drive it no licence file found · pointer only · c2840c3ed37c731c · report
multiple_choice_answer_parsing BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · our draft was wrong no licence file found · pointer only · babad0e4877852b6 · report
multiple_choice_prompt BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · our draft was wrong no licence file found · pointer only · 4ffba672bf62f870 · report
softmax BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · fixture could not drive it fingerprinted no licence file found · pointer only · 380f691b7059126a · report
top_p_sampling_selection BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · fixture could not drive it no licence file found · pointer only · 56b551b6ea8c8892 · report
topological_sort BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology ran · fixture could not drive it no licence file found · pointer only · 9e81861a2b61b612 · report
evaluate BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology unverified no licence file found · pointer only · c3251894d6a5c6ec · report
get_gpu_memory_in_gb BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology unverified no licence file found · pointer only · 393290bc3ad879ee · report
graph_generate BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology unverified no licence file found · pointer only · fe99d09909adebc7 · report
node_evaluate BunsenFeng/heterogeneous_swarm/search.py found in paper text by Syntology unverified no licence file found · pointer only · 37e76befc6431d2f · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections