How Does LLM-powered Coding Assistance Shape Incidental Learning? Exploring Cognitive Forcing Strategies in Programming Education

Authors

  • Ba-Thinh Tran-Le Department of Computer Science, University of Dayton, Ohio, 45469, USA
  • Patrick Thomas Department of Computer Science, University of Dayton, Ohio, 45469, USA
  • Nicholas M. Stiffler Department of Computer Science, University of Dayton, Ohio, 45469, USA
  • Thuy Ngoc Nguyen Department of Computer Science, University of Dayton, Ohio, 45469, USA

DOI:

https://doi.org/10.1609/aaai.v40i48.42121

Abstract

Many AI-based code assistants, particularly those powered by Large Language Models (LLMs), provide complete solutions, which can reduce active problem solving and limit incidental learning, the acquisition of knowledge as a byproduct of task engagement. Such learning requires active participation rather than passive acceptance of AI-generated answers, which might be incorrect. This study examines how incidental learning can be supported through guided interaction. We present LeetCoach, an LLM-assisted coding platform that applies a cognitive forcing strategy, prompting learners to reflect and take incremental steps instead of receiving full solutions. Using LeetCode-style questions, we conducted a pilot study with novice and advanced college programmers who completed tasks under assisted and unassisted conditions. Novices showed substantial post-test gains despite receiving AI guidance only during the intervention, suggesting that incidental exposure improved later performance. Advanced learners showed smaller gains. Across both groups, participants required fewer debugging attempts in the post-test compared to earlier stages, indicating improved debugging efficiency and algorithmic understanding. These findings provide early evidence that LLMs can be designed to promote indirect learning while shaping problem-solving strategies. This work offers a proof of concept for cognitively informed tutoring systems in computer science education and discusses implications for integrating LLMs to enhance both immediate outcomes and lasting skill development.

Published

2026-03-14

How to Cite

Tran-Le, B.-T., Thomas, P., Stiffler, N. M., & Nguyen, T. N. (2026). How Does LLM-powered Coding Assistance Shape Incidental Learning? Exploring Cognitive Forcing Strategies in Programming Education. Proceedings of the AAAI Conference on Artificial Intelligence, 40(48), 40880–40888. https://doi.org/10.1609/aaai.v40i48.42121