要約
大規模な言語モデル(LLM)は、コード生成における前例のない能力を実証しています。
ただし、LLMで生成されたコードは、特にLLMがこれまで見たことのない複雑なプログラミングタスクの場合、幅広い機能エラーに悩まされています。
最近の研究では、開発者がLLMによって生成された誤ったコードの検査と修正に苦労し、LLMベースのコード生成に対する生産性と信頼を低下させることが多いことが示されています。
コミュニケーションにおける相互接地理論に触発されて、コードコメントを開発者とLLMSが共有理解を確立するための媒体としてレバレッジを活用するインタラクティブなアプローチを提案します。
私たちのアプローチは、編集可能なコメントを介してコードのインターリーニングコード生成、インラインコメント生成、およびコンテキスト化されたユーザーフィードバックにより、生成されたコードを開発者の意図に合わせることにより、反復的な接地を促進します。
2つの一般的なベンチマークでのアプローチを評価し、アプローチが複数の最先端のLLMを大幅に改善したことを実証しました。
さらに、2つのベースラインと比較して12人の参加者を対象としたユーザー調査を実施しました。(1)Github Copilotとの相互作用、および(2)マルチターンプログラム合成と呼ばれるマルチステップコード生成パラダイムとの相互作用。
参加者は、特定のプログラミングタスクを16.7%速く完了し、アプローチを使用する際にタスクの成功率を10.5%改善しました。
どちらの結果も、インタラクティブな精製コードコメントが相互接続の共同の確立を可能にし、より正確なコード生成と開発者の信頼を高めることを示しています。
要約(オリジナル)
Large Language Models (LLMs) have demonstrated unprecedented capability in code generation. However, LLM-generated code is still plagued with a wide range of functional errors, especially for complex programming tasks that LLMs have not seen before. Recent studies have shown that developers often struggle with inspecting and fixing incorrect code generated by LLMs, diminishing their productivity and trust in LLM-based code generation. Inspired by the mutual grounding theory in communication, we propose an interactive approach that leverages code comments as a medium for developers and LLMs to establish a shared understanding. Our approach facilitates iterative grounding by interleaving code generation, inline comment generation, and contextualized user feedback through editable comments to align generated code with developer intent. We evaluated our approach on two popular benchmarks and demonstrated that our approach significantly improved multiple state-of-the-art LLMs, e.g., 17.1% pass@1 improvement for code-davinci-002 on HumanEval. Furthermore, we conducted a user study with 12 participants in comparison to two baselines: (1) interacting with GitHub Copilot, and (2) interacting with a multi-step code generation paradigm called Multi-Turn Program Synthesis. Participants completed the given programming tasks 16.7% faster and with 10.5% improvement in task success rate when using our approach. Both results show that interactively refining code comments enables the collaborative establishment of mutual grounding, leading to more accurate code generation and higher developer confidence.
arxiv情報
著者 | Yifeng Di,Tianyi Zhang |
発行日 | 2025-05-12 17:20:30+00:00 |
arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google