← Latest papers
💬 NLP

Using LLMs for Knowledge Component-level Correctness Labeling in Open-ended Coding Problems

This paper proposes an automated framework leveraging large language models to generate fine-grained knowledge component-level correctness labels from open-ended student code, demonstrating that this approach yields more cognitively consistent learning curves and improved predictive performance compared to traditional problem-level labeling methods.

Original authors: Zhangqi Duan, Arnav Kankaria, Dhruv Kartik, Andrew Lan

Published 2026-03-31
📖 4 min read☕ Coffee break read

Original authors: Zhangqi Duan, Arnav Kankaria, Dhruv Kartik, Andrew Lan

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a teacher grading a student's essay. If the essay has a few typos and a wrong conclusion, you might give it a "B" or a "C." That's a problem-level grade. It tells you the final result, but it doesn't tell you what the student actually learned. Did they understand the grammar? Did they grasp the main argument? Or did they just get lucky with the conclusion?

In computer science education, this is a huge problem. When a student writes code to solve a problem, the computer usually just says "Pass" or "Fail." If the code fails, we assume the student failed at everything. But in reality, a student might have perfectly understood how to use a "loop" (a repeating action) but messed up the "string manipulation" (handling text).

The Problem: The "All-or-Nothing" Mistake
Traditional systems treat coding like a light switch: it's either ON (correct) or OFF (incorrect). This is like grading a math test by only looking at the final answer. If a student gets the answer wrong, the system assumes they don't know any of the math steps leading up to it. This confuses the computer models that try to predict how students learn, making their "learning curves" look jagged and unrealistic.

The Solution: The "AI Teaching Assistant"
The authors of this paper built a smart system using Large Language Models (LLMs)—the same type of AI that powers chatbots—to act as a super-observant teaching assistant. Instead of just looking at the final "Pass/Fail" result, this AI reads the student's code line-by-line to check specific skills, which they call Knowledge Components (KCs).

Think of a coding problem as a recipe for a cake.

  • KC 1: Do you know how to preheat the oven?
  • KC 2: Do you know how to mix the batter?
  • KC 3: Do you know how to frost the cake?

If the cake comes out burnt (the code fails), a traditional system says, "You failed at baking."
The new AI system says, "Wait! The student preheated the oven perfectly and mixed the batter correctly. They just forgot to frost the cake. Let's give them credit for the first two skills and only mark the frosting as incorrect."

How It Works (The Magic Trick)

  1. The Detective Work: The AI reads the student's code and the list of skills required for the problem. It acts like a detective, asking: "Did the student use a loop? Yes. Did they use it correctly? Yes. Did they use string manipulation? Yes, but they made a mistake here."
  2. The Context Clue: Sometimes, a student's first attempt is a messy draft, and their last attempt is a polished solution. The AI looks at the student's final attempt to figure out what strategy they were trying to use, then goes back to grade their first attempt based on that strategy. It's like looking at a student's final essay to understand what they were trying to say, then grading their first rough draft with that context in mind.
  3. The Chain of Thought: The AI doesn't just guess. It is prompted to "think out loud" (Chain of Thought), explaining its reasoning before giving a grade. This makes the AI much more accurate, similar to how a human teacher explains why an answer is wrong.

The Results: Smoother Learning Curves
When the researchers tested this, the results were like watching a blurry photo suddenly come into focus.

  • Old Way: The learning curve looked like a messy scribble. It didn't make sense because the system thought students were failing skills they actually knew.
  • New Way: The learning curve became a smooth, downward slope. This matches how humans actually learn: as you practice a specific skill (like loops), you make fewer mistakes over time.

Why This Matters
This isn't just about better grades. It's about personalized learning.

  • If a system knows a student is great at loops but bad at strings, it can give them practice problems that focus only on strings.
  • If the system thinks the student failed everything, it might force them to redo the whole lesson, wasting their time.

In a Nutshell
This paper introduces a way to use AI to grade the ingredients of a student's code, not just the final dish. By giving credit for the parts a student got right, even if the final code failed, the system creates a much clearer, more accurate picture of how students learn. It turns a blunt "Fail" into a helpful roadmap for improvement.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →