TY - GEN
T1 - Personalised Code and Error Predictions in Programming Education via Large Language Models
AU - Shaka, Martha
AU - Carraro, Diego
AU - N. Brown, Kenneth
N1 - Publisher Copyright:
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2025.
PY - 2025
Y1 - 2025
N2 - Novice programmers frequently struggle with syntax errors, which hinder learning progression and motivation. While AI-based programming tools (AIPTs) provide automated feedback, most lack personalisation and proactive interventions. Off-the-shelf Large Language Models (LLMs) are primarily trained to generate correct solutions, not to simulate students’ mistakes. Knowledge Tracing (KT) models estimate student mastery over time and predict future performance. Still, traditional KT methods focus on binary pass/fail predictions, limiting their ability to diagnose misunderstandings and provide actionable feedback This study integrates fine-tuned LLMs, Codellama-13B and Mistral-7B, with KT to identify student-specific gaps by predicting likely syntax errors. Our framework introduces an intermediate step of personalised code generation, where the model simulates how a student might attempt a task. The generated code is then compiled to extract errors aligned with the student’s historical misconceptions. We refine code alignment and error prediction accuracy using Supervised Fine-Tuning and Reinforcement Learning (ORPO). Experimental results on a real-world Java dataset show a +34% improvement in error prediction and +27% increase in code similarity over baseline models. These findings lay a foundation for proactive, personalised learning support. Future work will focus on integrating this framework into AIPTs to recommend adaptive exercises, materials, and hints before students attempt a task.
AB - Novice programmers frequently struggle with syntax errors, which hinder learning progression and motivation. While AI-based programming tools (AIPTs) provide automated feedback, most lack personalisation and proactive interventions. Off-the-shelf Large Language Models (LLMs) are primarily trained to generate correct solutions, not to simulate students’ mistakes. Knowledge Tracing (KT) models estimate student mastery over time and predict future performance. Still, traditional KT methods focus on binary pass/fail predictions, limiting their ability to diagnose misunderstandings and provide actionable feedback This study integrates fine-tuned LLMs, Codellama-13B and Mistral-7B, with KT to identify student-specific gaps by predicting likely syntax errors. Our framework introduces an intermediate step of personalised code generation, where the model simulates how a student might attempt a task. The generated code is then compiled to extract errors aligned with the student’s historical misconceptions. We refine code alignment and error prediction accuracy using Supervised Fine-Tuning and Reinforcement Learning (ORPO). Experimental results on a real-world Java dataset show a +34% improvement in error prediction and +27% increase in code similarity over baseline models. These findings lay a foundation for proactive, personalised learning support. Future work will focus on integrating this framework into AIPTs to recommend adaptive exercises, materials, and hints before students attempt a task.
KW - Knowledge Tracing
KW - LLMs
KW - Personalised Code Generation
UR - https://www.scopus.com/pages/publications/105011937186
U2 - 10.1007/978-3-031-98420-4_29
DO - 10.1007/978-3-031-98420-4_29
M3 - Conference proceeding
T3 - Lecture Notes in Computer Science
SP - 409
EP - 423
BT - International Conference on Artificial Intelligence in Education
A2 - Cristea, A.I.
A2 - Walker, Erin
A2 - Lu, Yu
A2 - Santos, Olga C.
A2 - Isotani, Seiji
ER -