Correctness, Convergence, and AI-Generated Code Detection: A Longitudinal Study of Student and Large Language Model Code in Introductory Programming
Runlong Ye, Jing Fan, Angela Zavaleta Bernuy, Oscar Karnalim, Paul Denny, Juho Leinonen, Michael Liut
Abstract
Large language models can generate plausible solutions to programming assignments, making it tempting to detect their use by matching student code against a reference bank of generated solutions. Yet similar code can also arise when an assignment admits only a few natural implementations, which leaves open what a match actually shows. We investigate generated-reference matching using 29,970 student submissions from ten Python labs offered in 2021, 2023, and 2025, together with 90,000 solution attempts generated retrospectively by three frontier LLMs. We validate the generated solutions using hidden instructor tests, compare code with MOSS after excluding the starter code, and examine the exact abstract syntax tree (AST) forms of selected functions. The models usually produced correct solutions and, across most assignments, converged on similar implementations. Student submissions matched the generated references more often in later cohorts, including among submissions that passed every hidden test. On tightly specified functions, the models converged on a few exact abstract-syntax-tree forms, and the number of distinct student forms also declined across cohorts, whereas open-ended functions remained diverse in both sources. Most reported overlaps were short, making the minimum match length an important choice when reviewing students' code. Finally, we discuss how instructors can build a reference bank of generated solutions before releasing an assignment to identify tasks on which generated solutions converge, decide how much review a match warrants, and redesign tasks to elicit tests, reasoning, and intermediate work. These findings support tracking population-level changes in submitted code, while attributing AI use to an individual submission would require additional evidence about how it was produced, such as prompts, revisions, intermediate code, and student disclosures.
Create a lesson
Related papers
Designing for Interpretation Uncertainty: Architecture and Principles for Topological Learning Analytics Dashboards
Hitoshi Inoue, Koichi Yasutake
Participation-Sensitive Convergence and the Fragment First, Converge Later Pattern in Asynchronous Online Learning: A Topological Analysis Across 22 OULAD Courses
Hitoshi Inoue, Koichi Yasutake
Architecture Without an Architect? Global Governance of Artificial Intelligence in a Divided World
Simon Chesterman
Judgement in the Age of Jev: From Evaluation Scarcity to Evaluation Abundance
Richard Hill
WIP: DBWorkout: A Gamified SQL Practice Platform to Support Formative Learning in Database Courses
Sehrish Basir Nizamani, Deepika Devaraj, Tien Nguyen et al.
Understanding Student Use of Large Language Models Across Computer Science Subfields
Sehrish Basir Nizamani, Yoonje Lee, Nikitha Donekal Chandrashekar et al.