Curriculum-grounded retrieval-augmented generation in programming education: Response quality, student perceptions, and performance in a randomized controlled trial
Background Large language models can support programming instruction, but even technically accurate responses may introduce programming constructs beyond the taught curriculum, a mismatch this study terms response dispersion. This randomized controlled trial examined whether an integrated curriculum-grounded configuration improved response quality, student perceptions, and programming performance relative to a standard large language model chatbot. The intervention combined course-material retrieval, source citation, curricular constraints, a structured response format, and uncertainty signaling, and the randomized contrast evaluated this combination as a whole. Results Participants were 106 undergraduates in an introductory Python course. Across 120 sampled query-response pairs, experts rated responses from the curriculum-grounded configuration as more factually accurate, better aligned with the curriculum, and more pedagogically appropriate. The mean proportion of out-of-scope constructs per response was 7%, compared with 38% for the standard chatbot (d = 2.13). Students assigned to the curriculum-grounded configuration reported greater perceived usefulness and trustworthiness; perceived ease of use did not differ statistically. They also submitted projects sooner, completed more of them, and produced code that passed a higher proportion of tests. Total query volume did not differ statistically, although regular weekly use was more common in the curriculum-grounded condition. In a diagnostic analysis, the condition difference in the Composite Performance Index remained statistically significant after adjustment for query volume, F (1, 103) = 25.11, p < .001. Exploratory analyses identified indirect associations through usefulness and trustworthiness and reproduced the covariance pattern proposed by the response quality–perception–performance cascade. Because perceptions were assessed retrospectively in Week 8, this pattern is interpreted alongside alternative transparency-first and mastery-first orderings. Conclusions In this introductory Python course, the integrated curriculum-grounded configuration was associated with higher-quality, less dispersed sampled responses and, under random assignment, with improved participant-level coursework outcomes. The findings identify response dispersion as a curricular design concern and support further evaluation of curriculum grounding and perceived trustworthiness in generative AI-assisted education. The findings do not isolate the contribution of retrieval or establish that the response quality–perception–performance sequence is causal; longitudinal, component-level studies are needed to test these mechanisms and whether the observed advantages persist.
Authors
- Hsin‐Yu Lee (ORCID: https://orcid.org/0000-0003-3257-305X)
- Ting-Ting Wu
Institutions
- National Yunlin University of Science and Technology (TW)
Publication Details
- Journal
- International Journal of STEM Education
- Published
- 2026-12-01
- DOI
- https://doi.org/10.1186/s40594-026-00664-5
- Primary Topic
- Teaching and Learning Programming
- Type
- article
- Field-Weighted Citation Impact
- 0.00