MERGE: Multi-LLM Ensemble for Retrieval via Generative Enrichment
Organizations: University of Waterloo · National Taiwan University · Rakuten Group, Inc. · Rakuten Asia Pte. Ltd.
Abstract
Large Language Models (LLMs) are increasingly used to enrich user queries in information retrieval (IR) so that a standard retriever such as BM25 can bridge vocabulary gaps with the target corpus. Any single LLM, however, is limited by its training data and architectural biases, and its enrichment behavior depends on hand-crafted prompts that must be re-engineered for each new model -- an expensive and poorly scalable process. We present MERGE (Multi-LLM Ensemble for Retrieval via Generative Enrichment), a two-stage framework: three heterogeneous 7-8B open-source LLMs independently produce candidate expansions, and a larger LLM generatively synthesizes them into a single query. To make prompt engineering scalable across the ensemble, we integrate a task-grounded Automatic Prompt Optimization (APO) loop into both stages. Unlike APO methods that judge candidates with an LLM evaluator, our loop scores each candidate by its downstream retrieval performance and runs a small tournament between the current champion prompt and optimizer-proposed drafts, terminating once the champion survives two consecutive rounds; a history-augmented variant additionally feeds the recent tournament trajectory back to the optimizer. MERGE is retriever-agnostic and issues a single BM25 pass with no rank fusion, no supervised document expansion, and no re-indexing. On five BEIR benchmarks (NQ, SciFact, FiQA, Touche-2020, DBPedia), MERGE improves BM25 nDCG@10 over the original queries by +2.1 to +14.9 points and matches or outperforms strong LLM-based query-expansion baselines despite using only compact open-source models. Ablations confirm that the Stage-2 ensemble beats any single Stage-1 LLM, and that task-grounded APO converts large seed-prompt regressions into consistent gains without hand-tuning.
Figures & tables
| Method | NQ | SciFact | FiQA | Touché-2020 | DBPedia |
|---|---|---|---|---|---|
| Vanilla BM25 (original query) | 30.48 | 67.62 | 23.85 | 44.23 | 31.99 |
| + docT5query | (38.10) | (67.50) | (25.20) | (34.70) | (33.10) |
| + BM25 + Exp4Fuse | (39.10) | (68.80) | (24.70) | (51.20) | (36.10) |
| + docT5query + Exp4Fuse | (42.80) | ( 71.30 ) | ( 26.30 ) | (39.90) | ( 38.90 ) |
| + MERGE w/o APO | 34.52 | 67.79 | 19.41 | 38.69 | 33.59 |
| + MERGE (APO) | 45.42 | 71.40 | 25.59 | 50.16 | 37.94 |
| Query fed to BM25 | NQ | SciFact | FiQA |
|---|---|---|---|
| Original query (no expansion) | 30.48 | 67.62 | 23.85 |
| Stage-1: Mistral-7B-v0.3 | 38.79 | 70.49 | 24.95 |
| Stage-1: Qwen2.5-7B | 34.59 | 68.69 | 24.17 |
| Stage-1: Llama-3.1-8B | 41.06 | 69.72 | 25.00 |
| Stage-2: Qwen2.5-14B (ours) | 45.42 | 71.40 | 25.59 |
| Regime | nDCG@10 | Stage-1 output (Llama-3.1-8B-Instruct) |
|---|---|---|
| M0 (no APO) | 33.31 | “José Martí, Calixto García, Antonio Maceo, Carlos Manuel de Céspedes…” (short entity list, no context) |
| M1 (APO) | 41.06 | “The Cuban revolt against Spain was led by José Martí, a Cuban poet and revolutionary. Martí was a key figure in the Cuban War of Independence , which began in 1895 and lasted until 1898 . He advocated for Cuban independence and was a critic of Spanish colonial rule…” |
| M2 (APO w/ history) | 40.14 | “The Cuban revolt against Spain was led by José Martí, a Cuban poet, writer, and revolutionary. Martí was a key figure in the Cuban independence movement and played a significant role in organizing the Cuban Revolutionary Party , which aimed to overthrow Spanish rule in Cuba…” |
| Source | Score | Enriched output |
|---|---|---|
| Stage-1: Mistral-7B | 38.79 | “The Cuban Revolution…was led by a group of individuals who sought to overthrow the Spanish colonial rule and establish an independent Cuban government…armed conflicts from 1868 to 1898 …” |
| Stage-1: Qwen2.5-7B | 34.59 | “…led by leaders, figures, insurgents, and activists who fought for, spearheaded, and initiated the…” (generic; no named entities) |
| Stage-1: Llama-3.1-8B | 41.06 | “…led by José Martí , a Cuban poet and revolutionary…the Cuban War of Independence , which began in 1895 and lasted until 1898 …” |
| Stage-2: Qwen2.5-14B | 45.42 | “…led by a group of Cuban revolutionaries, including José Martí , Máximo Gómez , and Antonio Maceo . The revolt began in 1868 and lasted until 1898 …Martí as the ideological leader and Gómez and Maceo as military leaders…” |