arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.05056cs.LG
收藏

用380万条程序轨迹建模学生学习

Modeling Student Learning with 3.8 Million Program Traces

MIT CSAIL(麻省理工学院计算机科学与人工智能实验室);Stanford University(斯坦福大学);University of Florida(佛罗里达大学)

Alexis Ross, Megha Srivastava, Jeremiah Blanchard, Jacob Andreas

AI总结:

本文通过分析380万条程序轨迹,探讨训练语言模型以理解学生编程行为及学习过程,发现基于真实轨迹的模型能更准确预测学生行为并生成更正确的代码。

摘要:

随着程序员编写代码,他们经常多次编辑和重试,产生丰富的'交互轨迹',揭示他们如何接近编码任务并提供关于技能发展的线索。对于初学者而言,这些轨迹反映了他们用于编码的多样化推理过程,如探索性行为以理解编程概念的工作方式,因错误重新策略化,以及个性化风格选择。在本文中,我们探讨了训练语言模型以学习这些推理轨迹能带来什么:不仅关于代码,还关于程序员,尤其是学习编程的学生。我们引入了一个包含超过380万条编程推理轨迹的数据集,来自Pencil Code,一个免费的在线教育平台,学生使用它来学习简单的编程概念。与仅训练于最终程序或合成轨迹的模型相比,我们发现训练于真实轨迹的模型在建模多样化学生行为方面更强。通过行为和探测分析,我们还发现许多代码轨迹属性,如目标回溯或注释数量,可以从学习到的学生表示中预测。基于这一结果,我们展示了如何通过引导代码生成模型,帮助学生从错误中恢复,通过识别一系列编辑步骤,以生成更正确的代码,同时保持与原始学生风格的接近。共同,我们的结果表明,许多代码属性是学生个体属性,训练于编辑轨迹可以导致更可控、更能预测学生编程行为的模型,并在最终状态生成更正确的代码。代码和数据可在https://github.com/meghabyte/pencilcode-public获取。

英文摘要:

As programmers write code, they often edit and retry multiple times, creating rich "interaction traces" that reveal how they approach coding tasks and provide clues about their level of skill development. For novice programmers in particular, these traces reflect the diverse reasoning processes they employ to code, such as exploratory behavior to understand how a programming concept works, re-strategizing in response to bugs, and personalizing stylistic choices. In this work, we explore what can be learned from training language models on such reasoning traces: not just about code, but about coders, and particularly students learning to program. We introduce a dataset of over 3.8 million programming reasoning traces from users of Pencil Code, a free online educational platform used by students to learn simple programming concepts. Compared to models trained only on final programs or synthetically-generated traces, we find that models trained on real traces are stronger at modeling diverse student behavior. Through both behavioral and probing analyses, we also find that many properties of code traces, such as goal backtracking or number of comments, can be predicted from learned representations of the students who write them. Building on this result, we show that we can help students recover from mistakes by steering code generation models to identify a sequence of edits that will results in more correct code while remaining close to the original student's style. Together, our results suggest that many properties of code are properties of individual students and that training on edit traces can lead to models that are more steerable, more predictive of student behavior while programming, and better at generating programs in their final states. Code and data is available at https://github.com/meghabyte/pencilcode-public

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

↑