NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Search, align, and repair: data-driven feedback generation for introductory programming exercises

Ke Wang, Rishabh Singh, Zhendong Su

TL;DR

This paper introduces SARFGEN, a novel data-driven framework that automatically generates personalized feedback for introductory programming exercises. By "searching" for similar correct solutions, "aligning" them with student code, and "repairing" discrepancies, SARFGEN provides concise, minimal, and semantic feedback, significantly improving the scalability and automation of educational tools for large-scale programming courses.

What Problem Does This Paper Address?

The massive growth of online education, particularly Massive Open Online Courses (MOOCs), has led to an unprecedented number of students learning to program. While this democratizes access to computer science education, it creates a significant challenge for instructors: providing timely, personalized feedback to thousands of students. Existing automated feedback systems often require manual effort to define error models, are computationally expensive, or produce imprecise feedback. This paper tackles the problem of generating fully automated, efficient, and problem-agnostic feedback for introductory programming exercises, aiming to bridge the gap between the scale of online education and the quality of personalized instruction.

Methods

The core of SARFGEN is a three-stage framework:

  • Search: Given an incorrect student program, SARFGEN efficiently identifies a set of syntactically similar correct programs from a large repository. This is achieved through a novel "position-aware characteristic vector" embedding scheme for Abstract Syntax Trees (ASTs), which allows for faster and more scalable similarity computations compared to traditional tree edit distances.
  • Align: This stage aligns each identified correct program with the incorrect student program. It uses a "variable-usage based a-conversion" to rename variables based on their usage profiles, followed by a two-level statement matching process (basic blocks then individual statements) to pinpoint discrepancies.
  • Repair: Finally, SARFGEN generates a minimal set of fixes to transform the incorrect program into a functionally equivalent one. This involves identifying insertion, deletion, and modification operations and then applying optimization techniques to prune redundant or unnecessary changes, ensuring the feedback is precise and helpful.

Datasets

The SARFGEN system was evaluated on thousands of real student submissions from:

  • The Microsoft-DEV204.1x edX course.
  • The Microsoft CodeHunt platform.

The paper does not introduce new benchmarks but utilizes existing datasets from these platforms, which contain a large number of student submissions for various programming exercises.

Key Insights and Ideas

  • Leveraging MOOC-scale data: The sheer volume of student submissions in MOOCs is not just a challenge but a valuable resource. These diverse submissions implicitly capture a wide range of common errors and solution strategies, which SARFGEN exploits.
  • Program embedding for scalability: Traditional AST comparison methods are too slow for large datasets. The proposed "position-aware characteristic vector" embedding is a key innovation that enables efficient similarity search.
  • Usage-based variable alignment: Simply matching variable names is insufficient. Profiling variable usage and aligning based on that profile (a-conversion) is crucial for accurate alignment.
  • Minimal and semantic fixes: The goal is not just to fix the code but to provide feedback that helps students understand their mistakes. SARFGEN focuses on minimal changes that address the root cause, avoiding overly complex or irrelevant suggestions.
  • Portability: The framework is designed to be problem-agnostic, requiring only a set of correct submissions for an exercise, making it highly adaptable to different programming tasks.

Key Results

  • SARFGEN can generate concise, useful feedback for 89.7% of incorrect student submissions.
  • Feedback generation typically takes under two seconds on average.
  • The system has been integrated into the Microsoft-DEV204.1X edX class and deployed for production use.
  • Experimental results show SARFGEN outperforms existing systems like CLARA in terms of generating minimal fixes and scalability, especially for larger programs.
  • The "position-aware characteristic vector" embedding significantly improves capability and performance compared to standard characteristic vectors or raw AST representations.

Limitations and Future Work

  • Reliance on correct solutions: The system's effectiveness is dependent on the availability of a sufficient number of correct solutions for comparison. While SARFGEN shows resilience even with reduced datasets (maintaining ~60% capability with only 1% of solutions), performance can degrade.
  • Program size impact: While SARFGEN scales well, its capability decreases for very large programs (over 40 lines of code), though it still manages to provide feedback for over 50% of them.
  • Future Work: The authors mention ongoing work to instantiate the framework for other languages like Python, indicating its language-agnostic potential. Further research could explore more advanced optimization techniques for the repair phase and deeper semantic analysis of student errors.

Summary updated

BibTeX
@inproceedings{wang2018search,
  author = {Ke Wang and Rishabh Singh and Zhendong Su},
  title = {{Search, align, and repair: data-driven feedback generation for introductory programming exercises}},
  booktitle = {Pldi},
  year = {2018},
  doi = {10.1145/3192366.3192384},
}
Figure