Large Language Models (LLMs) are revolutionizing the field of computing education with their powerful code-generating capabilities. Traditional pedagogical practices have focused on code writing tasks, but there is now a shift in importance towards code reading, comprehension and evaluation of LLM-generated code. Alongside this shift, an important new skill is emerging -- the ability to solve programming tasks by constructing good prompts for code-generating models. In this work we introduce a new type of programming exercise to hone this nascent skill: 'Prompt Problems'. Prompt Problems are designed to help students learn how to write effective prompts for AI code generators. A student solves a Prompt Problem by crafting a natural language prompt which, when provided as input to an LLM, outputs code that successfully solves a specified programming task. We also present a new web-based tool called Promptly which hosts a repository of Prompt Problems and supports the automated evaluation of prompt-generated code. We deploy Promptly for the first time in one CS1 and one CS2 course and describe our experiences, which include student perceptions of this new type of activity and their interactions with the tool. We find that students are enthusiastic about Prompt Problems, and appreciate how the problems engage their computational thinking skills and expose them to new programming constructs. We discuss ideas for the future development of new variations of Prompt Problems, and the need to carefully study their integration into classroom practice.
翻译:大型语言模型(LLMs)以其强大的代码生成能力正在彻底改变计算机教育领域。传统教学实践侧重于代码编写任务,但如今重点正转向对LLM生成代码的阅读、理解和评估。伴随这一转变,一项重要的新技能正在涌现——即通过为代码生成模型构建优质提示词来解决编程任务的能力。本文提出一种新型编程练习以锤炼这一新兴技能: "Prompt Problems"。Prompt Problem旨在帮助学生学会如何为AI代码生成器编写有效的提示词。学生通过构思一段自然语言提示词来解决Prompt Problem,该提示词作为LLM的输入后,能输出成功解决指定编程任务的代码。我们还推出一个名为Promptly的新型网络工具,它托管了Prompt Problems的习题库,并支持对提示词生成代码的自动化评估。我们首次在CS1和CS2课程中部署了Promptly,并描述了相关经验,包括学生对此类新型活动的认知及其与工具的互动。研究发现,学生对Prompt Problems充满热情,并赞赏这些练习能够激发他们的计算思维技能,并引导他们接触新的编程结构。本文还讨论了未来开发Prompt Problems变体的构想,以及将其融入课堂实践所需审慎研究的必要性。