Comparing Code Explanations Created by Students and Large Language Models
Open accessThe DOI matches its Crossref record; 51 of the 51 references it cites were found in a registry or an index.
Abstract
Reasoning about code and explaining its purpose are fundamental skills for computer scientists. There has been extensive research in the field of computing education on the relationship between a student's ability to explain code and other skills such as writing and tracing code. In particular, the ability to describe at a high-level of abstraction how code will behave over all possible inputs correlates strongly with code writing skills. However, developing the expertise to comprehend and explain code accurately and succinctly is a challenge for many students. Existing pedagogical approaches that scaffold the ability to explain code, such as producing exemplar code explanations on demand, do not currently scale well to large classrooms. The recent emergence of powerful large language models (LLMs) may offer a solution. In this paper, we explore the potential of LLMs in generating explanations that can serve as examples to scaffold students' ability to understand and explain code. To evaluate LLM-created explanations, we compare them with explanations created by students in a large course (n ≈ 1000) with respect to accuracy, understandability and length. We find that LLM-created explanations, which can be produced automatically on demand, are rated as being significantly easier to understand and more accurate summaries of code than student-created explanations. We discuss the significance of this finding, and suggest how such models can be incorporated into introductory programming education.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The source backs part of the claim, not all of it — or backs it for a different population, condition or comparison.
In the citing paper
“although LLMs are able to provide better explanations of code than students [123]”
From The Robots Are Here: Navigating the Generative AI Revolution in Computing Education (2023) · cites this paper as [123]
Experimental — accuracy not yet measuredThe source backs part of the claim, not all of it — or backs it for a different population, condition or comparison.
In the citing paper
“As introductory students realise that generative AI can outperform them on most tasks, they may lose motivation to learn the material, and become demoralised about the future of computing [123].”
From The Robots Are Here: Navigating the Generative AI Revolution in Computing Education (2023) · cites this paper as [123]
Experimental — accuracy not yet measuredThe cited source says what the claim attributes to it.
In the citing paper
“This has been inspired by many other instances where LLMs have already demonstrated remarkable effectiveness in generating novel language artifacts. These include course readings [22], code explanations [23, 28, 29, 41], model solutions [9, 35, 42], feedback [34], or responses to help requests [18, 26, 46, 47].”
From A Comparative Study of AI-Generated (GPT-4) and Human-crafted MCQs in Programming Education (2024) · cites this paper as [23]
Experimental — accuracy not yet measuredThe cited source says what the claim attributes to it.
In the citing paper
“LLMs can also generate good explanations of code [94,123,137,174].”
From The Robots Are Here: Navigating the Generative AI Revolution in Computing Education (2023) · cites this paper as [123]
The check wasn’t confident either way, so it gives no verdict — never disputed.
In the citing paper
“The most common concern expressed by authors about student learning was the potential for students to become over-reliant on generative AI tools to solve problems [33,85,123,126,169] and assist in debugging code [125,150,199].”
From The Robots Are Here: Navigating the Generative AI Revolution in Computing Education (2023) · cites this paper as [123]
Experimental — accuracy not yet measured
2 more claims about this paper
Create a free account to see every claim other papers make about this one.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Language Models are Few-Shot Learners
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020) · arXiv · doi:10.48550/arxiv.2005.14165 · Cited by 23,372 · cited 1×
“Some of these code explanations were selected from the explanations generated by students during Lab A, and some were generated by the large language model GPT-31 [4].”
BackgroundOn a Test of Whether one of Two Random Variables is Stochastically Larger than the Other
Mann, H. B., & Whitney, D. R. (1947) · The Annals of Mathematical Statistics · doi:10.1214/aoms/1177730491 · Cited by 14,320
The ASA Statement on p -Values: Context, Process, and Purpose
Wasserstein, R. L., & Lazar, N. A. (2016) · The American Statistician · doi:10.1080/00031305.2016.1154108 · Cited by 6,306 · cited 1×
“Following the guidelines of [45] and the broader discussion in [35], we use 𝑝 values as only one source of evidence and outline supporting statistics including two effect sizes – Rank-Biserial (RBC) Correlation [19] and Common-Language Effect Size (CLES) [28] – when presenting the results of the…”
MethodEvaluating Large Language Models Trained on Code
Chen, M., Tworek, J., Jun, H., Yuan, Q., Pinto, H. P. D. O., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., et al. (2021) · arXiv · doi:10.48550/arxiv.2107.03374 · Cited by 1,436
A common language effect size statistic
McGraw, K. O., & Wong, S. P. (1992) · Psychological Bulletin · doi:10.1037/0033-2909.111.2.361 · Cited by 934
The simple difference formula: An approach to teaching nonparametric correlation
Kerby, D. S. (2014) · Comprehensive Psychology · doi:10.2466/11.it.3.1 · Cited by 806 · cited 2×
“Following the guidelines of [46] and the broader discussion in [37], we use 𝑝 values as only one source of evidence and outline supporting statistics including two effect sizes – Rank-Biserial (RBC) Correlation [19] and Common-Language Effect Size (CLES) [30] – when presenting the results of the study.”
MethodProgram comprehension during software maintenance and evolution
Von Mayrhauser, A., & Vans, A. M. (1995) · Computer · doi:10.1109/2.402076 · Cited by 575
Automatic Generation of Programming Exercises and Code Explanations Using Large Language Models
Sarsa, S., Denny, P., Hellas, A., & Leinonen, J. (2022) · Proceedings of the 2022 ACM Conference on International Computing Education Research - Volume 1 · doi:10.1145/3501385.3543957 · Cited by 497 · cited 3×
“This is also the type of explanation that LLMs seem to be best at creating [36].”
BackgroundMethodInfluentialSelf-citationThe Robots Are Coming: Exploring the Implications of OpenAI Codex on Introductory Programming
Finnie-Ansley, J., Denny, P., Becker, B. A., Luxton-Reilly, A., & Prather, J. (2022) · Proceedings of the 24th Australasian Computing Education Conference · doi:10.1145/3511861.3511863 · Cited by 463
Self-citationBecker, B. A., Denny, P., Finnie-Ansley, J., Luxton-Reilly, A., Prather, J., & Santos, E. A. (2023) · Proceedings of the 54th ACM Technical Symposium on Computer Science Education V. 1 · doi:10.1145/3545945.3569759 · Cited by 401
Self-citation
Research works printed but not linked: 2
- Nea Pirttinen and Juho Leinonen. 2022. Can Students Review Their Peers? Comparison of Peer and Instructor Reviews. In Proc. of the 27th ACM Conf. on Innovation and Technology in Computer Science Education Vol 1.
- Simon and Susan Snowdon. 2011. Explaining Program Code: Giving Students the Answer Helps - but Only Just. In Proc. of the Seventh Int. Workshop on Computing Education Research. ACM, 93--100.
Cited by
Items 301–358 of 358
One Workflow to Grade Them All: LLM-Enabled Auto-grading for Comprehensive, Personalized Feedback
Chandarana, M., & Ramachandra, S. (2026) · ASEE Annual Conference & Exposition · doi:10.18260/1-2--60347
Bekhouche, S. E., & Hadid, A. (2024) · IEEE International Conference on Artificial Intelligence Circuits and Systems (AICAS) · doi:10.1109/aicas59952.2024.10595920
AskNow: An LLM-powered Interactive System for Real-Time Question Answering in Large-Scale Classrooms
Liu, Z., Wang, Y., Ho, H.-R., Wu, Y., Zhao, Y., & Mutlu, B. (2026) · CHI Conference on Human Factors in Computing Systems · doi:10.1145/3772318.3790328
Nguyen, Q., & Puthiyedth, N. (2026) · Western Canadian Conference on Computing Education · doi:10.1145/3828792.3828795
Multimodal Quiz Generation via RAG with LLM-as-Judge Evaluation
Kunuku, M. T., & Dehbozorgi, N. (2025) · IEEE Frontiers in Education Conference (FIE) · doi:10.1109/fie63693.2025.11328244
Talati, S., & Fatahi, S. (2026) · IEEE International Conference on Intelligent Systems · doi:10.1109/is71416.2026.11727334
Nikou, S. A., Perifanou, M. A., & Economides, A. A. (2026) · Lecture notes in networks and systems · doi:10.1007/978-3-032-24998-2_6
Cornelison, K. (2025) · EdArXiv (OSF Preprints) · doi:10.35542/osf.io/uqhe2_v1
Jarvie-Eggart, M. E., Teahen, J. R., Masker, D. T., Padilla, J., Ureel, L. C., Brown, L. E., Pomerville, S., & Sticken, J. (2026) · Journal of Teaching and Learning with Technology · doi:10.14434/jotlt.v14i1.41701
Jayalath, V., Barthakur, A., Dawson, S., Tingey, J., Crase, L., & Kovanović, V. (2026) · Computers and Education Artificial Intelligence · doi:10.1016/j.caeai.2026.100689
Policy-as-Code Auto-Remediation with Human-Centered Explanations
Keshap, P., Hosabettu, A., & Mittal, A. (2025) · International Conference on Computer and Applications (ICCA) · doi:10.1109/icca66035.2025.11430947
Non-Traditional Methods for Teaching Python Programming with Large Language Models
Bubaš, G., & Konecki, M. (2025) · International Convention on Information and Communication Technology, Electronics and Microelectronics · doi:10.1109/mipro65660.2025.11132057
Mak, J., Nabende, J. N., Clear, T., Clear, A., Albluwi, I., Andrei, O., Angeli, L., MacNeil, S., Oyelere, S. S., Rattigan, M. H., et al. (2025) · doi:10.1145/3760545
Self-citationNathaniel, J. (2026) · UEF eRepo (University of Eastern Finland)
Investigating Conversational Agents to Support Secondary School Students Learning CSPPreprint
Frazier, M., Damevski, K., & Pollock, L. (2026) · arXiv (Cornell University) · doi:10.48550/arxiv.2604.16213
Gohr, A., Lawn, M.-A., Gao, K., Serjeant, I., & Heslip, S. (2026) · arXiv (Cornell University) · doi:10.48550/arxiv.2601.03458
Investigating conversational agents to support secondary school computer science exploratory search
Frazier, M. (2024) · Library, Museums and Press - UDSpace (University of Delaware) · doi:10.58088/1gk5-9t60
Cipriano, B. M. P. (2025) · Portuguese National Funding Agency for Science, Research and Technology (RCAAP Project by FCT)
Towards automatic vulnerability management in open-source software
Yang, X. (2025) · Mspace (University of Manitoba)
Vishnu, S. G. S. (2026) · International Journal of Advance Scientific Research and Engineering Trends · doi:10.65521/ijasret.v9i11.1288
da Silva, T. L. (2026) · Lume (Universidade Federal do Rio Grande do Sul)
Assessing the Prevalence of AI-assisted Cheating in Programming Courses: A Pilot StudyPreprint
Delphino, K. (2025) · arXiv (Cornell University) · doi:10.48550/arxiv.2507.06438
Fudge, M. (2026) · Syracuse University Libraries (Syracuse University)
Yalwa, A. S., Othman, M. S., Yusuf, L. M., & Almarshadi, M. S. (2026) · Cogent Education · doi:10.1080/2331186x.2026.2745324
Case Study—AdWords to AdWards: AI as a Coding Partner in Teaching Online Optimization Algorithms
Pachamanova, D. A., Tilson, V., & Dwyer‐Matzky, K. (2026) · INFORMS Transactions on Education · doi:10.1287/ited.2025.0147ca
Bernstein, S., & Sibia, N. (2026) · Koli Calling International Conference on Computing Education Research · doi:10.1145/3856208.3856217
Self-citationExploring the Value of Diverse LLM Explanations in Introductory Programming
Bernstein, S., Denny, P. C., Leinonen, J., Patel, K. S. V., Nasimova, R., Littlefield, M., & MacNeil, S. (2026) · arXiv (Cornell University) · doi:10.48550/arxiv.2606.28882
Self-citationBalfroid, M., Julien, A., Dzenatan, A., Devroey, X., & Vanderose, B. (2026) · arXiv (Cornell University) · doi:10.48550/arxiv.2607.26987
Πέλλας, Ν. (2026) · Journal of Educational Computing Research · doi:10.1177/07356331261504318
HUMAN-CENTERED AI DEVELOPMENT FOR AUGMENTED COGNITION
Doliashvili, M. (2024) · ScholarSpace (University of Hawaii at Manoa)
EDBooks: AI-Enhanced Interactive Narratives for Programming EducationPreprint
Oney, S., Shen, Y. G., Wu, F. L., Hong, Y. S., Wang, Z., Khajekar, Y., Zhang, J., & Wang, A. Y. (2024) · arXiv (Cornell University) · doi:10.48550/arxiv.2411.10687
Code Summarizer: A Deep Learning Transformer-Based Model (CS-DLT)
Bibi, N., Rana, T. A., Sohail, M., Iqbal, K., & Alaulamie, A. A. (2026) · IEEE International Conference on Computing and Machine Intelligence (ICMI) · doi:10.1109/icmi68585.2026.11539816
Zhang, W. (2026) · Aaltodoc (Aalto University)
From Source-Based Quizzes to Reteaching Decisions: A Practitioner Guide to ClassQuestPreprint
Sun, Z. (2026) · arXiv (Cornell University) · doi:10.48550/arxiv.2611.02590
Pedagogical Execution Traces (PETs) for Educational Algorithm Visualization
Weninger, M. (2026) · IEEE Working Conference on Software Visualization (VISSOFT) · doi:10.1109/vissoft71254.2026.00023
Novices’ Code Comprehension Performance When Freely Prompting LLMs for Assistance
Sajib, M. I., Chapagain, J., Tamang, S., Kendeou, P., & Rus, V. (2026) · Lecture notes in computer science · doi:10.1007/978-3-032-31660-8_29
Evaluating Generative AI as a Programming Assistant for Computer Application Students
Semaidaa, M. B. (2026) · Theseus (Ammattikorkeakoulujen)
Is Solving Better Than Evaluating GenAI Solutions?Preprint
Dickey, E., Mertzanidis, M., & Psomas, A. (2026) · arXiv (Cornell University) · doi:10.48550/arxiv.2607.27586
An Intelligent Agentic System for Autonomous Codebase Enhancement
Gawali, S., Chavan, T., Johnson, J., Abbey, A. M., & Rukhande, S. (2026) · doi:10.1109/icoicet68875.2026.11761319
Gupta, R. D., Hosain, M. T., Mridha, M. F., & Ahmed, S. U. (2025) · arXiv (Cornell University) · doi:10.48550/arxiv.2503.06552
Impiö, J. (2025) · Aaltodoc (Aalto University)
Evaluating Logical Structure in Computer Programs Using LLMs
Tamang, S., Adnan, M. A. M., Sajib, M. I., & Rus, V. (2026) · Proceedings of the ... International Florida Artificial Intelligence Research Society Conference · doi:10.32473/flairs.39.1.141793
Sengul, C., Neykova, R., & Destefanis, G. (2024) · doi:10.3389/frai.2024.1436350.s001
Saleh, A., Tesfay, T. W., Nguyen, P. T., Rocco, J. D., Zeshan, M. U., & Ruscio, D. D. (2026) · IEEE International Conference on Software Maintenance (ICSM) · doi:10.1109/icsme67971.2026.00070
The effectiveness of Todaii Easy English application on students' grammar acquisition
Hozen, M. S. (2025) · eTheses of Maulana Malik Ibrahim State Islamic University (Maulana Malik Ibrahim State Islamic University)
Systematically Understanding of Code Semantic Interpretation for LLMs
Zhao, J. (2025) · Applied and Computational Engineering · doi:10.54254/2755-2721/2025.22701
Hasibuan, A. A., Septiani, A. D., Aryanti, S. D., Saragih, N. M., & Sari, P. L. P. (2026) · Bahastra Jurnal Pendidikan Bahasa dan Sastra Indonesia · doi:10.30743/bahastra.v11i1.14366
Kharchenko, Y. V., & Бабенко, О. М. (2024) · eSSPU Institutional Repository
AI-verktyg för mer effektiv kodning : En jämförelse mellan olika AI-verktygs effektivitet
Langenbach Moe, I. (2024) · Publications (Mid Sweden University)
Self-Explanation Tutor for Active Study of CS1 Worked ExamplesPreprint
Narayanan, A. B. L., Hassany, M., Akhüseyinoğlu, K., Hendrawan, R. A., & Brusilovsky, P. L. (2026) · arXiv (Cornell University) · doi:10.48550/arxiv.2608.25180
Imashev, A., Abisheva, Z., Tusseyeva, I., Kozhirbayev, Z., Alizadeh, T., & Matkarimov, B. T. (2026) · Research Square · doi:10.21203/rs.3.rs-10677896/v1
Beyond Static Comments: How AI and Chatbots Affect Source Code Comprehension
Piscitelli, A., Rosa, M. D., Buonocore, K., Coiro, M., Fuccella, V., & Costagliola, G. (2026) · Procedia Computer Science · doi:10.1016/j.procs.2026.10.046
Rashid, P., Tithi, S. D., Eren, B. A., Alemdar, M., & Shi, Y. (2026) · Koli Calling International Conference on Computing Education Research · doi:10.1145/3856208.3856250
Small Language Models for Generating Code Comments
Abedini, K., Koutcheme, C., Fan, J., Hellas, A., & Leinonen, J. (2026) · Aaltodoc (Aalto University)
Self-citation"It's Weird That it Knows What I Want": Usability and Interactions with Copilot for Novice Programmers
Prather, J., Reeves, B. N., Denny, P., Becker, B. A., Leinonen, J., Luxton-Reilly, A., Powell, G., Finnie-Ansley, J., & Santos, E. A. (2023) · arXiv
“Large language models have also been found to be capable of producing pedagogical code explanations [58, 67, 94].”
BackgroundSelf-citationHarnessing LLMs in Curricular Design: Using GPT-4 to Support Authoring of Learning Objectives
Sridhar, P., Doyle, A., Agarwal, A., Bogart, C., Savelka, J., & Sakr, M. (2023) · arXiv · doi:10.48550/arxiv.2306.17459
Metadata
- Authors
- Leinonen, J., Denny, P., MacNeil, S., Sarsa, S., Bernstein, S., Kim, J., Tran, A., & Hellas, A.
- Affiliations
- University of Auckland (NZ)
- Temple University (US)
- Aalto University (FI)
- ORCID
- Venue
- Proceedings of the 2023 Conference on Innovation and Technology in Computer Science Education V. 1
- Publisher
- ACM
- Published
- 2023-06-29
- Pages
- 124-130
- OpenAlex
- W4382654294
- Cited by
- 210
- References
- 49
- Citations by year
- 2026: 37 · 2025: 76 · 2024: 78 · 2023: 19
- FWCI
- 63.20
- Type
- conference paper
- Language
- en
- Open access
- hybrid
- doi.org
- Licence
- Locations
- ACM Conference on Innovation and Technology in Computer Science Education (ITiCSE) (publishedVersion, cc-by)
- arXiv (Cornell University) (submittedVersion)
- Aaltodoc (Aalto University) (submittedVersion, cc-by)
- arXiv (Cornell University)
- Funders
- Ulla Tuominen Foundation
- Topics
- Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Intelligent Tutoring Systems and Adaptive Learning
- Keywords
- code explanation, large language models, program comprehension, scaffolding, introductory programming education
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.