As Large Language Models (LLMs) gain in popularity, it is important to understand how novice programmers use them. We present a thematic analysis of 33 learners, aged 10-17, independently learning Python through 45 code-authoring tasks using Codex, an LLM-based code generator. We explore several questions related to how learners used these code generators and provide an analysis of the properties of the written prompts and the generated code. Specifically, we explore (A) the context in which learners use Codex, (B) what learners are asking from Codex, (C) properties of their prompts in terms of relation to task description, language, and clarity, and prompt crafting patterns, (D) the correctness, complexity, and accuracy of the AI-generated code, and (E) how learners utilize AI-generated code in terms of placement, verification, and manual modifications. Furthermore, our analysis reveals four distinct coding approaches when writing code with an AI code generator: AI Single Prompt, where learners prompted Codex once to generate the entire solution to a task; AI Step-by-Step, where learners divided the problem into parts and used Codex to generate each part; Hybrid, where learners wrote some of the code themselves and used Codex to generate others; and Manual coding, where learners wrote the code themselves. The AI Single Prompt approach resulted in the highest correctness scores on code-authoring tasks, but the lowest correctness scores on subsequent code-modification tasks during training. Our results provide initial insight into how novice learners use AI code generators and the challenges and opportunities associated with integrating them into self-paced learning environments. We conclude with various signs of over-reliance and self-regulation, as well as opportunities for curriculum and tool development.
翻译:随着大语言模型(LLMs)日益普及,理解新手程序员如何使用它们变得至关重要。我们对33名10-17岁学习者进行了主题分析,这些学习者在自定进度学习环境中通过45项代码编写任务使用基于LLM的代码生成器Codex独立学习Python。我们探讨了关于学习者如何使用这些代码生成器的若干问题,并对所编写提示词及生成代码的特性进行了分析。具体来说,我们探究了:(A)学习者使用Codex的上下文情境;(B)学习者向Codex提出的请求内容;(C)提示词在任务描述关联性、语言清晰度及提示词构建模式方面的特征;(D)AI生成代码的正确性、复杂度与精确性;(E)学习者在代码整合、验证及手动修改过程中利用AI生成代码的方式。此外,我们的分析揭示了使用AI代码生成器编程时的四种不同编码方法:AI单次提示法(学习者仅通过一次提示让Codex生成完整解决方案)、AI分步法(学习者将问题分解并与Codex协作生成各步骤编码)、混合法(学习者自行编写部分代码并结合Codex生成其余代码)、以及手动编码法(学习者完全自主编写代码)。采用AI单次提示法的学习者在代码编写任务中获得了最高正确性分数,但在训练后续代码修改任务中得分最低。本研究初步揭示了新手学习者如何使用AI代码生成器,以及将其融入自定进度学习环境所带来的挑战与机遇。我们最后总结了过度依赖与自我调节的显性特征,以及课程与工具开发的潜在方向。