Benchmarking and Explaining Large Language Model-based Code Generation: A Causality-Centric Approach

要約

コード生成はさまざまなソフトウェア開発シナリオで広く使用されていますが、生成されたコードの品質は保証されていません。
これは、大規模言語モデル (LLM) ベースのコード生成の時代に特に懸念されています。LLM は、複雑で強力なブラック ボックス モデルとみなされ、高レベルの自然言語仕様、つまりプロンプトによって指示されます。
コードを生成します。
それにもかかわらず、LLM の複雑さと透明性の欠如を考慮すると、LLM のコード生成機能を効果的に評価して説明することは本質的に困難です。
因果関係分析とソフトウェア エンジニアリングにおけるその応用の最近の進歩に触発され、この論文では、LLM 入力プロンプトと生成されたコードの間の因果関係を体系的に分析するための因果関係分析ベースのアプローチを開始します。
この研究ではさまざまな技術的課題に対処するために、まずプロンプトと生成されたコードの新しい因果グラフベースの表現を提案します。これは、入力プロンプトのきめの細かい人間が理解できる概念に基づいて確立されます。
形成された因果関係グラフは、プロンプトと派生コードの間の因果関係を識別するために使用されます。
12 を超える迅速な調整戦略を備えた 3 つ以上の人気のある LLM を研究することで、私たちのフレームワークが提供できる洞察を示します。
これらの研究の結果は、LLM の有効性に関する洞察を提供し、エンドユーザーが予測を理解するのに役立つ、私たちの技術の可能性を示しています。
さらに、プロンプトを適切に調整することで、私たちのアプローチが LLM で生成されたコードの品質を向上させるための実用的な洞察を提供することを実証します。

要約(オリジナル)

While code generation has been widely used in various software development scenarios, the quality of the generated code is not guaranteed. This has been a particular concern in the era of large language models (LLMs)- based code generation, where LLMs, deemed a complex and powerful black-box model, is instructed by a high-level natural language specification, namely a prompt, to generate code. Nevertheless, effectively evaluating and explaining the code generation capability of LLMs is inherently challenging, given the complexity of LLMs and the lack of transparency. Inspired by the recent progress in causality analysis and its application in software engineering, this paper launches a causality analysis-based approach to systematically analyze the causal relations between the LLM input prompts and the generated code. To handle various technical challenges in this study, we first propose a novel causal graph-based representation of the prompt and the generated code, which is established over the fine-grained, human-understandable concepts in the input prompts. The formed causal graph is then used to identify the causal relations between the prompt and the derived code. We illustrate the insights that our framework can provide by studying over 3 popular LLMs with over 12 prompt adjustment strategies. The results of these studies illustrate the potential of our technique to provide insights into LLM effectiveness, and aid end-users in understanding predictions. Additionally, we demonstrate that our approach provides actionable insights to improve the quality of the LLM-generated code by properly calibrating the prompt.

arxiv情報

著者 Zhenlan Ji,Pingchuan Ma,Zongjie Li,Shuai Wang
発行日 2023-10-10 14:56:26+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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