Personalised Code and Error Predictions in Programming Education via Large Language Models
摘要
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.