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

  • 2024-05-01 06:14:31
  • Yanggyu Lee, Suchae Jeong, Jihie Kim
  • 0

Abstract

LLMs trained in the understanding of programming syntax are now providingeffective assistance to developers and are being used in programming educationsuch as in generation of coding problem examples or providing codeexplanations. A key aspect of programming education is understanding anddealing with error message. However, 'logical errors' in which the programoperates against the programmer's intentions do not receive error messages fromthe compiler. In this study, building on existing research on programmingerrors, we first define the types of logical errors that can occur inprogramming in general. Based on the definition, we propose an effectiveapproach for detecting logical errors with LLMs that makes use of relationsamong error types in the Chain-of-Thought and Tree-of-Thought prompts. Theexperimental results indicate that when such logical error descriptions in theprompt are used, the average classifition performance is about 21% higher thanthe ones without them. We also conducted an experiment for exploiting therelations among errors in generating a new logical error dataset using LLMs. Asthere is very limited dataset for logical errors such benchmark dataset can bevery useful for various programming related applications. We expect that ourwork can assist novice programmers in identifying the causes of code errors andcorrect them more effectively.

 

Quick Read (beta)

loading the full paper ...