Evaluating the Quality of Code Comments Generated by Large Language Models for Novice Programmers

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Fan, Aysa Xuemo, Narayanan, Arun Balajiee Lekshmi, Hassany, Mohammad, Ke, Jiaze
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910616510267392
author Fan, Aysa Xuemo
Narayanan, Arun Balajiee Lekshmi
Hassany, Mohammad
Ke, Jiaze
author_facet Fan, Aysa Xuemo
Narayanan, Arun Balajiee Lekshmi
Hassany, Mohammad
Ke, Jiaze
contents Large Language Models (LLMs) show promise in generating code comments for novice programmers, but their educational effectiveness remains under-evaluated. This study assesses the instructional quality of code comments produced by GPT-4, GPT-3.5-Turbo, and Llama2, compared to expert-developed comments, focusing on their suitability for novices. Analyzing a dataset of ``easy'' level Java solutions from LeetCode, we find that GPT-4 exhibits comparable quality to expert comments in aspects critical for beginners, such as clarity, beginner-friendliness, concept elucidation, and step-by-step guidance. GPT-4 outperforms Llama2 in discussing complexity (chi-square = 11.40, p = 0.001) and is perceived as significantly more supportive for beginners than GPT-3.5 and Llama2 with Mann-Whitney U-statistics = 300.5 and 322.5, p = 0.0017 and 0.0003). This study highlights the potential of LLMs for generating code comments tailored to novice programmers.
format Preprint
id arxiv_https___arxiv_org_abs_2409_14368
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Evaluating the Quality of Code Comments Generated by Large Language Models for Novice Programmers
Fan, Aysa Xuemo
Narayanan, Arun Balajiee Lekshmi
Hassany, Mohammad
Ke, Jiaze
Software Engineering
Artificial Intelligence
Human-Computer Interaction
Large Language Models (LLMs) show promise in generating code comments for novice programmers, but their educational effectiveness remains under-evaluated. This study assesses the instructional quality of code comments produced by GPT-4, GPT-3.5-Turbo, and Llama2, compared to expert-developed comments, focusing on their suitability for novices. Analyzing a dataset of ``easy'' level Java solutions from LeetCode, we find that GPT-4 exhibits comparable quality to expert comments in aspects critical for beginners, such as clarity, beginner-friendliness, concept elucidation, and step-by-step guidance. GPT-4 outperforms Llama2 in discussing complexity (chi-square = 11.40, p = 0.001) and is perceived as significantly more supportive for beginners than GPT-3.5 and Llama2 with Mann-Whitney U-statistics = 300.5 and 322.5, p = 0.0017 and 0.0003). This study highlights the potential of LLMs for generating code comments tailored to novice programmers.
title Evaluating the Quality of Code Comments Generated by Large Language Models for Novice Programmers
topic Software Engineering
Artificial Intelligence
Human-Computer Interaction
url https://arxiv.org/abs/2409.14368