Reproduce “Enhancing Large Language Models in Coding Through Multi-Perspective Self-Consistency” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Baizhou Huang, Shuai Lu, Weizhu Chen, Xiaojun Wan, Nan Duan

The Multi-Perspective Self-Consistency (MPSC) framework enhances the reliability of Large Language Models (LLMs) in code generation tasks. It leverages diverse LLM outputs as perspectives—solutions, specifications, and test cases—to achieve substantial performance gains, boosting GPT-3.5-Turbo's Pass@1 by up to 15.91% on HumanEval and outperforming GPT-4 across various benchmarks.

Key insights

  • Treating diverse LLM outputs from multiple software engineering perspectives (solutions, specifications, test cases) as equally valid allows for a more comprehensive and robust assessment of code correctness.
  • The accuracy of individually generated specifications and test cases can often be lower than that of the solutions, demonstrating that verification properties are not inherently more reliable and validating the need for a holistic consistency approach.
  • A graph-based optimization framework, integrating both cross-perspective agreement and within-perspective similarity, effectively identifies and prioritizes high-quality code solutions without external supervision.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.