Latest Findings · ASI Lab

AI That Teaches Instead of Fixes: A Three Level Feedback Framework for Learning to Code

When a student's code fails, most AI assistants hand over a corrected solution and the student never learns the concept. This research builds a tutoring framework that first diagnoses the real misunderstanding, retrieves the exact concept from a curated knowledge base, then delivers feedback in three steps from a gentle hint to a targeted repair, so learners keep their role in the fix.

Yuchen Cao, Yifei Wang, Jacky Keung, Jingyu Zhang
Agentic Software Intelligence Research Lab · Department of Computer Science, City University of Hong Kong
ISET · 2026

When a student's code fails, most AI assistants hand over a corrected solution and the student never learns the concept. This research builds a tutoring framework that first diagnoses the real misunderstanding, retrieves the exact concept from a curated knowledge base, then delivers feedback in three steps from a gentle hint to a targeted repair, so learners keep their role in the fix.

A pipeline diagram showing how a programming problem, erroneous code, and runtime signals are diagnosed for misconceptions, matched to a curated instructional knowledge base, and turned into three levels of feedback as hints, concept explanations, and repair suggestions.
Overview of the proposed knowledge augmented hierarchical feedback framework. The system takes a programming problem, erroneous code, and runtime signals as input, performs pedagogical diagnosis and knowledge grounded retrieval, then generates hierarchical feedback as hints, concept explanations, and targeted repair suggestions.

Why it matters

Learning to program is hard precisely because a wrong answer hides a wrong mental model. A student who gets a corrected solution back learns nothing except that their answer was wrong; the gap in their understanding stays untouched. This work shifts the goal of AI support in programming education away from producing a correct answer and toward helping a learner actually understand why their code fails and how to revise it, which is the part that transfers to the next problem.

The framework solves a practical problem with today's LLM assistants: they are fluent but often not pedagogical. By separating the work into a diagnosis stage, a knowledge retrieval stage, and a staged feedback stage, the system stays honest and inspectable, and it can point at a specific teachable concept such as a sliding window invariant or a dynamic programming transition instead of guessing at generic advice. It keeps the tutor lightweight while still grounding every piece of advice in real instructional material.

The headline is that this approach is more educational without giving away too much accuracy. On a curated set it is far stronger on concept alignment and pedagogical usefulness than a direct LLM baseline, while still preserving most of the second attempt correction power that a pure repair prompt gets. That is the ideal middle ground for a classroom tool: guidance that teaches rather than a solver that replaces the learner.

Key findings

Teach the concept, not just the fix

What it means for practitioners

For educators and tool builders, this is a practical blueprint for making LLM based help genuinely instructional rather than answer giving. The key design choice is to insert a diagnostic stage and a concept retrieval stage before generation, so every piece of feedback is anchored to a named teachable idea such as a boundary condition mistake, a pointer update error, or a missing dynamic programming transition.

The three level output is easy to deploy in a real course: start learners with a hint, allow them to open a concept explanation, and only offer a targeted repair if they remain stuck. That graduated structure protects the learner's own reasoning, which is exactly what a classroom tutor does. Because the whole pipeline runs on one LLM with a compact curated knowledge base, it stays lightweight enough to fit into practice or assessment tooling.

Related reading

Get the paper & cite it

Download full PDF ↓ View at DOI

Official citation: Yuchen Cao, Yifei Wang, Jacky Keung, Jingyu Zhang (2026). From Fixes to Learning: Knowledge-Augmented Hierarchical Feedback for Programming Practice. Int. Symp. Educational Technology (ISET). DOI: .

programming feedback programming education code feedback LLM learning