Wisdom and Delusion of LLM Ensembles for Code Generation and Repair
Not on the map. Why?
Abstract (arXiv)
Today's pursuit of a single Large Language Model (LMM) for all software engineering tasks is resource-intensive and overlooks the potential benefits of complementarity, where different models contribute unique strengths. However, the degree to which coding LLMs complement each other and the best strategy for maximizing an ensemble's potential are unclear, leaving practitioners without a clear path to move beyond single-model systems. To address this gap, we empirically compare ten individual LLMs from five families, and three ensembles of these LLMs across three software engineering benchmarks covering code generation and program repair. We assess the complementarity between models and the performance gap between the best individual model and the ensembles. Next, we evaluate various selection heuristics to identify correct solutions from an ensemble's candidate pool. We find that the theoretical upperbound for an ensemble's performance can be 83% above the best single model. Our results show that consensus-based strategies for selecting solutions fall into a "popularity trap," amplifying common but incorrect outputs. In contrast, a diversity-based strategy realizes up to 95% of this theoretical potential, and proves effective even in small two-model ensembles, enabling a cost-efficient way to enhance performance by leveraging multiple LLMs.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 24 of its 50 references that are in the map. First posted on arXiv 24 Oct 2025.
Builds on
24 of 50 references.
References · 24
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2020BLEURT: Learning Robust Metrics for Text Generationcited by 1,196
- 2021BARTScore: Evaluating Generated Text as Text Generationcited by 719
- 2023LLM-Blender: Ensembling Large Language Models with Pairwise Ranking and Generative Fusioncited by 550
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2024LiveBench: A Challenging, Contamination-Limited LLM Benchmarkcited by 242
- 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 178
- 2021SimCLS: A Simple Framework for Contrastive Learning of Abstractive Summarizationcited by 131
- 2023CodeBERTScore: Evaluating Code Generation with Pretrained Models of Codecited by 101
12 more
- 2022SummaReranker: A Multi-Task Mixture-of-Experts Re-ranking Framework for Abstractive Summarizationcited by 61
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repaircited by 50
- 2024The Larger the Better? Improved LLM Code-Generation via Budget Reallocationcited by 41
- 2021Trust Enhancement Issues in Program Repaircited by 22
- 2024How Far Can We Go with Practical Function-Level Program Repair?cited by 16
- 2025Large Language Models for Code Generation: The Practitioners Perspectivecited by 9
- 2025Ensemble Learning for Large Language Models in Text and Code Generation: A Surveycited by 8
- 2025The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Modelscited by 7
- 2024EnStack: An Ensemble Stacking Framework of Large Language Models for Enhanced Vulnerability Detection in Source Codecited by 4
- 2023Practical Program Repair via Preference-based Ensemble Strategycited by 3
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detectioncited by 2
- 2025Ensembling Large Language Models for Code Vulnerability Detection: An Empirical Evaluationcited by 2
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.