Wisdom and Delusion of LLM Ensembles for Code Generation and Repair

Fernando Vallecillos-Ruiz, Max Hort, Leon Moonen
10/24/2025
cs.SEcs.CLcs.LG

No confident code implementation found for this paper.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{vallecillosruiz2025wisdom,
  title  = {Wisdom and Delusion of LLM Ensembles for Code Generation and Repair},
  author = {Fernando Vallecillos-Ruiz and Max Hort and Leon Moonen},
  year   = {2025},
  eprint = {2510.21513},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.21513v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.21513.svg)](https://codeofpaper.com/paper/2510.21513)

Discussion