Pragmatic Reasoning improves LLM Code Generation

要約

大規模な言語モデル(LLM)は、自然言語(NL)の命令をプログラムコードに翻訳する際に印象的な可能性を示しています。
ただし、ユーザーの命令には固有のあいまいさが含まれることが多く、LLMがユーザーの真の意図を正確に反映するコードを生成することが困難になります。
この課題に対処するために、研究者はプログラムコードの複数の候補を作成し、それらを再検討して最良のソリューションを特定することを提案しました。
この論文では、LLMSをユーザーの意図に関するより包括的な実用的な推論に導くために設計された、合理的なスピーチ法(RSA)フレームワークに基づいて構築された新しいコード候補の再ランキングメカニズムであるCodersaを提案します。
人気のあるコード生成データセットで最新のLLMSの1つを使用してCodersaを評価します。
私たちの実験結果は、Codersaが一貫して一般的なベースラインを上回り、ほとんどの場合、最先端のアプローチを上回り、堅牢な全体的なパフォーマンスを示していることを示しています。
これらの調査結果は、実用的な推論をコード候補の再ランキングに統合することの有効性を強調し、LLMSのコード生成品質を向上させるための有望な方向性を提供します。

要約(オリジナル)

Large Language Models (LLMs) have demonstrated impressive potential in translating natural language (NL) instructions into program code. However, user instructions often contain inherent ambiguities, making it challenging for LLMs to generate code that accurately reflects the user’s true intent. To address this challenge, researchers have proposed to produce multiple candidates of the program code and then rerank them to identify the best solution. In this paper, we propose CodeRSA, a novel code candidate reranking mechanism built upon the Rational Speech Act (RSA) framework, designed to guide LLMs toward more comprehensive pragmatic reasoning about user intent. We evaluate CodeRSA using one of the latest LLMs on a popular code generation dataset. Our experiment results show that CodeRSA consistently outperforms common baselines, surpasses the state-of-the-art approach in most cases, and demonstrates robust overall performance. These findings underscore the effectiveness of integrating pragmatic reasoning into code candidate reranking, offering a promising direction for enhancing code generation quality in LLMs.

arxiv情報

著者 Zhuchen Cao,Sven Apel,Adish Singla,Vera Demberg
発行日 2025-02-28 13:40:42+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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