Table of Contents
Fetching ...

Explaining Code Examples in Introductory Programming Courses: LLM vs Humans

Arun-Balajiee Lekshmi-Narayanan, Priti Oli, Jeevan Chapagain, Mohammad Hassany, Rabin Banjade, Peter Brusilovsky, Vasile Rus

TL;DR

The feasibility of using LLMs to generate code explanations for passive and active example exploration systems is assessed and the code explanations generated by chatGPT are compared with the explanations generated by both experts and students.

Abstract

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.

Explaining Code Examples in Introductory Programming Courses: LLM vs Humans

TL;DR

The feasibility of using LLMs to generate code explanations for passive and active example exploration systems is assessed and the code explanations generated by chatGPT are compared with the explanations generated by both experts and students.

Abstract

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.
Paper Structure (7 sections, 2 figures, 3 tables)

This paper contains 7 sections, 2 figures, 3 tables.

Figures (2)

  • Figure 1: Sample Data illustrating the various entries under each column in our dataset.
  • Figure 2: This ChatGPT Prompt template considers the case that ChatGPT could generate a better explanation with an additional "nudge" as observed above. In most cases, the generated explanations using the prompt at the second iteration produces richer explanation than the first iteration.