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

有目的地解释代码:一种培养代码理解与提示工程技能的整合方法

Explaining Code with a Purpose: An Integrated Approach for Developing Code Comprehension and Prompting Skills

Paul Denny, David H. Smith, Max Fowler, James Prather, Brett A. Becker, Juho Leinonen

AI总结:

针对EiPE代码解释题评分难的问题,提出利用LLM根据学生的EiPE回答生成代码的方法,既实现自动评分,又同步培养学生的代码理解与提示构建技能,并在入门编程课中验证了效果与学生接受度。

摘要:

阅读、理解和解释代码历来是编程新手学习的重要技能。随着大语言模型(LLM)的普及,鉴于人们对理解和评估模型生成代码的需求日益增长,这些基础技能的重要性更胜以往。学习者还需要掌握全新的技能,例如构建清晰提示、让LLM生成预期代码的能力。因此,学界对整合教学方法以同时培养传统编程能力和与LLM交互所需的新技能抱有极大兴趣。\n培养和评估代码理解能力的一种有效方法是“用通俗英语解释”(EiPE)问题,即要求学生简洁地解释一段代码的用途。然而,由于评估书面解释具有主观性,EiPE问题的评分一直存在难度,这也阻碍了该方法的推广应用。\n本文探究了EiPE问题与代码生成型LLM之间的天然协同作用,以克服这一局限。我们提出利用LLM根据学生对EiPE问题的回答生成代码——这不仅能实现EiPE回答的自动评分,还能帮助学生同步培养必备的代码理解能力和提示构建技能。我们在一门编程入门课程中验证了这一思路,报告了学生在构建有效提示以解决EiPE问题方面的表现,同时考察了学生对该活动的看法,以及该活动如何影响他们对使用LLM辅助和评估学习的观点。

英文摘要:

Reading, understanding and explaining code have traditionally been important skills for novices learning programming. As large language models (LLMs) become prevalent, these foundational skills are more important than ever given the increasing need to understand and evaluate model-generated code. Brand new skills are also needed, such as the ability to formulate clear prompts that can elicit intended code from an LLM. Thus, there is great interest in integrating pedagogical approaches for the development of both traditional coding competencies and the novel skills required to interact with LLMs. One effective way to develop and assess code comprehension ability is with ``Explain in plain English'' (EiPE) questions, where students succinctly explain the purpose of a fragment of code. However, grading EiPE questions has always been difficult given the subjective nature of evaluating written explanations and this has stifled their uptake. In this paper, we explore a natural synergy between EiPE questions and code-generating LLMs to overcome this limitation. We propose using an LLM to generate code based on students' responses to EiPE questions -- not only enabling EiPE responses to be assessed automatically, but helping students develop essential code comprehension and prompt crafting skills in parallel. We investigate this idea in an introductory programming course and report student success in creating effective prompts for solving EiPE questions. We also examine student perceptions of this activity and how it influences their views on the use of LLMs for aiding and assessing learning.

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

↑