In a randomized controlled trial of 106 first-year undergraduates in an introductory Python course, students assigned to an integrated curriculum-grounded retrieval-augmented generation chatbot submitted weekly projects sooner, completed more assignments, and wrote code that passed a higher proportion of automated tests than peers using a standard large language model chatbot. Conducted in Fall 2025 at a public university in Taiwan and published in December 2026 in the International Journal of STEM Education by Ting-Ting Wu and Hsin-Yu Lee, the study examined whether grounding responses in verified course materials improves output quality, student perceptions, and assisted coursework outcomes. Because the intervention bundled retrieval with citations, curricular constraints, structured formatting, and uncertainty signaling, the randomized contrast evaluated the complete configuration as a whole.
The study addressed a mismatch the authors call response dispersion, defined as the inclusion of programming constructs or solution approaches beyond the curriculum covered when a student submits a query, regardless of factual accuracy. Whereas hallucination concerns false or misleading information, response dispersion concerns curricular scope, meaning the two problems can occur independently or together. In one observed exchange from the standard chatbot condition, a beginner asking how to extract a string from the back in Python received five technically valid approaches—itertools.islice, operator.getitem, collections.deque, regular expressions, and format alignment—even though the course taught only negative indexing. Such technically correct but unfamiliar alternatives leave novices without a basis for identifying the method their instructor expects. Wu and Lee designed the trial to test whether a curriculum-grounded system reduces response dispersion and whether response quality, student perceptions, and programming performance covary in a proposed progression termed the cascade.
All 106 participants were first-year undergraduates without formal prior programming experience, comprising 60 men (56.6 percent) and 46 women (43.4 percent) aged 18 to 21 years (mean 19.8). Participation was voluntary, rewarded with additional learning support rather than grade adjustments, and accompanied by written informed consent. Randomization stratified by gender and Week 1 midterm exam scores—assessing the first half of the syllabus from 0 to 100—assigned 53 students to the curriculum-grounded condition and 53 to the standard chatbot. Baseline tests detected no statistically significant group differences in gender, age, midterm score, or prior technology experience. The eight-week study spanned the semester’s second half as coursework moved from basic syntax to functions, data structures, and file operations: Week 1 provided a 30-minute onboarding session, Weeks 2 through 7 comprised six weekly projects, and Week 8 collected retrospective evaluations. Instructors and teaching assistants remained blinded to condition assignments.
Both conditions shared the same language model, GPT-4.1-mini, the same LINE messaging interface familiar to Taiwanese students, an n8n backend workflow, and a general pedagogical prompt emphasizing clear explanations, practical code examples, and common pitfalls. The curriculum-grounded configuration added five integrated features: semantic retrieval from a course-material vector index, explicit document and page citations, prompts requiring course terminology and aligned examples, a structured response layout, and uncertainty signaling when retrieved materials were insufficient. Its architecture separated offline preparation from real-time generation. Offline, OCRFlux-3B extracted text, code diagrams, and flowcharts from course PDFs into Markdown to preserve topic hierarchies; OpenAI’s text-embedding-3-small model converted passages into dense vector embeddings; and a Pinecone index stored those vectors with metadata tagging source, topic, and course sequence. Online, student queries were embedded with the same model, matched against Pinecone via cosine similarity, and sent with top retrieved passages to GPT-4.1-mini.
Three independent experts—two introductory Python instructors and one educational technology specialist—evaluated a stratified random sample of 120 query-response pairs, 60 per condition, across all six weeks, five course topics, and four query types, achieving good to excellent inter-rater reliability (intraclass correlations 0.83 to 0.91). On five-point scales, curriculum-grounded responses scored significantly higher in curriculum alignment (d = 2.23), pedagogical appropriateness (d = 1.08), factual accuracy (d = 0.68), and the three-dimension pedagogical quality composite (d = 1.70), while source transparency confirmed visible citations (mean 4.53 versus 1.92, d = 3.70). An exploratory topic analysis found the alignment advantage was largest for data structures (d = 2.68) and smallest for control structures (d = 1.85). Two separate coders directly quantified dispersion (Cohen’s kappa = 0.85), showing standard chatbot outputs averaged 2.85 out-of-scope constructs (38 percent per response) and 2.25 alternative solutions, compared with 0.35 constructs (7 percent, d = 2.13) and 1.08 solutions (d = 1.35) for the curriculum-grounded chatbot.
All 106 students completed a Technology Acceptance Model questionnaire during a scheduled Week 8 class, rating items from 1 to 7 across three subscales with strong internal consistency (Cronbach’s alpha 0.85 to 0.91) and confirmatory factor analysis support. Students assigned to the curriculum-grounded chatbot reported significantly greater perceived usefulness (d = 1.22) and higher trustworthiness (d = 1.50) than peers using the standard chatbot. By contrast, perceived ease of use—serving as a manipulation check under the shared LINE interface—did not differ statistically between the curriculum-grounded condition (mean 5.82, SD 0.81) and the standard condition (mean 5.68, SD 0.85; p = .387, d = 0.17), a result confirmed by a nonparametric Mann-Whitney U test. The authors suggest trustworthiness may serve as a complementary acceptance construct for generative AI because novices struggle to verify novel explanations directly, though in this trial perceived trustworthiness cannot be separated from the visible source citations.
Participant-level differences also appeared across all three objective coursework measures, with every student recording at least one submission for each of the six weekly projects. Learning management system records showed that curriculum-grounded students submitted projects an average of 6.14 hours sooner after release than peers in the standard condition (d = 0.80). They achieved an 11.64-percentage-point higher completion rate, passing an average of 5.49 of 6 projects versus 4.79 in the standard group (d = 0.78), and scored 11.33 percentage points higher in code correctness on predefined automated test cases (d = 0.88). Combining the three standardized measures equally into a Composite Performance Index yielded roughly a one-standard-deviation advantage (d = 1.04). A repeated-measures analysis revealed a significant condition-by-week interaction for submission speed (p = .014): although both groups submitted earlier over time, the gap widened from d = 0.52 in Week 2 to d = 1.15 in Week 7.
Automated n8n interaction logs from Weeks 2 through 7 tracked assigned-system exposure. Total query volume did not differ statistically between conditions, averaging 27.5 queries (SD 11.8) in the curriculum-grounded group versus 23.2 (SD 12.5) in the standard group (p = .071, d = 0.35). However, engagement was more sustained among curriculum-grounded users: they were active in more weeks (mean 5.2 versus 4.5, p = .002, d = 0.63) and more frequently met the regular-use criterion of querying in at least four of six weeks (90.6 percent versus 73.6 percent, p = .023), although weekly activity declined modestly after Week 3 in both groups. Total queries correlated with the Composite Performance Index (r = .23, p = .018). In diagnostic sensitivity models, the condition advantage remained statistically significant after adjusting for query volume (F(1, 103) = 25.11, p < .001) and after adding active weeks (F(1, 102) = 20.18, p < .001), though post-randomization exposure adjustments gauge sensitivity rather than isolate an effect independent of use.
Exploratory regression and path analyses reproduced the covariance pattern proposed by the cascade, though the authors emphasize these findings represent retrospective indirect associations rather than causal mediation. Perceived usefulness statistically accounted for 37.8 percent of the condition difference in composite performance (indirect effect 0.30, 95% CI [0.10, 0.55]). In a parallel model, the indirect association through trustworthiness (45.0 percent) exceeded that through ease of use (2.5 percent; contrast 0.34, 95% CI [0.11, 0.63]). A serial specification tracing condition through usefulness and trustworthiness to performance showed a non-zero indirect path of 0.12 (95% CI [0.05, 0.24]), with total indirect associations representing 55.0 percent of the condition difference; usefulness and trustworthiness were strongly correlated (r = .70). An exploratory moderation analysis found the trustworthiness-related indirect association was larger at lower baseline ability (0.49, 95% CI [0.22, 0.81]) and mean ability (0.36) than at higher ability (0.24, 95% CI [-0.01, 0.50]). The authors interpret these patterns through cognitive load theory—element interactivity and the expertise reversal effect—while noting cognitive load was not measured.
Several limitations bound how these findings can be interpreted. Because the intervention combined five features, the trial cannot isolate which component produced the participant-level differences or whether retrieval alone would suffice. Because perceptions were gathered retrospectively in Week 8 after project outcomes accumulated, the exploratory models cannot distinguish the cascade from transparency-first or mastery-first orderings, and saturated path models cannot validate causal direction. Cognitive load, verification behavior, self-efficacy, and outside resources—including other AI tools, web search, textbooks, and peer discussion—were unmeasured, while label blinding left visible citations and response structure intact. Treating 120 sampled query-response pairs from 53 students per group as independent, naturally occurring prompts may overstate precision, and fitting ten multivariate models to 106 students limits statistical stability. Finally, this single-course trial tested one technical stack on assisted coursework rather than unaided competence, retention, or transfer, underscoring the need for factorial, longitudinal, and multisite replications.
Subject of Research: Curriculum-grounded retrieval-augmented generation chatbots in introductory Python programming education
Article Title: Curriculum-grounded retrieval-augmented generation in programming education: Response quality, student perceptions, and performance in a randomized controlled trial
Article References: Wu, T.-T., & Lee, H.-Y. (2026). Curriculum-grounded retrieval-augmented generation in programming education: Response quality, student perceptions, and performance in a randomized controlled trial. International Journal of STEM Education, 13(1), Article 71. https://doi.org/10.1186/s40594-026-00664-5
Image Credits: AI Generated
DOI: 10.1186/s40594-026-00664-5
Keywords: retrieval-augmented generation, programming education, Python instruction, response dispersion, curriculum alignment, randomized controlled trial, large language models, student perceptions, perceived trustworthiness, perceived usefulness, Technology Acceptance Model, cognitive load theory, source transparency, code correctness, undergraduate computer science, vector embeddings, expertise reversal effect, AI-assisted learning
Cite Scienmag News
Courtney Benton. (December 2, 2026). Curriculum-grounded AI chatbot improves introductory Python coursework in randomized trial. Scienmag. https://scienmag.com/curriculum-grounded-ai-chatbot-improves-introductory-python-coursework-in-randomized-trial/
Courtney Benton. "Curriculum-grounded AI chatbot improves introductory Python coursework in randomized trial." Scienmag, 2 December 2026, https://scienmag.com/curriculum-grounded-ai-chatbot-improves-introductory-python-coursework-in-randomized-trial/. Accessed 2 December 2026.
Courtney Benton. "Curriculum-grounded AI chatbot improves introductory Python coursework in randomized trial." Scienmag. December 2, 2026. https://scienmag.com/curriculum-grounded-ai-chatbot-improves-introductory-python-coursework-in-randomized-trial/








