Enhancing Large Language Models in Coding Through Multi-Perspective Self-Consistency

要約

大規模言語モデル (LLM) は、テキスト生成において顕著な能力を示しています。
ただし、コード生成などの複雑な推論タスクでは、LLM にとって 1 回の試行で正しい答えを生成することは依然として大きな課題です。
これまでの研究では、複数の出力を集約し、出力間の一貫性を活用することで解決策を模索していました。
しかし、この一貫性をさまざまな観点から包括的に捉えているものはありません。
この論文では、複数のパースペクティブの自己一貫性 (MPSC) フレームワークを提案します。これは、複数のパースペクティブからの出力間の相互一貫性と、単一パースペクティブ内の内部一貫性の両方を組み込んだ LLM の新しいデコード戦略です。
具体的には、LLM に、特定のクエリに対してさまざまな観点から複数の多様な出力をサンプリングし、それらに基づいて多部グラフを構築するように依頼します。
2 つの事前定義された一貫性の尺度を使用して、一貫性間の情報と一貫性内の情報の両方をグラフに埋め込みます。
次に、グラフの一貫性分析に基づいて最適な選択が決定されます。
コード生成タスクをソリューション、仕様、テストケースの3つの視点で総合的に評価します。
コードインタープリタを活用して相互整合性を定量的に測定し、いくつかの内部整合性測定関数を提案します。
当社の MPSC フレームワークは、オリジナルと比較して、Pass@1 の HumanEval (+17.60%)、HumanEval Plus (+17.61%)、MBPP (+6.50%)、CodeContests (+11.82%) などのさまざまな人気ベンチマークのパフォーマンスを大幅に向上させます。
ChatGPT から生成された出力は、GPT-4 をも上回っています。

要約(オリジナル)

Large language models (LLMs) have exhibited remarkable ability in textual generation. However, in complex reasoning tasks such as code generation, generating the correct answer in a single attempt remains a formidable challenge for LLMs. Previous research has explored solutions by aggregating multiple outputs, leveraging the consistency among them. However, none of them have comprehensively captured this consistency from different perspectives. In this paper, we propose the Multi-Perspective Self-Consistency (MPSC) framework, a novel decoding strategy for LLM that incorporates both inter-consistency across outputs from multiple perspectives and intra-consistency within a single perspective. Specifically, we ask LLMs to sample multiple diverse outputs from various perspectives for a given query and then construct a multipartite graph based on them. With two predefined measures of consistency, we embed both inter- and intra-consistency information into the graph. The optimal choice is then determined based on consistency analysis in the graph. We conduct comprehensive evaluation on the code generation task by introducing solution, specification and test case as three perspectives. We leverage a code interpreter to quantitatively measure the inter-consistency and propose several intra-consistency measure functions. Our MPSC framework significantly boosts the performance on various popular benchmarks, including HumanEval (+17.60%), HumanEval Plus (+17.61%), MBPP (+6.50%) and CodeContests (+11.82%) in Pass@1, when compared to original outputs generated from ChatGPT, and even surpassing GPT-4.

arxiv情報

著者 Baizhou Huang,Shuai Lu,Weizhu Chen,Xiaojun Wan,Nan Duan
発行日 2023-09-29 14:23:26+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.SE パーマリンク