Multi-Programming Language Ensemble for Code Generation in Large Language Model

Tengfei Xue, Xuefeng Li, Tahir Azim, Roman Smirnov, Jianhui Yu +2 more
9/6/2024
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) have significantly improved code generation, particularly in one-pass code generation. However, most existing approaches focus solely on generating code in a single programming language, overlooking the potential of leveraging the multi-language capabilities of LLMs. LLMs have varying patterns of errors across different languages, suggesting that a more robust approach could be developed by leveraging these multi-language outputs. In this study, we propose Multi-Programming Language Ensemble (MPLE), a novel ensemble-based method that utilizes code generation across multiple programming languages to enhance overall performance. By treating each language-specific code generation process as an individual "weak expert" and effectively integrating their outputs, our method mitigates language-specific errors and biases. This multi-language ensemble strategy leverages the complementary strengths of different programming languages, enabling the model to produce more accurate and robust code. Our approach can be seamlessly integrated with commonly used techniques such as the reflection algorithm and Monte Carlo tree search to improve code generation quality further. Experimental results show that our framework consistently enhances baseline performance by up to 17.92% on existing benchmarks (HumanEval and HumanEval-plus), with a standout result of 96.25% accuracy on the HumanEval benchmark, achieving new state-of-the-art results across various LLM models. The code will be released at https://github.com/NinjaTech-AI/MPLE

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{xue2024multiprogramming,
  title  = {Multi-Programming Language Ensemble for Code Generation in Large Language Model},
  author = {Tengfei Xue and Xuefeng Li and Tahir Azim and Roman Smirnov and Jianhui Yu and Arash Sadrieh and Babak Pahlavan},
  year   = {2024},
  eprint = {2409.04114},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.04114v1}
}

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/2409.04114.svg)](https://codeofpaper.com/paper/2409.04114)

Discussion