Can OpenSource beat ChatGPT? — A Comparative Study of Large Language Models for Text-to-Code Generation

要約

近年、大規模言語モデル (LLM) が、ソフトウェア エンジニアリングを含むさまざまな分野に応用できる可能性のある強力なツールとして登場しました。
この調査の範囲内で、テキストからコードへの生成機能に関して、5 つの異なる最先端 LLM (Bard、BingChat、ChatGPT、Llama2、および Code Llama) を評価します。
実証研究では、プログラミング Web サイト LeetCode から取得したコーディングの問題のテキストによる説明をプロンプトに入力し、Python でソリューションを作成するタスクをモデルに与えます。
その後、LeetCode のテスト機能を使用して、生成された出力の品質が評価されます。
結果は、調査したモデル間のパフォーマンスに大きな違いがあることを示しています。
ChatGPT は、これらの典型的なプログラミングの課題を最も効果的に処理でき、Code Llama のようなコードに特化したモデルさえも上回ります。
さらなる洞察を得るために、生成された出力の実行時間とメモリ使用量を測定し、Leetcode に提出された他のコードと比較しました。
生成されたコードの正しいインデントと形式に関する違いの比較、および誤って解決されたタスクの特定のエラー カテゴリへの割り当てを含む詳細なエラー分析により、結果と改善の可能性についてより微妙な全体像を得ることができます。
この結果は、モデルが長いプロンプトの形で多くのコンテキストに直面している場合、生成されるコードがますます不正確になるという明確なパターンも示しています。

要約(オリジナル)

In recent years, large language models (LLMs) have emerged as powerful tools with potential applications in various fields, including software engineering. Within the scope of this research, we evaluate five different state-of-the-art LLMs – Bard, BingChat, ChatGPT, Llama2, and Code Llama – concerning their capabilities for text-to-code generation. In an empirical study, we feed prompts with textual descriptions of coding problems sourced from the programming website LeetCode to the models with the task of creating solutions in Python. Subsequently, the quality of the generated outputs is assessed using the testing functionalities of LeetCode. The results indicate large differences in performance between the investigated models. ChatGPT can handle these typical programming challenges by far the most effectively, surpassing even code-specialized models like Code Llama. To gain further insights, we measure the runtime as well as the memory usage of the generated outputs and compared them to the other code submissions on Leetcode. A detailed error analysis, encompassing a comparison of the differences concerning correct indentation and form of the generated code as well as an assignment of the incorrectly solved tasks to certain error categories allows us to obtain a more nuanced picture of the results and potential for improvement. The results also show a clear pattern of increasingly incorrect produced code when the models are facing a lot of context in the form of longer prompts.

arxiv情報

著者 Luis Mayer,Christian Heumann,Matthias Aßenmacher
発行日 2024-09-06 10:03:49+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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