Simulating Students' Java Programming Errors with Large Language Models
Not on the map. Why?
Abstract (arXiv)
Understanding student errors in the programming is a cornerstone of programming education, yet obtaining a representative set of student errors for any newly designed task remains slow and costly, since authentic submissions only accumulate after extensive classroom deployment. This paper explores whether large language models (LLMs) can serve as scalable proxies for students by simulating realistic logical errors in code submissions. Using the CodeWorkout dataset of 74,000+ unique student Java submissions across 37 problems, we evaluate five LLMs under three mainstream prompting strategies: Input-Output (IO), Chain-of-Thought (CoT), and iterative Self-Refine. We assess performance along two key dimensions: diversity (the range of distinct error patterns) and alignment (alignment with authentic student mistakes), and examine how these vary by struggling level of programming tasks. Our quantitative findings reveal that while all models generate diverse errors, their alignment to human submissions diverges: Claude Sonnet 4 achieves the most balanced performance. In addition, we conducted a blinded expert annotation study (N = 401) comparing synthetic and authentic errors. This qualitative analysis confirms that the generated errors are functionally indistinguishable from authentic student errors. Moreover, higher-struggling-level problems elicit more diverse but less student-like errors. These results highlight trade-offs in using LLMs to simulate human learners and suggest design considerations for integrating synthetic errors into teachable agents, intelligent tutoring systems, and large-scale learning analytics.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 12 of its 32 references that are in the map. First posted on arXiv 12 Jun 2026.
Builds on
12 of 32 references.
References · 12
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
- 2024Simulating Classroom Education with LLM-Empowered Agentscited by 125
- 2024Bugs in Large Language Models Generated Code: An Empirical Studycited by 59
- 2024Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Modelscited by 28
- 2025Embracing Imperfection: Simulating Students with Diverse Cognitive Levels Using LLM-based Agentscited by 19
- 2025TutorUp: What If Your Students Were Simulated? Training Tutors to Address Engagement Challenges in Online Learningcited by 11
- 2024LLM-itation is the Sincerest Form of Data: Generating Synthetic Buggy Code Submissions for Computing Educationcited by 7
- 2023Decoding Logic Errors: A Comparative Study on Bug Detection by Students and Large Language Modelscited by 6
- 2024Synthetic Students: A Comparative Study of Bug Distribution Between Large Language Models and Computing Studentscited by 6
- 2025Mapping Student-AI Interaction Dynamics in Multi-Agent Learning Environments: Supporting Personalised Learning and Reducing Performance Gapscited by 4
- 2026Developing Authentic Simulated Learners for Mathematics Teacher Learning: Insights from Three Approaches with Large Language Modelscited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Beyond Problem Solving: UOJ-Bench for Evaluating Code Generation, Hacking, and Repair in Competitive Programming
- 2024Stepwise Verification and Remediation of Student Reasoning Errors with Large Language Model Tutors
- 2024Understanding Defects in Generated Codes by Language Models
- 2026CodeEval: A pedagogical approach for targeted evaluation of code-trained Large Language Models
- 2026A Classroom Study of LLM-Generated Feedback Intervention in Introductory Programming
- 2026KASER: Knowledge-Aligned Student Error Simulator for Open-Ended Coding Tasks
- 2025Modeling Student Learning with 3.8 Million Program Traces
- 2026Large Language Models for Programming: Actually Fixing or Reimplementing Incorrect Code?