Papers › Optimizing Model Selection for Compound AI Systems

Optimizing Model Selection for Compound AI Systems

20 Feb 2025arXiv:2502.14815archive 2025-07-28

Lingjiao Chen, Jared Quincy Davis, Boris Hanin, Peter Bailis, Matei Zaharia, James Zou, Ion Stoica

Compound AI systems that combine multiple LLM calls, such as self-refine and multi-agent-debate, achieve strong performance on many AI tasks. We address a core question in optimizing compound systems: for each LLM call or module in the system, how should one decide which LLM to use? We show that these LLM choices have a large effect on quality, but the search space is exponential. We propose LLMSelector, an efficient framework for model selection in compound systems, which leverages two key empirical insights: (i) end-to-end performance is often monotonic in how well each module performs, with all other modules held fixed, and (ii) per-module performance can be estimated accurately by an LLM. Building upon these insights, LLMSelector iteratively selects one module and allocates to it the model with the highest module-wise performance, as estimated by an LLM, until no further gain is possible. LLMSelector is applicable to any compound system with a bounded number of modules, and its number of API calls scales linearly with the number of modules, achieving high-quality model allocation both empirically and theoretically. Experiments with popular compound systems such as multi-agent debate and self-refine using LLMs such as GPT-4o, Claude 3.5 Sonnet and Gemini 1.5 show that LLMSelector confers 5%-70% accuracy gains compared to using the same LLM for all modules.

PaperPDFCodeCode 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.14815")

Code

Syntology Ran 1 of 10 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 1 ran · our draft was wrong.

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

LLMSELECTOR/LLMSELECTOR officialApache-2.0 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

10 samples harvested; 1 ran; 0 honoured the contract we drafted; 9 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 · our draft was wrong
9unverified

Licence: 0 of the 10 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 LLMSELECTOR/LLMSELECTOR. “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.

strip_latex LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/metric.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 0892f960b112ef52 · report
Get_Generate LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/llm.py official repository unverified Apache-2.0 (permissive) · 96362ca151f15497 · report
compute_score LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/metric.py official repository unverified Apache-2.0 (permissive) · 075a2a4962fab858 · report
compute_tag LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/metric.py official repository unverified Apache-2.0 (permissive) · 1a27128efa695483 · report
extract_ans LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/module/debate.py official repository unverified Apache-2.0 (permissive) · ae7782a357cf3a90 · report
extract_ans LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/module/majorityvote.py official repository unverified Apache-2.0 (permissive) · 4ec0ffdf43c1c1c5 · report
extract_final_answer LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/diagnoser.py official repository unverified Apache-2.0 (permissive) · 5672cff2de3b190b · report
my_decode LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/llm.py official repository unverified Apache-2.0 (permissive) · 05b617dbf3b25a2a · report
my_encode LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/llm.py official repository unverified Apache-2.0 (permissive) · f2fc23dea676ed77 · report
resize_to_max_pixels LLMSELECTOR/LLMSELECTOR/llmselector/llmselector/compoundai/module/directgen.py official repository unverified Apache-2.0 (permissive) · d957a2e9f35bc763 · report

Tasks

Model Selectionmodel

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