Teaching Language Models How to Code Like Learners: Conversational Serialization for Student Simulation

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Koutcheme, Charles, Leinonen, Juho, Hellas, Arto
Format: Preprint
Publié: 2026
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917490116788224
author Koutcheme, Charles
Leinonen, Juho
Hellas, Arto
author_facet Koutcheme, Charles
Leinonen, Juho
Hellas, Arto
contents Artificial students -- models that simulate how learners act and respond within educational systems -- are a promising tool for evaluating tutoring strategies and feedback mechanisms at scale. However, most existing approaches rely on prompting large, proprietary language models, limiting adaptability to specific courses and raising concerns around privacy, cost, and dependence. In this work, we propose a framework for training open-weight artificial programming learners directly from authentic student process data. Our approach serializes temporal log traces into a conversational format, representing each student's problem-solving process as a dialogue between the learner and their automated assessment system. Student code submissions and environment feedback, such as test outcomes, grades, and error traces, form alternating conversational turns, enabling models to learn from the iterative debugging process. We additionally introduce a training pipeline combining supervised fine-tuning with preference optimization to align models with authentic student debugging behavior. We evaluate our framework by training Qwen models at 4B and 8B scales on a large-scale dataset of real student submissions to Python programming assignments. Our results show that incorporating environment feedback strengthens models' ability to replicate student debugging behavior, improving over both prior code-only approaches and prompted large language models baselines in functional alignment and code similarity. We release our code to support reproducibility.
format Preprint
id arxiv_https___arxiv_org_abs_2604_10720
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Teaching Language Models How to Code Like Learners: Conversational Serialization for Student Simulation
Koutcheme, Charles
Leinonen, Juho
Hellas, Arto
Artificial Intelligence
Computation and Language
Computers and Society
Artificial students -- models that simulate how learners act and respond within educational systems -- are a promising tool for evaluating tutoring strategies and feedback mechanisms at scale. However, most existing approaches rely on prompting large, proprietary language models, limiting adaptability to specific courses and raising concerns around privacy, cost, and dependence. In this work, we propose a framework for training open-weight artificial programming learners directly from authentic student process data. Our approach serializes temporal log traces into a conversational format, representing each student's problem-solving process as a dialogue between the learner and their automated assessment system. Student code submissions and environment feedback, such as test outcomes, grades, and error traces, form alternating conversational turns, enabling models to learn from the iterative debugging process. We additionally introduce a training pipeline combining supervised fine-tuning with preference optimization to align models with authentic student debugging behavior. We evaluate our framework by training Qwen models at 4B and 8B scales on a large-scale dataset of real student submissions to Python programming assignments. Our results show that incorporating environment feedback strengthens models' ability to replicate student debugging behavior, improving over both prior code-only approaches and prompted large language models baselines in functional alignment and code similarity. We release our code to support reproducibility.
title Teaching Language Models How to Code Like Learners: Conversational Serialization for Student Simulation
topic Artificial Intelligence
Computation and Language
Computers and Society
url https://arxiv.org/abs/2604.10720