arXiv:2504.08958cs.CLcs.AI2025-04中稿 · AIED 2025被引 7

用大模型分析学生编程思路,即使代码有语法错误也能给规划反馈

Generating Planning Feedback for Open-Ended Programming Exercises with LLMs

  • 用大模型识别程序中的高阶目标与编程模式,捕捉解题规划
  • GPT-4o-mini微调后效果接近GPT-4o,准确率显著优于传统代码分析方法
  • 适合用于自动评分系统,尤其对语法错误但思路正确的代码提供反馈

完成开放性编程题需要学生既制定高层次解决方案,又正确实现语法。然而,现有自动评分系统仅基于测试用例判断最终提交的正确性,无法提供规划过程反馈。大语言模型(LLM)可通过检测代码结构,在存在语法错误时仍能识别学生方案中的高阶目标与编程模式。本文提出一种基于LLM的方案,可有效检测学生程序中的计划要素。实验表明,完整版GPT-4o和小型变体GPT-4o-mini均能以极高准确率完成检测,优于基于传统代码分析的基线方法。进一步发现,微调后的小型模型(GPT-4o-mini)性能与最先进的GPT-4o相当,展现出低成本实现实时评分的巨大潜力。该方法可集成至自动评分系统中,为开放性编程题提供针对隐含规划能力的反馈,即使程序语法错误亦可生效。此外,该思路还可推广至数学、物理等需先制定解题步骤再逐步推导的领域。

原文摘要 · Abstract (English)

To complete an open-ended programming exercise, students need to both plan a high-level solution and implement it using the appropriate syntax. However, these problems are often autograded on the correctness of the final submission through test cases, and students cannot get feedback on their planning process. Large language models (LLM) may be able to generate this feedback by detecting the overall code structure even for submissions with syntax errors. To this end, we propose an approach that detects which high-level goals and patterns (i.e. programming plans) exist in a student program with LLMs. We show that both the full GPT-4o model and a small variant (GPT-4o-mini) can detect these plans with remarkable accuracy, outperforming baselines inspired by conventional approaches to code analysis. We further show that the smaller, cost-effective variant (GPT-4o-mini) achieves results on par with state-of-the-art (GPT-4o) after fine-tuning, creating promising implications for smaller models for real-time grading. These smaller models can be incorporated into autograders for open-ended code-writing exercises to provide feedback for students' implicit planning skills, even when their program is syntactically incorrect. Furthermore, LLMs may be useful in providing feedback for problems in other domains where students start with a set of high-level solution steps and iteratively compute the output, such as math and physics problems.

编程教育大模型自动评分教学反馈

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。