# Explaining Code Examples in Introductory Programming Courses: LLM vs Humans

arXiv: https://arxiv.org/abs/2403.05538 · HTML: https://mlsanity.com/paper/2403.05538/

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 9 Dec 2023.

## Built on by (most cited first, 3 of 3)

- [Comparing LLM-generated and human-authored news text using formal syntactic theory](https://mlsanity.com/paper/2506.01407/) (2025)
- [From Critique to Clarity: A Pathway to Faithful and Personalized Code Explanations with Large Language Models](https://mlsanity.com/paper/2501.14731/) (2024)
- [Human-AI Co-Creation of Worked Examples for Programming Classes](https://mlsanity.com/paper/2402.16235/) (2024)

## Abstract (arXiv)

Worked examples, which present an explained code for solving typical programming problems are among the most popular types of learning content in programming classes. Most approaches and tools for presenting these examples to students are based on line-by-line explanations of the example code. However, instructors rarely have time to provide explanations for many examples typically used in a programming class. In this paper, we assess the feasibility of using LLMs to generate code explanations for passive and active example exploration systems. To achieve this goal, we compare the code explanations generated by chatGPT with the explanations generated by both experts and students.
