Papers › Pack of LLMs: Model Fusion at Test-Time via Perplexity Optimization

Pack of LLMs: Model Fusion at Test-Time via Perplexity Optimization

17 Apr 2024arXiv:2404.11531archive 2025-07-28

Costas Mavromatis, Petros Karypis, George Karypis

Fusing knowledge from multiple Large Language Models (LLMs) can combine their diverse strengths to achieve improved performance on a given task. However, current fusion approaches either rely on learning-based fusers that do not generalize to new LLMs, or do not take into account how well each LLM understands the input. In this work, we study LLM fusion at test-time, which enables leveraging knowledge from arbitrary user-specified LLMs during inference. We introduce Pack of LLMs (PackLLM), an effective method for test-time fusion that leverages each LLM's expertise, given an input prompt. PackLLM performs model fusion by solving an optimization problem for determining each LLM's importance, so that perplexity over the input prompt is minimized. First, our simple PackLLM-sim variant validates that perplexity is a good indicator for measuring each LLM's expertise. Second, our PackLLM-opt variant approximately solves the perplexity minimization problem via a greedy algorithm. The derived importance weights are used to combine the LLMs during inference. We conduct experiments with over 100 total LLMs on a diverse set of tasks. Experimental results show that (i) perplexity is a reliable measure for LLM fusion, (ii) PackLLM outperforms test-time fusion baselines by 1.89% accuracy points, and (iii) PackLLM can leverage new LLMs to improve performance over learning-based fusion approaches by 3.92-11.94% accuracy points.

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="2404.11531")

Code

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

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

cmavro/packllm officialmentioned in paperpytorch 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; 6 ran; 0 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 · our draft was wrong
5ran
4unverified

Licence: 10 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 cmavro/packllm. “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.

format_dataset cmavro/packllm/downstream_tasks/get_task.py official repository ran no licence file found · pointer only · 82fab1f6e6bddec2 · report
mean_pooling cmavro/packllm/downstream_tasks/utils.py official repository ran · our draft was wrong no licence file found · pointer only · 77f69af078e09830 · report
prepro_sentence_pair cmavro/packllm/downstream_tasks/icl_data.py official repository ran no licence file found · pointer only · faa9fbf7cc4e66c1 · report
prepro_sentence_pair_single cmavro/packllm/downstream_tasks/icl_data.py official repository ran no licence file found · pointer only · 1f230cbd5842e2ab · report
process_mmlu_examples cmavro/packllm/downstream_tasks/get_task.py official repository ran no licence file found · pointer only · 99a5947cc60a3cb3 · report
process_openbookqa_examples cmavro/packllm/downstream_tasks/get_task.py official repository ran no licence file found · pointer only · dc07ce32fc4a428a · report
calculate_sentence_transformer_embedding cmavro/packllm/downstream_tasks/utils.py official repository unverified no licence file found · pointer only · c0016ed0e6b96ff4 · report
calculate_sentence_transformer_embedding_m cmavro/packllm/downstream_tasks/utils.py official repository unverified no licence file found · pointer only · ce4a54944b0f471c · report
get_instance_length cmavro/packllm/downstream_tasks/prompt_retrieval.py official repository unverified no licence file found · pointer only · ddf793183ffe3659 · report
setup_fp16 cmavro/packllm/downstream_tasks/icl_model.py official repository unverified no licence file found · pointer only · cbf1d84d85c303cc · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SET

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