Abstract
The emergence of large language models (LLMs) has sparked enormous interest due to their potential application across a range of educational tasks. For example, recent work in programming education has used LLMs to generate learning resources, improve error messages, and provide feedback on code. However, one factor that limits progress within the field is that much of the research uses bespoke datasets and different evaluation metrics, making direct comparisons between results unreliable. Thus, there is a pressing need for standardization and benchmarks that facilitate the equitable comparison of competing approaches. One task where LLMs show great promise is program repair, which can be used to provide debugging support and next-step hints to students. In this article, we propose a novel educational program repair benchmark. We curate two high-quality publicly available programming datasets, present a unified evaluation procedure introducing a novel evaluation metric rouge@k for approximating the quality of repairs, and evaluate a set of five recent models to establish baseline performance.
Introduction
While Large Language Models (LLMs) like ChatGPT have demonstrated remarkable proficiency in code generation, their application in educational contexts requires a more nuanced approach. In a classroom setting, "fixing" a program is not merely about achieving functional correctness; it is about providing a repair that respects the student's original logic and pedagogical intent.
Currently, the field of educational program repair lacks standardization. Researchers often rely on bespoke datasets and inconsistent metrics, making it difficult to determine which models or techniques are truly superior. Furthermore, student-written code is uniquely challenging, containing diverse errors that are often absent from professional-grade benchmarks like HumanEval. This work addresses these gaps by introducing a standardized framework for evaluation, curated datasets of real student code, and a novel metric for pedagogical fitness.
Standardizing Evaluation: The Repair Pipeline
The proposed benchmark formalizes the task of educational program repair through a two-pronged evaluation strategy. The first prong is Functional Correctness (pass@k), which measures whether the generated repair successfully passes the associated unit tests. The second prong is Code Closeness (rouge@k), a novel contribution of this paper.
As shown in the workflow above, the model receives a prompt containing the problem description, the buggy program, and grader feedback. The evaluation phase then computes both functional correctness and closeness. The rouge@k metric, adapted from text summarization, measures the similarity between the repair and the student's original buggy code. The underlying philosophy is that a high-quality educational repair should provide the "minimal path" to a solution rather than a complete rewrite, making the feedback more relatable and instructive for the student.
Datasets
To ensure the benchmark reflects real-world educational challenges, the authors curated subsets from two major sources:
- FalconCode: A multi-year dataset of Python solutions from an introductory computer science course. The curated test set includes 1,305 solutions.
- Singapore Dataset: Collected from the National University of Singapore, this dataset features five assignments of varying difficulty levels. The curated subset contains 1,238 incorrect submissions.
These datasets are particularly valuable because they include authentic student errors and the unit tests required to verify fixes, moving beyond the artificial bugs often found in industry-focused benchmarks.
Results and Baseline Performance
The study evaluated five decoder-only transformer models from the CodeGen and StarCoder families, ranging from 164M to 3B parameters. To optimize these models for the task, the researchers used an automated repair tool called Refactory to generate high-quality corrections for training data, allowing for supervised fine-tuning on student-specific error patterns.
The results indicate that the StarCoder 3B model is the most effective across nearly all categories. On the "easy" section of FalconCode, it achieved a pass@10 of 37.73% and a rouge@10 of 31.12%. Notably, the models demonstrated strong cross-institutional transfer; models fine-tuned on FalconCode performed well on the Singapore dataset (achieving a pass@10 of 36.14%), suggesting that student error patterns are somewhat universal across different curricula.
Discussion and Future Work
The findings highlight that even relatively small models (under 3B parameters) can achieve respectable results when fine-tuned on domain-specific data. This is crucial for educational institutions that may lack the resources for massive compute clusters. However, several limitations remain. The current benchmark is limited to Python and does not yet address syntax errors, as the curation process filtered out non-parsing code.
While rouge@k serves as a useful proxy for pedagogical quality, it is not a perfect measure. A repair might be syntactically close but introduce concepts beyond a student's current level. Future work will focus on expanding the benchmark to more programming languages, incorporating syntax error repair, and establishing an online leaderboard to track the evolving capabilities of LLMs in the classroom.
Summary updated