arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.03938cs.CYcs.AIcs.CLcs.HCcs.SE
收藏

比较学生与大型语言模型生成的代码解释

Comparing Code Explanations Created by Students and Large Language Models

University of Auckland(奥克兰大学);Temple University(天普大学);Aalto University(阿尔托大学)

Juho Leinonen, Paul Denny, Stephen MacNeil, Sami Sarsa, Seth Bernstein, Joanne Kim, Andrew Tran, Arto Hellas

AI总结:

本文比较了大型语言模型与学生生成的代码解释,发现LLM生成的解释在可理解性和准确性上显著更优,并探讨了其在入门编程教育中的应用潜力。

摘要:

对代码进行推理并解释其用途是计算机科学工作者的基本技能。在计算教育领域,已有大量研究探讨学生解释代码的能力与编写代码、追踪代码等其他技能之间的关系。特别是,能否在较高抽象层次上描述代码在所有可能输入下的行为,与代码编写能力密切相关。然而,对许多学生而言,培养准确且简洁地理解和解释代码的专业能力是一项挑战。现有的旨在支撑代码解释能力的教学方法(例如按需生成范例代码解释)目前难以很好地扩展到大型课堂。近年来出现的强大大型语言模型(LLMs)可能提供一种解决方案。本文探索了LLMs在生成解释方面的潜力,这些解释可作为范例,用于支撑学生理解和解释代码的能力。为评估LLM生成的解释,我们将其与一门大型课程($n \approx 1000$)中学生生成的解释在准确性、可理解性和长度方面进行比较。我们发现,LLM生成的解释可以按需自动生成,并且被评价为比学生生成的解释显著更易理解、对代码的总结更准确。我们讨论了这一发现的意义,并提出了如何将此类模型融入入门编程教育的建议。

英文摘要:

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 \approx 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑