arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.19336cs.AIcs.PL
收藏

通过将错误关系集成到提示中来改进LLM对逻辑错误的分类

Improving LLM Classification of Logical Errors by Integrating Error Relationship into Prompts

Dongguk University(东国大学)

Yanggyu Lee, Suchae Jeong, Jihie Kim

AI总结:

本研究定义了通用编程中的逻辑错误类型,提出利用Chain-of-Thought和Tree-of-Thought提示中错误类型间的关系来提升LLM对逻辑错误的检测与分类性能,平均提升约21%,并生成了新的逻辑错误基准数据集以辅助新手程序员。

摘要:

在理解编程语法方面受过训练的LLM现在正为开发者提供有效的帮助,并被应用于编程教育中,例如生成编程问题示例或提供代码解释。编程教育的一个关键方面是理解和处理错误信息。然而,程序运行违背程序员意图的“逻辑错误”不会从编译器收到错误信息。在本研究中,基于现有的编程错误研究,我们首先定义了一般编程中可能发生的逻辑错误类型。基于该定义,我们提出了一种使用LLM检测逻辑错误的有效方法,该方法利用了Chain-of-Thought和Tree-of-Thought提示中错误类型之间的关系。实验结果表明,当在提示中使用此类逻辑错误描述时,平均分类性能比不使用时高约21%。我们还进行了一项实验,利用错误之间的关系通过LLM生成新的逻辑错误数据集。由于逻辑错误的数据集非常有限,此类基准数据集对于各种编程相关的应用非常有用。我们期望我们的工作能帮助新手程序员识别代码错误的原因并更有效地进行纠正。

英文摘要:

LLMs trained in the understanding of programming syntax are now providing effective assistance to developers and are being used in programming education such as in generation of coding problem examples or providing code explanations. A key aspect of programming education is understanding and dealing with error message. However, 'logical errors' in which the program operates against the programmer's intentions do not receive error messages from the compiler. In this study, building on existing research on programming errors, we first define the types of logical errors that can occur in programming in general. Based on the definition, we propose an effective approach for detecting logical errors with LLMs that makes use of relations among error types in the Chain-of-Thought and Tree-of-Thought prompts. The experimental results indicate that when such logical error descriptions in the prompt are used, the average classifition performance is about 21% higher than the ones without them. We also conducted an experiment for exploiting the relations among errors in generating a new logical error dataset using LLMs. As there is very limited dataset for logical errors such benchmark dataset can be very useful for various programming related applications. We expect that our work can assist novice programmers in identifying the causes of code errors and correct them more effectively.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑