Skip to main navigation Skip to search Skip to main content

Personalised Code and Error Predictions in Programming Education via Large Language Models

Research output: Chapter in Book/Report/Conference proceedingsConference proceedingpeer-review

Abstract

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.

Original languageEnglish
Title of host publicationInternational Conference on Artificial Intelligence in Education
EditorsA.I. Cristea, Erin Walker, Yu Lu, Olga C. Santos, Seiji Isotani
Pages409-423
Number of pages15
DOIs
Publication statusPublished - 2025

Publication series

NameLecture Notes in Computer Science
Volume15879 LNAI
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Keywords

  • Knowledge Tracing
  • LLMs
  • Personalised Code Generation

Fingerprint

Dive into the research topics of 'Personalised Code and Error Predictions in Programming Education via Large Language Models'. Together they form a unique fingerprint.

Cite this