Advances in natural language processing have resulted in large language models (LLMs) that are capable of generating understandable and sensible written text. Recent versions of these models, such as OpenAI Codex and GPT-3, can generate code and code explanations. However, it is unclear whether and how students might engage with such explanations. In this paper, we report on our experiences generating multiple code explanation types using LLMs and integrating them into an interactive e-book on web software development. We modified the e-book to make LLM-generated code explanations accessible through buttons next to code snippets in the materials, which allowed us to track the use of the explanations as well as to ask for feedback on their utility. Three different types of explanations were available for students for each explainable code snippet; a line-by-line explanation, a list of important concepts, and a high-level summary of the code. Our preliminary results show that all varieties of explanations were viewed by students and that the majority of students perceived the code explanations as helpful to them. However, student engagement appeared to vary by code snippet complexity, explanation type, and code snippet length. Drawing on our experiences, we discuss future directions for integrating explanations generated by LLMs into existing computer science classrooms.
翻译:自然语言处理的进步产生了大型语言模型(LLMS),能够产生可理解和合理的书面文本,这些模型的最近版本,如OpenAI Codex和GPT-3,可以生成代码和代码解释;然而,尚不清楚学生是否和如何可以参与这种解释;在本文件中,我们报告了利用LLMS生成多种代码解释类型的经验,并将其纳入关于网络软件开发的互动电子手册;我们修改了电子手册,使LLM生成的代码解释可以通过材料中代码片段旁边的按钮获得,从而使我们能够跟踪解释的使用情况,并征求对其用途的反馈;为每个可解释代码片段的学生提供三种不同的解释类型;逐行解释;重要概念清单,以及代码的高级摘要;我们的初步结果显示,所有解释品种都被学生看到,大多数学生认为代码解释对他们有帮助;然而,学生的参与似乎因代码拼写复杂性、解释类型和代码缩写长度而不同。在我们的历上,我们讨论以现有磁盘形式将解释纳入计算机教室的未来方向。