Decoding Logic Errors: A Comparative Study on Bug Detection by Students and Large Language Models
Not on the map. Why?
Abstract (arXiv)
Identifying and resolving logic errors can be one of the most frustrating challenges for novices programmers. Unlike syntax errors, for which a compiler or interpreter can issue a message, logic errors can be subtle. In certain conditions, buggy code may even exhibit correct behavior -- in other cases, the issue might be about how a problem statement has been interpreted. Such errors can be hard to spot when reading the code, and they can also at times be missed by automated tests. There is great educational potential in automatically detecting logic errors, especially when paired with suitable feedback for novices. Large language models (LLMs) have recently demonstrated surprising performance for a range of computing tasks, including generating and explaining code. These capabilities are closely linked to code syntax, which aligns with the next token prediction behavior of LLMs. On the other hand, logic errors relate to the runtime performance of code and thus may not be as well suited to analysis by LLMs. To explore this, we investigate the performance of two popular LLMs, GPT-3 and GPT-4, for detecting and providing a novice-friendly explanation of logic errors. We compare LLM performance with a large cohort of introductory computing students (n=964) solving the same error detection task. Through a mixed-methods analysis of student and model responses, we observe significant improvement in logic error identification between the previous and current generation of LLMs, and find that both LLM generations significantly outperform students. We outline how such models could be integrated into computing education tools, and discuss their potential for supporting students when learning programming.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 17 of its 73 references that are in the map. First posted on arXiv 27 Nov 2023.
Builds on
17 of 73 references.
References · 17
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2022Prompting GPT-3 To Be Reliablecited by 260
- 2022Ask Me Anything: A simple strategy for prompting language modelscited by 155
- 2022Automatic Generation of Programming Exercises and Code Explanations using Large Language Modelscited by 126
- 2023The Robots are Here: Navigating the Generative AI Revolution in Computing Educationcited by 86
- 2023Impact of Code Language Models on Automated Program Repaircited by 85
- 2022Experiences from Using Code Explanations Generated by Large Language Models in a Web Software Development E-Bookcited by 84
- 2022Conversing with Copilot: Exploring Prompt Engineering for Solving CS1 Problems Using Natural Languagecited by 82
- 2022Using Large Language Models to Enhance Programming Error Messagescited by 67
- 2023Comparing Code Explanations Created by Students and Large Language Modelscited by 64
- 2023Computing Education in the Era of Generative AIcited by 52
5 more
- 2023Thrilled by Your Progress! Large Language Models (GPT-4) No Longer Struggle to Pass Assessments in Higher Education Programming Coursescited by 39
- 2023Large Language Models (GPT) Struggle to Answer Multiple-Choice Questions about Codecited by 32
- 2023Can GPT-4 Support Analysis of Textual Data in Tasks Requiring Highly Specialized Domain Expertise?cited by 31
- 2022Automatically Generating CS Learning Materials with Large Language Modelscited by 12
- 2023More Robots are Coming: Large Multimodal Models (ChatGPT) can Solve Visually Diverse Images of Parsons Problemscited by 11
Built on by
Citing papers per year: 2024: 3; 2025: 2; 2026: 1.
6 papers.
- 2024Synthetic Students: A Comparative Study of Bug Distribution Between Large Language Models and Computing Studentscited by 6
- 2024Improving LLM Classification of Logical Errors by Integrating Error Relationship into Promptscited by 5
- 2024BugSpotter: Automated Generation of Code Debugging Exercisescited by 5
- 2025Reverse Engineering User Stories from Code using Large Language Modelscited by 2
- 2025Prompt-Based Cost-Effective Evaluation and Operation of ChatGPT as a Computer Programming Teaching Assistantcited by 0
- 2026Simulating Students' Java Programming Errors with Large Language Modelscited by 0
- 2026Simulating Students' Java Programming Errors with Large Language Models12 Jun 2026
- 2025Reverse Engineering User Stories from Code using Large Language Models23 Sep 2025
- 2025Prompt-Based Cost-Effective Evaluation and Operation of ChatGPT as a Computer Programming Teaching Assistant24 Jan 2025
- 2024BugSpotter: Automated Generation of Code Debugging Exercises21 Nov 2024
- 2024Synthetic Students: A Comparative Study of Bug Distribution Between Large Language Models and Computing Students11 Oct 2024
- 2024Improving LLM Classification of Logical Errors by Integrating Error Relationship into Prompts30 Apr 2024