Modeling Student Learning with 3.8 Million Program Traces
Not on the map. Why?
Abstract (arXiv)
As programmers write code, they often edit and retry multiple times, creating rich "interaction traces" that reveal how they approach coding tasks and provide clues about their level of skill development. For novice programmers in particular, these traces reflect the diverse reasoning processes they employ to code, such as exploratory behavior to understand how a programming concept works, re-strategizing in response to bugs, and personalizing stylistic choices. In this work, we explore what can be learned from training language models on such reasoning traces: not just about code, but about coders, and particularly students learning to program. We introduce a dataset of over 3.8 million programming reasoning traces from users of Pencil Code, a free online educational platform used by students to learn simple programming concepts. Compared to models trained only on final programs or synthetically-generated traces, we find that models trained on real traces are stronger at modeling diverse student behavior. Through both behavioral and probing analyses, we also find that many properties of code traces, such as goal backtracking or number of comments, can be predicted from learned representations of the students who write them. Building on this result, we show that we can help students recover from mistakes by steering code generation models to identify a sequence of edits that will results in more correct code while remaining close to the original student's style. Together, our results suggest that many properties of code are properties of individual students and that training on edit traces can lead to models that are more steerable, more predictive of student behavior while programming, and better at generating programs in their final states. Code and data is available at https://github.com/meghabyte/pencilcode-public
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 26 of its 45 references that are in the map. First posted on arXiv 6 Oct 2025.
Builds on
26 of 45 references.
References · 26
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2019Similarity of Neural Network Representations Revisitedcited by 1,755
- 2022STaR: Bootstrapping Reasoning With Reasoningcited by 940
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
- 2019Designing and Interpreting Probes with Control Taskscited by 640
- 2022Towards Reasoning in Large Language Models: A Surveycited by 596
- 2018Texygen: A Benchmarking Platform for Text Generation Modelscited by 491
- 2025Cognitive Behaviors that Enable Self-Improving Reasoners, or, Four Habits of Highly Effective STaRscited by 377
14 more
- 2015Deep Knowledge Tracingcited by 332
- 2024Physics of Language Models: Part 2.2, How to Learn From Mistakes on Grade-School Math Problemscited by 50
- 2023StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Codecited by 32
- 2023Automating Human Tutor-Style Programming Feedback: Leveraging GPT-4 Tutor Model for Hint Generation and GPT-3.5 Student Model for Hint Validationcited by 29
- 2024User Embedding Model for Personalized Language Promptingcited by 28
- 2025Step Back to Leap Forward: Self-Backtracking for Boosting Reasoning of Language Modelscited by 27
- 2015Learning Program Embeddings to Propagate Feedback on Student Codecited by 19
- 2024Psychometric Alignment: Capturing Human Knowledge Distributions via Language Modelscited by 18
- 2024The GPT Surprise: Offering Large Language Model Chat in a Massive Coding Class Reduced Engagement but Increased Adopters Exam Performancescited by 14
- 2024Toward Adaptive Reasoning in Large Language Models with Thought Rollbackcited by 11
- 2024Hints-In-Browser: Benchmarking Language Models for Programming Feedback Generationcited by 7
- 2024Training Language Models on Synthetic Edit Sequences Improves Code Synthesiscited by 7
- 2024Predicting Long-Term Student Outcomes from Short-Term EdTech Log Datacited by 2
- 2025Learning Code-Edit Embedding to Model Student Debugging Behaviorcited by 1
Built on by
Citing papers per year: 2025: 2; 2026: 8.
10 papers.
- 2026Simulated Students in Tutoring Dialogues: Substance or Illusion?cited by 18
- 2025Can LLMs Estimate Student Struggles? Human-AI Difficulty Alignment with Proficiency Simulation for Item Difficulty Predictioncited by 7
- 2026Towards Valid Student Simulation with Large Language Modelscited by 7
- 2026KASER: Knowledge-Aligned Student Error Simulator for Open-Ended Coding Taskscited by 7
- 2026LLMs Struggle to Measure What Distinguishes Students of Different Proficiency Levels: A Study of Item Discrimination in Reading Comprehension Assessmentcited by 3
- 2026Agent trajectories as programs: fingerprinting and programming coding-agent behaviorcited by 2
- 2026Teaching Language Models How to Code Like Learners: Conversational Serialization for Student Simulationcited by 1
- 2026Learning from 53.6K Real-World Developer Edits of AI-Generated Codecited by 1
- 2025Tracing Mathematical Proficiency Through Problem-Solving Processescited by 0
- 2026AI Assistants Overassistcited by 0
- 2026Learning from 53.6K Real-World Developer Edits of AI-Generated Code27 Jul 2026
- 2026AI Assistants Overassist23 Jul 2026
- 2026LLMs Struggle to Measure What Distinguishes Students of Different Proficiency Levels: A Study of Item Discrimination in Reading Comprehension Assessment17 Jun 2026
- 2026Agent trajectories as programs: fingerprinting and programming coding-agent behavior15 Jun 2026
- 2026Teaching Language Models How to Code Like Learners: Conversational Serialization for Student Simulation12 Apr 2026
- 2026KASER: Knowledge-Aligned Student Error Simulator for Open-Ended Coding Tasks10 Jan 2026
- 2026Towards Valid Student Simulation with Large Language Models9 Jan 2026
- 2026Simulated Students in Tutoring Dialogues: Substance or Illusion?7 Jan 2026
- 2025Can LLMs Estimate Student Struggles? Human-AI Difficulty Alignment with Proficiency Simulation for Item Difficulty Prediction21 Dec 2025
- 2025Tracing Mathematical Proficiency Through Problem-Solving Processes29 Nov 2025
Similar, not cited
Close in wording, no citation either way
- 2026Simulating Students' Java Programming Errors with Large Language Models
- 2024NExT: Teaching Large Language Models to Reason about Code Execution
- 2025Chain of Execution Supervision Promotes General Reasoning in Large Language Models
- 2025CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learning
- 2026Think Multilingual, Not Harder: A Data-Efficient Framework for Teaching Reasoning Models to Code-Switch
- 2025The Valley of Code Reasoning: Scaling Knowledge Distillation of Large Language Models
- 2025Where Did This Sentence Come From? Tracing Provenance in LLM Reasoning Distillation
- 2025A Code Comprehension Benchmark for Large Language Models for Code