Wisdom and Delusion of LLM Ensembles for Code Generation and Repair

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Vallecillos-Ruiz, Fernando, Hort, Max, Moonen, Leon
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918178110570496
author Vallecillos-Ruiz, Fernando
Hort, Max
Moonen, Leon
author_facet Vallecillos-Ruiz, Fernando
Hort, Max
Moonen, Leon
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2510_21513
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Wisdom and Delusion of LLM Ensembles for Code Generation and Repair
Vallecillos-Ruiz, Fernando
Hort, Max
Moonen, Leon
Software Engineering
Computation and Language
Machine Learning
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.
title Wisdom and Delusion of LLM Ensembles for Code Generation and Repair
topic Software Engineering
Computation and Language
Machine Learning
url https://arxiv.org/abs/2510.21513