Beyond Unit Tests: Path-Aware Rubric-Guided LLM Autograding of Notebooks

Salman Hajizada, Mohammed Yusuf Ansari, Gianni Di CaroarXiv 2026

Imagine you’re a TA grading a stack of data science notebooks. The first question asks students to pick a feature to drop from a dataset and justify it. Student A drops "number of bedrooms." Student B drops "square footage." Both are perfectly valid choices.

But here’s the catch: the rest of the assignment—the model training, the error plots, the final analysis—depends entirely on that first choice. If you’re a traditional autograder looking for a single "correct" numerical answer, you’re going to fail Student B, even if their logic is flawless. This "path-dependency" is why we still spend countless hours grading notebooks by hand.

This paper introduces a way to move beyond rigid unit tests and into the world of path-aware, rubric-guided autograding using Large Language Models (LLMs).

TL;DR

The authors developed an LLM-based system that grades Jupyter notebooks not as a series of isolated tests, but as a logical "flow" where later answers are judged based on a student's earlier, unique choices. By "softening" instructor rubrics to accept alternative valid paths and using multimodal vision to "see" student plots, the system achieves human-level grading agreement at a fraction of the cost.

What Problem Does This Paper Address?

In fields like machine learning and data science, assignments are often flow-structured. They aren't just about writing a function that passes a test; they are about a narrative of inquiry. A student might make a design choice in cell 2 that changes the "correct" output for cell 20.

Current autograders (like nbgrader) are great at checking if a function returns 42, but they are brittle when faced with open-ended analysis. They can't easily judge if a written justification makes sense or if a plot accurately reflects the code that generated it. This leaves instructors with a choice: stick to boring, rigid assignments that are easy to grade, or assign authentic, open-ended projects that take weeks to grade manually.

Methods

The authors built a pipeline that treats the LLM like a sophisticated teaching assistant. Here is how the "magic" happens:

  1. Rubric Generation & Softening: The system takes an instructor’s reference solution and generates a draft rubric. It then performs a "softening pass," rewriting rigid criteria (e.g., "Must drop bedrooms") into flexible ones (e.g., "Must drop a justified feature and maintain consistency").
  2. Question Grouping: Instead of grading one cell at a time, the system sends "question groups" to the LLM. This gives the model the context it needs to see how Q1 influenced Q3.
  3. Multimodal Evidence: The grader doesn't just read code; it uses vision-capable models to inspect student-generated figures and plots.
  4. Human-in-the-Loop: The system includes an "Instructor Review" interface where staff can see the LLM’s reasoning, confidence scores, and flags for manual review before any grade is finalized.
Fig. 2: Pipeline overview. The left lane runs once per student, the right once per assignment, and the two converge at grading. Shaded boxes are instructor checkpoints.

Datasets

The system was battle-tested in a real-world machine learning course:

  • Live Deployment: Graded four major assessments for 24 students in a Spring 2026 course.
  • Archived Benchmark: Re-graded 171 historical submissions from nine different lab assessments (spanning 2024–2026) to compare LLM scores against original human TA scores.
  • Red-Team Benchmark: A synthetic dataset designed to test "prompt injection"—attempts by students to trick the AI into giving them a perfect score via hidden text or malicious instructions.

Key Insights and Ideas

  • The "Slot Machine" Effect: One of the most critical findings was the importance of model temperature. Models that didn't support "zero-temperature" (deterministic) inference acted like slot machines, giving different grades to the same notebook on different runs. Stability is a prerequisite for fairness.
  • Context is King: By grading questions in groups, the LLM could "forgive" a student for an early mistake if they followed through correctly on the subsequent logic, or conversely, catch a student whose final analysis didn't actually match their earlier data.
  • Softening Works: The "softening pass" was essential for moving from "did the student do exactly what I did?" to "did the student do something scientifically sound?"

Key Results

  • Human-Level Agreement: On a subset of homework, the system’s agreement with instructors ($\kappa = 0.87$) was actually slightly higher than the agreement between two human instructors ($\kappa = 0.77$).
  • Stability: Using gpt-4.1 (at zero temperature), the system achieved a 65.2% exact match rate across five independent runs, with a maximum score variance of only 1 point.
  • Efficiency: Grading a full cohort cost roughly $0.11 per student and took minutes, compared to an estimated 10 hours of manual labor for a human instructor.
  • Resilience: The system successfully resisted most prompt-injection attacks, thanks to "safety guardrails" that sanitize student input before it reaches the model.
TABLE I: Run-to-run stability over five independent HW1 grading runs (23 students). Exact: percentage of students with identical total assignment scores. Max Range: largest per- student score range across runs. Conf. flips: percentage of question-level confidence labels that changed across runs.

Limitations and Future Work

While the results are promising, the authors note that open-ended interpretation remains the "final boss" of autograding. While the LLM is good at checking logic, truly subjective reasoning is still best handled by a human.

The study was also limited to a small class size (24 students). The next step is to see if this "path-aware" approach can scale to massive open online courses (MOOCs) where thousands of students might take thousands of different, valid paths through a single notebook. For now, the authors recommend keeping a human in the loop to review "low-confidence" flags—a hybrid approach that saves time without sacrificing pedagogical integrity.

Summary updated

Abstract

Jupyter notebooks support open-ended, multi-step assessments in which students build one logical flow across interdependent steps, combining code, written analysis, and generated outputs such as plots. These reflect authentic scientific practice but are hard to grade consistently, since students may make different yet equally valid choices at each step, so a later answer can only be judged in light of the choices a student made earlier. We present an LLM-based autograder for such flow-structured notebook questions. It generates a rubric from a reference solution, then applies a softening pass that relaxes criteria tied to the reference so legitimate alternative paths are not penalized. Each question group is graded in a single model call, so later answers are judged against the student's own earlier choices, using question-type tags and schema-constrained, low-temperature outputs. Evidence is scored multimodally: code, text, numerical outputs, and figures from code cells. We deployed the tool in a machine-learning course, integrated with Gradescope, with a pre-submission format check and prompt-injection defenses, and evaluate it both in that live course and against archived submissions graded by staff in earlier terms. We report agreement, cross-model variance, cost, student perceptions, and injection resilience. With low-temperature models, agreement with human scores is often strong, including on the open-ended items the design specifically targets, while run-to-run stability depends sharply on the model's temperature support.
BibTeX
@misc{hajizada2026beyond,
  author = {Salman Hajizada and Mohammed Yusuf Ansari and Gianni Di Caro},
  title = {{Beyond Unit Tests: Path-Aware Rubric-Guided LLM Autograding of Notebooks}},
  year = {2026},
  eprint = {2611.28565},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.28565},
}
Figure