Teaching Language Models How to Code Like Learners: Conversational Serialization for Student Simulation
- URL: http://arxiv.org/abs/2604.10720v1
- Date: Sun, 12 Apr 2026 16:38:42 GMT
- Title: Teaching Language Models How to Code Like Learners: Conversational Serialization for Student Simulation
- Abstract summary: We propose a method for training open-weight artificial programming learners using authentic student process data.<n>Our approach serializes temporal log traces into a conversational format, representing each student's problem-solving process.<n>Student code submissions and environment feedback, such as test outcomes, grades, and error traces, form alternating conversational turns.
- Score: 4.361813083295904
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Artificial 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, many existing approaches in programming education rely on prompting large, proprietary language models, raising concerns around privacy, cost, and dependence. In this work, we propose a method for training open-weight artificial programming learners using 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 the 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.
Related papers
- Improving Interactive In-Context Learning from Natural Language Feedback [28.01292402237836]
Adapting one's thought process based on corrective feedback is an essential ability in human learning.<n>We propose a framework that treats this interactive in-context learning ability as a distinct, trainable skill.<n>We show that models trained with our approach dramatically improve the ability to interactively learn from language feedback.
arXiv Detail & Related papers (2026-02-17T22:44:10Z) - Modeling Student Learning with 3.8 Million Program Traces [52.153493498021895]
We introduce a dataset of over 3.8 million programming reasoning traces from users of Pencil Code.<n>We find that models trained on real traces are stronger at modeling diverse student behavior.<n>We show that we can help students recover from mistakes by steering code generation models to identify a sequence of edits that will result in more correct code.
arXiv Detail & Related papers (2025-10-06T17:37:17Z) - ParaStudent: Generating and Evaluating Realistic Student Code by Teaching LLMs to Struggle [24.691302820912888]
Large Language Models (LLMs) have shown strong performance on programming tasks, but can they generate student-like code like real students?<n>We present ParaStudent, a systematic study of LLM-based "student-like" code generation in an introductory programming course setting.
arXiv Detail & Related papers (2025-07-16T23:12:14Z) - SimStep: Chain-of-Abstractions for Incremental Specification and Debugging of AI-Generated Interactive Simulations [16.00479720281197]
Chain-of-Abstractions (CoA) is a way to recover programming's core affordances.<n>CoA decomposes the synthesis process into a sequence of cognitively meaningful, task-aligned representations.<n>SimStep is an authoring environment for teachers that scaffolds simulation creation through four intermediate abstractions.
arXiv Detail & Related papers (2025-07-13T14:54:17Z) - Learning Code-Edit Embedding to Model Student Debugging Behavior [2.1485350418225244]
We propose an encoder-decoder-based model that learns meaningful code-edit embeddings between consecutive student code submissions.<n>It enables personalized next-step code suggestions that maintain the student's coding style while improving test case correctness.
arXiv Detail & Related papers (2025-02-26T18:54:39Z) - Simulated Interactive Debugging [7.3742419367796535]
We present our approach called Simulated Interactive that interactively guides students along the debug process.<n>The guidance aims to empower the students to repair their solutions and have a proper learning experience.<n>We developed an implementation using traditional fault localization techniques and large language models.
arXiv Detail & Related papers (2025-01-16T17:47:18Z) - Enhancing LLM Reasoning via Critique Models with Test-Time and Training-Time Supervision [120.40788744292739]
We propose a two-player paradigm that separates the roles of reasoning and critique models.
We first propose AutoMathCritique, an automated and scalable framework for collecting critique data.
We demonstrate that the critique models consistently improve the actor's performance on difficult queries at test-time.
arXiv Detail & Related papers (2024-11-25T17:11:54Z) - Code Representation Learning At Scale [75.04686476303436]
We fuel code representation learning with a vast amount of code data via a two-stage pretraining scheme.
We first train the encoders via a mix that leverages both randomness in masking language modeling and the structure aspect of programming language.
We then enhance the representations via contrastive learning with hard negative and hard positive constructed in an unsupervised manner.
arXiv Detail & Related papers (2024-02-02T22:19:15Z) - Chain of Hindsight Aligns Language Models with Feedback [62.68665658130472]
We propose a novel technique, Chain of Hindsight, that is easy to optimize and can learn from any form of feedback, regardless of its polarity.
We convert all types of feedback into sequences of sentences, which are then used to fine-tune the model.
By doing so, the model is trained to generate outputs based on feedback, while learning to identify and correct negative attributes or errors.
arXiv Detail & Related papers (2023-02-06T10:28:16Z) - ProtoTransformer: A Meta-Learning Approach to Providing Student Feedback [54.142719510638614]
In this paper, we frame the problem of providing feedback as few-shot classification.
A meta-learner adapts to give feedback to student code on a new programming question from just a few examples by instructors.
Our approach was successfully deployed to deliver feedback to 16,000 student exam-solutions in a programming course offered by a tier 1 university.
arXiv Detail & Related papers (2021-07-23T22:41:28Z) - Unsupervised Paraphrasing with Pretrained Language Models [85.03373221588707]
We propose a training pipeline that enables pre-trained language models to generate high-quality paraphrases in an unsupervised setting.
Our recipe consists of task-adaptation, self-supervision, and a novel decoding algorithm named Dynamic Blocking.
We show with automatic and human evaluations that our approach achieves state-of-the-art performance on both the Quora Question Pair and the ParaNMT datasets.
arXiv Detail & Related papers (2020-10-24T11:55:28Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.