Generative neural models hold great promise in enhancing programming education by synthesizing new content for students. We seek to design neural models that can automatically generate programming tasks for a given specification in the context of visual programming domains. Despite the recent successes of large generative models like GPT-4, our initial results show that these models are ineffective in synthesizing visual programming tasks and struggle with logical and spatial reasoning. We propose a novel neuro-symbolic technique, NeurTaskSyn, that can synthesize programming tasks for a specification given in the form of desired programming concepts exercised by its solution code and constraints on the visual task. NeurTaskSyn has two components: the first component is trained via imitation learning procedure to generate possible solution codes, and the second component is trained via reinforcement learning procedure to guide an underlying symbolic execution engine that generates visual tasks for these codes. We demonstrate the effectiveness of NeurTaskSyn through an extensive empirical evaluation and a qualitative study on reference tasks taken from the Hour of Code: Classic Maze challenge by Code-dot-org and the Intro to Programming with Karel course by CodeHS-dot-com.
翻译:生成式神经模型通过为学生合成新内容,在增强编程教育方面展现出巨大潜力。我们致力于设计能够根据给定规范在视觉编程领域自动生成编程任务的神经模型。尽管GPT-4等大型生成模型近期取得了成功,但初步结果表明这些模型在合成视觉编程任务方面效果欠佳,且在逻辑与空间推理上存在困难。为此,我们提出一种新颖的神经符号技术——NeurTaskSyn,它能根据以预期编程概念(通过解题代码体现)和视觉任务约束形式给出的规范合成编程任务。NeurTaskSyn包含两个组件:第一个组件通过模仿学习流程训练以生成可能的解题代码,第二个组件通过强化学习流程训练以指导底层符号执行引擎,从而为这些代码生成视觉任务。我们通过广泛的实证评估以及基于Code-dot-org的“编程一小时:经典迷宫”挑战和CodeHS-dot-com的“Karel编程入门”课程中参考任务的定性研究,展示了NeurTaskSyn的有效性。