Leveraging Print Debugging to Improve Code Generation in Large Language Models

要約

大規模言語モデル (LLM) はコード生成タスクにおいて大幅な進歩を遂げましたが、複雑なデータ構造とアルゴリズムを伴うプログラミングの問題に取り組む際のパフォーマンスは依然として最適とは言えません。
この問題に対処するために、私たちは、「プリント デバッグ」方法を使用して LLM をデバッグするようにガイドするインコンテキスト学習アプローチを提案します。これには、プリント ステートメントを挿入してバグを修正するためのログをトレースおよび分析することが含まれます。
Leetcode の問題データセットを収集し、Leetcode オンライン判定システムを使用して手法を評価します。
GPT-4 を使用した実験では、私たちのアプローチの有効性が実証され、簡単および中レベルの Leetcode 問題でラバーダックのデバッグを 1.5% および 17.9% 上回りました。

要約(オリジナル)

Large language models (LLMs) have made significant progress in code generation tasks, but their performance in tackling programming problems with complex data structures and algorithms remains suboptimal. To address this issue, we propose an in-context learning approach that guides LLMs to debug by using a ‘print debugging’ method, which involves inserting print statements to trace and analysing logs for fixing the bug. We collect a Leetcode problem dataset and evaluate our method using the Leetcode online judging system. Experiments with GPT-4 demonstrate the effectiveness of our approach, outperforming rubber duck debugging in easy and medium-level Leetcode problems by 1.5% and 17.9%.

arxiv情報

著者 Xueyu Hu,Kun Kuang,Jiankai Sun,Hongxia Yang,Fei Wu
発行日 2024-01-10 18:37:59+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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