Plan More, Debug Less: Applying Metacognitive Theory to AI-Assisted Programming Education

Tung Phung, Heeryung Choi, Mengyan Wu, Adish Singla, Christopher BrooksarXiv 2025

TL;DR

Grounding AI-generated programming hints in metacognitive theory—specifically offering structured planning, debugging, and optimization support—significantly alters how students approach coding problems. A real-world classroom study reveals that while students deeply engage with and benefit from proactive planning hints, they still reflexively default to reactive debugging when tasks get tough.

What Problem Does This Paper Address?

Generative AI tools are increasingly used to provide personalized feedback to computer science students, but most existing systems focus strictly on technical correctness or student preference. This lack of pedagogical grounding can foster "metacognitive laziness," where students rely on rapid, AI-fueled trial-and-error debugging rather than strategic thinking.

The authors address this gap by structuring AI feedback around metacognitive scaffolds—instructional supports that help students plan, monitor, and evaluate their learning processes. By explicitly separating hints into distinct problem-solving phases, the researchers aim to foster self-regulated learning (SRL) skills rather than just helping students pass test cases.

Methods

The authors introduced the AIMS (AI-generated hints based on Metacognitive Scaffolds) system, implemented as a JupyterLab extension. Instead of a free-form chatbot interface, AIMS uses a structured, button-based interface that offers three specific hint types mapped to metacognitive phases:

  • Planning Hints (Planning): Assist in initial strategy formulation and algorithmic steps without providing code.
  • Debugging Hints (Monitoring): Provide Socratic-style guidance to identify and fix a single bug, leveraging symbolic execution data (such as buggy output and an AI-repaired reference program).
  • Optimization Hints (Evaluation): Guide code quality, readability, and execution performance improvements.

To prevent help abuse, the system enforces a strict quota of five hints per question. When requesting a hint, students are prompted to reflect on their current progress or issues, providing context for the underlying LLM (GPT-4o) while encouraging active engagement.

Interaction flow between a student and the AIMS hint system

Datasets

The system was evaluated through a field study involving 102 students enrolled in a graduate-level introductory data science course at the University of Michigan. The dataset consists of student interactions across 14 Python programming questions (covering regular expressions, pandas data frame manipulation, and file handling) spanning four weekly assignments. In total, the deployment captured 725 hint requests across 366 student-question pairs.

Key Insights and Ideas

  • Planning is Valued but Underutilized Under Stress: Students rated planning hints higher and spent twice as long contemplating them compared to debugging hints. However, when facing harder questions, they didn't plan more; they simply asked for more debugging hints. This highlights a persistent tendency toward reactive troubleshooting over proactive strategy when cognitive load increases.
  • The Competency Gap in Help-Seeking: Counterintuitively, higher-competency students requested more hints overall, particularly planning hints. They appeared more persistent and willing to engage with structured support, whereas lower-competency peers were more prone to give up earlier or misuse optimization hints as desperate debugging aids.
  • Metacognitive Blindspots: Most students requested only a single hint type per question. This suggests a potential lack of metacognitive awareness; students may struggle to recognize exactly when they need planning support versus monitoring or evaluation support.

Key Results

  • Performance Boost: Requesting planning hints was consistently associated with a significantly higher final problem-solving rate ($p = 0.013$) across all student tiers.
  • Deeper Engagement: The median contemplation time for planning hints was 14.0 minutes, compared to just 7.1 minutes for debugging hints ($p = 0.006$). Planning hints also received significantly more revisits and higher helpfulness ratings from students.
  • Hint Distribution: Out of 725 total hints requested, students chose 411 debugging hints, 258 planning hints, and only 56 optimization hints.
Student engagement and perception metrics across different hint types

Limitations and Future Work

  • Causality vs. Correlation: The study shows a strong association between planning hint usage and high performance, but cannot definitively prove causality. Students with high intrinsic self-regulated learning skills might simply be more likely to request planning hints and succeed regardless.
  • Context Constraints: The evaluation was limited to a single course with a generous resubmission policy (leading to high baseline grades >92%), making it difficult to isolate long-term learning gains.
  • Future Directions: The authors suggest designing interventions that make planning explicit—such as requiring students to draft pseudocode or complete reflective exercises before coding—to bridge the gap for lower-competency students. They also propose exploring alternative interfaces, such as conversational chatbots, integrated with these metacognitive guardrails.

Summary updated

BibTeX
@misc{phung2025plan,
  author = {Tung Phung and Heeryung Choi and Mengyan Wu and Adish Singla and Christopher Brooks},
  title = {{Plan More, Debug Less: Applying Metacognitive Theory to AI-Assisted Programming Education}},
  year = {2025},
  eprint = {2509.03171},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.03171},
}
Figure