arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.11076cs.SE
收藏

DebugTA:一种基于LLM的智能体,用于简化编程教育中的调试与教学

DebugTA: An LLM-Based Agent for Simplifying Debugging and Teaching in Programming Education

Shanghai Jiao Tong University(上海交通大学);Fudan University(复旦大学)

Lingyue Fu, Haowei Yuan, Datong Chen, Xinyi Dai, Qingyao Li, Weinan Zhang, Weiwen Liu, Yong Yu

AI总结:

针对编程教育中调试与教学任务输入复杂且未充分利用标准代码的挑战,提出基于LLM的智能体DebugTA,通过专用工具和任务分解简化推理并对齐代码,显著提升教学效果并降低计算成本。

摘要:

在编程教育中,调试与教学(DT)任务是一个常见场景,学生在该场景中获得纠正错误代码的帮助。该任务涉及多种输入,包括错误代码、错误消息、参考解决方案和问题描述,目标是生成针对错误代码的修改建议。然而,两个关键挑战阻碍了现有方法的有效性。首先,DT任务中固有的输入复杂性和异构性显著提升了LLM面临的推理挑战。其次,现有方法通常未能充分利用DT任务中标准代码的可用性,迫使模型仅依赖复杂的多步推理,这限制了LLM在有效解决DT任务方面的潜力。为了应对这些挑战,我们提出了DebugTA,一种基于LLM的新型调试与教学智能体,配备了用于标准代码检索、变量替换以对齐参考代码的专用工具,以及用于实时代码分析的外部编译器。在明确的教学和调试原则指导下,DebugTA作为一个智能体,将复杂任务分解为顺序的LLM交互,每次交互利用不同的工具处理特定子任务,从而简化每一步的逻辑推理并降低整体推理复杂度。此外,DebugTA利用工具调用尽可能将标准代码与错误代码对齐,使LLM能够专注于错误代码中的逻辑错误,并提高生成建议的准确性。为了严格评估修改建议的质量,我们引入了学生模拟器-教师交互范式。在三个真实世界代码数据集上的实验结果表明,DebugTA持续提升教学效果,同时显著降低了计算成本。

英文摘要:

In programming education, Debugging and Teaching (DT) task is a common scenario where students receive assistance in correcting their erroneous code. The task involves multiple inputs, including erroneous code, error messages, reference solutions, and the question description, with the goal of generating modification suggestions to the erroneous code. However, two key challenges hinder the effectiveness of existing approaches. Firstly, the complexity and heterogeneity of inputs inherent in DT tasks significantly elevate the reasoning challenges faced by LLMs. Second, existing approaches often fail to fully leverage the availability of standard code in DT tasks, forcing models to rely solely on complex multi-step reasoning, which limits the potential of LLMs in addressing DT tasks effectively. To address these challenges, we propose DebugTA, a novel LLM-based debugging and teaching agent with specialized tools for standard code retrieval, variable substitution to align reference code, and an external compiler for real-time code analysis. Guided by explicit pedagogical and debugging principles, DebugTA acts as an agent that decomposes a complex task into sequential LLM interactions, each utilizing distinct tools for specific subtasks, thereby simplifying the logical reasoning at each step and reducing overall reasoning complexity. Furthermore, DebugTA utilizes tool calls to align the standard code with the erroneous code as much as possible, allowing the LLM to focus on logic errors within the erroneous code and improving the accuracy of the generated suggestions. To rigorously assess the quality of modification suggestions, we introduce a student simulator-teacher interaction paradigm. Experimental results on three real-world code datasets demonstrate that DebugTA consistently improves teaching effectiveness while significantly reducing computational costs.

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

↑