Exploring LLMs for Generating Erroneous Examples in CS1
Abstract
Erroneous examples are structured problem examples which incorporate deliberate errors that students can identify and correct to reinforce their understanding. Erroneous examples have been shown to be beneficial for student learning in various domains. However, designing effective erroneous examples requires careful planning and a deep understanding of common student misconceptions, posing a time burden on educators. In this work, we introduce a framework that leverages Large Language Models (LLMs) to automatically generate erroneous programming examples for use in introductory computer science education. We systematically evaluate the performance of various LLMs on the generation task, and find that LLMs are generally capable of generating meaningful erroneous examples along with accurate explanations. We present our preliminary findings and outline next steps for this study and future research.
Fields of Study & Subjects
Teaching and Learning Programming
Artificial Intelligence in Education
Intelligent Tutoring Systems and Adaptive Learning
Publication details
- Journal / source
- ACM Technical Symposium on Computer Science Education (SIGCSE)
- Pages
- 1261–1262
- Publication date
- 13 February 2026
- Language
- EN