[Paper Review] Learning Program Embeddings to Propagate Feedback on Student Code
This paper proposes a neural network method that learns program embeddings by modeling programs as linear maps between embedded precondition and postcondition spaces, enabling scalable propagation of instructor feedback across massive online coding courses. The approach achieves 33% recall at 90% precision in feedback propagation, outperforming baselines on complex code and demonstrating strong performance on real-world datasets from Code.org and Stanford CS1.
Providing feedback, both assessing final work and giving hints to stuck students, is difficult for open-ended assignments in massive online classes which can range from thousands to millions of students. We introduce a neural network method to encode programs as a linear mapping from an embedded precondition space to an embedded postcondition space and propose an algorithm for feedback at scale using these linear maps as features. We apply our algorithm to assessments from the Code.org Hour of Code and Stanford University's CS1 course, where we propagate human comments on student assignments to orders of magnitude more submissions.
Motivation & Objective
- To address the challenge of providing personalized feedback at scale in massive online computer science courses with tens of thousands to millions of students.
- To develop a feature embedding method that captures both functional and stylistic aspects of student code for use in machine learning systems.
- To enable automatic propagation of human instructor feedback to a large number of student submissions using learned program embeddings.
- To evaluate the method on real-world datasets from Code.org and Stanford University’s CS1 course, demonstrating effectiveness on diverse code complexity.
- To explore the feasibility of using executable program behavior (via precondition/postcondition pairs) as a supervisory signal for learning meaningful code representations.
Proposed method
- The method learns joint embeddings of program preconditions and postconditions in a shared Euclidean space, representing each program as a linear transformation between these embedded states.
- It uses a neural network architecture that jointly optimizes program embeddings and memory states, enabling end-to-end learning of functional and stylistic features.
- Training data is generated by executing programs on various inputs, collecting input-output (precondition-postcondition) pairs to supervise the embedding learning process.
- The approach employs a nonparametric model (NPM) and a recurrent neural network (RNN) for postcondition prediction and feedback propagation, with performance evaluated via holdout sets.
- Feedback propagation is performed by identifying similar program embeddings and transferring comments from human-graded submissions to semantically similar ungraded ones.
- The model is evaluated on datasets from Code.org’s Hour of Code and Stanford’s Programming Methodologies course, using metrics like precision, recall, and cyclomatic complexity.
Experimental results
Research questions
- RQ1Can program embeddings that capture both functional and stylistic features be learned effectively from executable program behavior?
- RQ2Can these embeddings be used to automatically propagate instructor feedback to a large number of student submissions at scale?
- RQ3How does model performance vary with code complexity, particularly in terms of cyclomatic complexity?
- RQ4How does the proposed method compare to existing approaches like AST edit distance or hand-engineered features in feedback propagation tasks?
- RQ5To what extent can learned embeddings generalize across different programming assignments and course scales?
Key findings
- The nonparametric model (NPM) achieved 33% recall at 90% precision in feedback propagation on the Code.org dataset, outperforming baseline methods.
- The NPM model maintained stable test accuracy across increasing code complexity, while the RNN model’s performance degraded significantly on highly complex programs.
- The RNN model performed better on simple programs (cyclomatic complexity ≤ 6), but overfit and underperformed on more complex code.
- The method successfully propagated feedback across orders of magnitude more submissions than the number of human-graded examples, demonstrating scalability.
- Embeddings enabled notable improvement in feedback propagation compared to prior methods like those based on AST edit distance or handcrafted features.
- The approach demonstrated effectiveness on both massive-scale (Code.org, 27M+ learners) and more complex (Stanford CS1) programming assignments.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.