Abstract
ParaStudent is a novel framework designed to bridge the gap between expert-level AI code generation and the realistic, iterative behavior of novice programmers. While standard Large Language Models (LLMs) excel at producing clean, professional code, they fail to serve as effective proxies for human learners in educational contexts. By fine-tuning models on a longitudinal dataset of over 600,000 student submissions, the researchers developed qwen-student, a model that captures the "messiness" and logical struggles characteristic of introductory computer science students. Evaluation across multiple dimensions—semantic, functional, stylistic, and temporal—shows that ParaStudent accurately mirrors student error profiles and stylistic quirks, providing a robust benchmark for Intelligent Tutoring Systems (ITS).
Introduction
Current research in AI-assisted coding predominantly focuses on maximizing model performance, aiming for perfect correctness and professional style. However, in Computer Science (CS) education, there is a critical need for models that "struggle" like students. Intelligent Tutoring Systems and automated grading tools require realistic student behavior to be effectively tested and refined. Real students do not immediately arrive at optimal solutions; they iterate through logical errors, write verbose code, and produce multiple broken versions.
Standard LLMs like GPT-4 are often "too good" for this purpose. Even when prompted to act as novices, they tend to default to clean, professional code, making them poor simulators for evaluating how a tutor might assist a struggling learner. ParaStudent addresses this by explicitly teaching models to simulate the learning dynamics and specific failure modes of novice programmers.
Methods
The ParaStudent framework comprises a fine-tuned model and a comprehensive multi-dimensional evaluation suite.
Fine-tuning (qwen-student)
The researchers utilized Qwen-2.5 Coder 7B as a base model, fine-tuning it using Low-Rank Adaptation (LoRA) on a massive dataset of student code submissions. The training explored two temporal resolutions:
- Low-resolution: Generating code snapshots at the "start," "middle," and "end" of a student's attempt.
- High-resolution: Predicting the immediate next edit in a stream of timestamped submissions.
Multi-dimensional Evaluation
To move beyond binary pass/fail metrics, the authors developed a suite of metrics across four axes:
- Semantic: Alignment of the AI's "thought process" with human students using code embeddings.
- Functional: Comparison of error type distributions (logical vs. runtime errors).
- Stylistic: Measurement of "messiness" via PEP 8 violations, verbosity, and AST complexity.
- Progress: Tracking code evolution through edit distance and pass-rate improvements.
Dataset
The study leverages a dataset from an introductory Python course (CS 61A) at UC Berkeley, containing 689,023 submissions from 5,478 students. This dataset is unique because it captures the entire process of coding—every intermediate save and submission made while a student struggled with a problem.
Key Results and Insights
The results indicate that fine-tuning is mandatory for achieving "student-likeness." Prompting expert models is insufficient, as they consistently default to high-quality code.
Error Profiles and the "Middle" Stage
A key finding is that the "middle" of a coding trajectory—where debugging and logical struggle occur—is the most difficult to model. While models align well at the start (empty code) and end (correct code), qwen-student significantly outperformed general LLMs in capturing the struggle in between.
As shown in Figure 3, qwen-student closely mirrors the human student error profile. While GPT-4 produces nearly 100% correct code from the outset, qwen-student generates logical and runtime errors at frequencies similar to real students.
Alignment and Style
The fine-tuned qwen-student achieved a "KNN Coverage" of 71.9% of the student code distribution, compared to 56.3% for the instruction-tuned version. Stylistically, it successfully mimicked non-standard formatting and verbose structures, matching the "style score" of real students almost exactly. Furthermore, it simulated the small, incremental revision patterns of humans, whereas standard LLMs tended to make large, unrealistic "jumps" between versions.
Conclusion and Future Work
ParaStudent demonstrates that AI can be taught to "struggle," providing a more realistic foundation for educational technology. Future work includes expanding the framework to other programming languages and more advanced topics. Additionally, the researchers aim to generate entire multi-step "struggle trajectories" from scratch, further enhancing the utility of these models for training and evaluating automated tutors.
Summary updated