Enhancing Large Language Models in Coding Through Multi-Perspective Self-Consistency
Baizhou Huang, Shuai Lu, Weizhu Chen, Xiaojun Wan, Nan Duan

TL;DR
This paper introduces the Multi-Perspective Self-Consistency framework that improves code generation in large language models by leveraging diverse reasoning perspectives, leading to significant performance gains on multiple benchmarks.
Contribution
The paper proposes a novel multi-perspective approach that treats different reasoning outputs equally, enhancing code generation accuracy beyond existing verification-based methods.
Findings
Boosts ChatGPT performance on HumanEval (+15.91%)
Improves MBPP scores (+6.43%)
Surpasses GPT-4 on CodeContests (+9.37%)
Abstract
Large language models (LLMs) have exhibited remarkable ability in code generation. However, generating the correct solution in a single attempt still remains a challenge. Prior works utilize verification properties in software engineering to verify and re-rank solutions in a majority voting manner. But the assumption behind them that generated verification properties have better qualities than solutions may not always hold. In this paper, we treat them equally as different perspectives of LLMs' reasoning processes. We propose the Multi-Perspective Self-Consistency (MPSC) framework incorporating both inter- and intra-consistency across outputs from multiple perspectives. Specifically, we prompt LLMs to generate diverse outputs from three perspectives, Solution, Specification and Test case, constructing a 3-partite graph. With two measure functions of consistency, we embed both inter- and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
Taxonomy
TopicsSoftware Engineering Research · Natural Language Processing Techniques · Topic Modeling
MethodsMulti-Head Attention · Attention Is All You Need · None · Dense Connections · Linear Layer · Label Smoothing · Absolute Position Encodings · Adam · Residual Connection · Layer Normalization
