Skip to main content
QUICK REVIEW

[论文解读] Play to Grade: Testing Coding Games as Classifying Markov Decision Process

Allen Nie, Emma Brunskill|arXiv (Cornell University)|Oct 27, 2021
Reinforcement Learning in Robotics参考文献 38被引用 4
一句话总结

本文提出 Play to Grade 方法,通过将交互式编程作业建模为马尔可夫决策过程(MDPs),利用强化学习自动评估学生代码。通过训练智能体探索并采样学生程序中的差异轨迹,分类器可实现 93.4–94.0% 的准确率,有效区分正确与存在错误的程序,显著优于仅基于代码文本的基线方法。

ABSTRACT

Contemporary coding education often presents students with the task of developing programs that have user interaction and complex dynamic systems, such as mouse based games. While pedagogically compelling, there are no contemporary autonomous methods for providing feedback. Notably, interactive programs are impossible to grade by traditional unit tests. In this paper we formalize the challenge of providing feedback to interactive programs as a task of classifying Markov Decision Processes (MDPs). Each student's program fully specifies an MDP where the agent needs to operate and decide, under reasonable generalization, if the dynamics and reward model of the input MDP should be categorized as correct or broken. We demonstrate that by designing a cooperative objective between an agent and an autoregressive model, we can use the agent to sample differential trajectories from the input MDP that allows a classifier to determine membership: Play to Grade. Our method enables an automatic feedback system for interactive code assignments. We release a dataset of 711,274 anonymized student submissions to a single assignment with hand-coded bug labels to support future research.

研究动机与目标

  • 为在线教育平台中交互式编程作业缺乏自动化反馈的问题提供解决方案。
  • 克服传统单元测试和代码文本分析在评估动态、用户交互式程序时的局限性。
  • 开发一种可扩展、可泛化的通用方法,用于识别学生编写的交互式程序中的错误,且不依赖静态代码分析。
  • 实现能够实时检测功能正确性与细微行为错误的反馈系统。
  • 通过发布包含 711,274 个匿名学生提交记录、并由人工标注错误的大型数据集,为未来研究提供支持。

提出的方法

  • 将交互式编程作业形式化为 MDPs,其中每个学生程序定义一个具有独特状态、动作和奖励动态的 MDP。
  • 训练一个协作智能体来运行学生程序,并采样能突出正确与错误行为差异的轨迹。
  • 采用对比学习框架(Contrastive HoareLSTM)学习轨迹嵌入,以区分正确与错误的 MDP。
  • 使用 10 种对比距离函数的多距离投票机制,提升最终分类的鲁棒性与泛化能力。
  • 利用预训练的“play-to-win”智能体生成高影响力、差异化的轨迹,以暴露潜在错误。
  • 设计一个兼容 OpenAI Gym 的环境,并发布 Bounce 数据集,以支持可复现性与未来研究。

实验结果

研究问题

  • RQ1是否可以不依赖代码文本分析,仅通过强化学习自动检测交互式学生程序中的错误?
  • RQ2协作智能体-分类器框架是否能有效识别学生游戏中正确与错误 MDP 之间的细微行为差异?
  • RQ3与传统的基于代码文本的评分方法相比,基于轨迹的分类方法在真实世界编程作业中的表现如何?
  • RQ4Play to Grade 框架在包含用户输入的非游戏类交互式编程作业中,其泛化能力如何?
  • RQ5迭代训练是否能提升分类器在识别多样化错误模式时的鲁棒性与准确性?

主要发现

  • Play to Grade 方法在将学生程序分类为正确或错误时,准确率达到 93.4–94.0%,相较于仅基于代码文本的基线方法,提升了 19–25 个百分点。
  • 采用轨迹采样的对比学习方法显著优于多数类基线(准确率仅 50.0%)。
  • 该方法在主体分布上达到 99.6% 的召回率,在尾部分布上达到 97.6%,表明对真正错误程序的检测能力极强。
  • 分类器在实现近乎完美的召回率的同时,保持了高精度(88.6–91.0%),显著减少了误报。
  • 该框架在不同程序分布上均表现出良好的泛化能力,包括常见与罕见的学生解决方案。
  • 发布包含 711,274 个提交记录及人工标注错误的 Bounce 数据集,为未来自动化反馈系统研究提供了宝贵基准。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。