
Preprint: Code patterns offer weak evidence of AI use in student programming work
Subhankar Maity, Faiza Belbachir, Omar Boucelma, Guilherme Medeiros Machado
arXiv preprint
500-Wörter-Zusammenfassung

A study tested whether a technique called Min-K% could estimate whether segments of Python code resemble material a language model saw during training. When applied to five consented student group submissions from a data science hackathon, the method produced area-under-the-curve values between 0.58 and 0.64, indicating some ability to separate model-generated segments from student-written ones. The method also attributed the highest likelihood of generation to GPT-5 (ChatGPT), matching students' chat logs that showed ChatGPT was their primary assistant.
The work addresses a practical problem in programming education. Instructors can no longer assume a correct final submission reflects a student's learning, because large language models can produce functional code instantly. The authors argue that assessment should shift from inspecting the final product to tracing how code was developed. They propose using membership inference, a privacy analysis technique, to detect possible model involvement and support process-oriented feedback.
The authors extended Min-K% for code data. The method splits code into tokens, queries a language model for token probabilities, and computes the average log probability of the lowest 10% of tokens. To create comparison examples, they introduced synthetic code generation using five transformation strategies: variable renaming, reordering, logic injection, cross-language conversion, and novel pattern creation. A structural distance check over 500 pairs suggested the synthetic non-members were distinct from the originals.
Before testing on student data, the team validated the approach on Stack Overflow-derived code from the ProCQA dataset. Among free models tested on about 3,000 samples per class, DistilGPT-2 achieved the highest area under the curve at 0.713. GPT-2 had the strongest true positive rate at a 5% false positive rate with 18.19%. Commercial models, evaluated on about 200 samples per class due to budget constraints, generally scored lower. Gemini-2.5-Flash was the best commercial performer with an AUC of 0.654, while GPT-5 led in the low false positive rate metric at 10.14%. Provider-side privacy measures may explain the weaker signals from commercial systems.
The educational proof-of-concept used submissions from groups who also shared their interaction logs. True positive rates at a 5% false positive rate stayed below 9% for all groups, and precision varied widely, from 0.233 for Group 5 to 0.895 for Group 2. A qualitative review showed that feature engineering was the most common stage for AI assistance, followed by package imports, model training, and evaluation plots.
This is an arXiv preprint and the findings should be read as exploratory. The paper notes that the method detects training data membership, which can conflate content generated fresh by a model with manually retrieved material from sources like Stack Overflow. The small sample of five groups and the reliance on self-reported logs also limit the strength of educational conclusions. Still, the work offers a concrete illustration of what provenance analysis might look like in a classroom dashboard, where an instructor could see which parts of an assignment were likely generated and for which programming concepts.
The authors do not claim that instructors should use the output to automatically penalize students. Instead, they frame the tool as a pedagogical filter that could make large-scale formative feedback more feasible. The difference in detection performance between free and paid models is presented as a trade-off: free models may reveal more about possible training data exposure, although the experiment did not independently verify the providers’ privacy protections.


