Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation

要約

タイトル:ChatGPTによって生成されたコードは本当に正しいですか?コード生成のための大規模言語モデルの厳密な評価

要約:

– プログラム合成は長期間研究されてきましたが、最近のアプローチは、自然言語で書かれたユーザーの意図に従ってコードを生成するために、大規模言語モデル(LLM)の力を直接使用することに焦点を当てています。
– 入出力テストケースを含むコード評価データセットは、さまざまなLLMがコード合成にどの程度優れているかを測定するために使用されます。
– しかし、これらのデータセットのテストケースは、生成されたコードの機能的な正確性を完全に評価するためには、数量と品質の両方で限られている可能性があります。
– 既存のベンチマークのこのような限界は、LLMの時代にあって、生成されたコードが本当に正しいのかという疑問を呼び起こします。
– この疑問に答えるために、我々はEvalPlusと呼ばれるコード合成のベンチマークフレームワークを提案します。
– EvalPlusは、基本評価データセットを受け取り、自動的な入力生成ステップを使用して、LLMベースおよび変異ベースの入力生成器を使用して、さらに検証のために大量の新しいテスト入力を生成し多様化します。
– 我々は人間評価ベンチマークを拡張し、81倍の追加テストを生成してHUMANEVAL+を構築しました。
– 14の人気のあるLLMに対する私たちの広範な評価は、HUMANEVAL+がLLMによって合成された以前に検出されなかった間違ったコードを重要な量だけ捉えることができることを示しています。
– さらに、HUMANEVALには何件かの誤ったグラウンド・トゥループの実装があることがわかりました。
– 私たちの研究は、従来の人気のあるコード合成評価結果がLLMのコード合成の真のパフォーマンスを正確に反映していないことを示すだけでなく、自動テスト入力生成を通じてプログラミングベンチマークを改善する新しい方向を開拓しています。

要約(オリジナル)

Program synthesis has been long studied with recent approaches focused on directly using the power of Large Language Models (LLMs) to generate code according to user intent written in natural language. Code evaluation datasets, containing curated synthesis problems with input/output test-cases, are used to measure the performance of various LLMs on code synthesis. However, test-cases in these datasets can be limited in both quantity and quality for fully assessing the functional correctness of the generated code. Such limitation in the existing benchmarks begs the following question: In the era of LLMs, is the code generated really correct? To answer this, we propose EvalPlus — a code synthesis benchmarking framework to rigorously evaluate the functional correctness of LLM-synthesized code. In short, EvalPlus takes in the base evaluation dataset and uses an automatic input generation step to produce and diversify large amounts of new test inputs using both LLM-based and mutation-based input generators to further validate the synthesized code. We extend the popular HUMANEVAL benchmark and build HUMANEVAL+ with 81x additionally generated tests. Our extensive evaluation across 14 popular LLMs demonstrates that HUMANEVAL+ is able to catch significant amounts of previously undetected wrong code synthesized by LLMs, reducing the pass@k by 15.1% on average! Moreover, we even found several incorrect ground-truth implementations in HUMANEVAL. Our work not only indicates that prior popular code synthesis evaluation results do not accurately reflect the true performance of LLMs for code synthesis but also opens up a new direction to improve programming benchmarks through automated test input generation.

arxiv情報

著者 Jiawei Liu,Chunqiu Steven Xia,Yuyao Wang,Lingming Zhang
発行日 2023-05-02 05:46:48+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, OpenAI

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