In programming education, Debugging and Teaching (DT) task is a common scenario which requires generating modification suggestions from erroneous code, error messages, reference solutions, and problem descriptions. Existing approaches struggle with complex multi-source reasoning and underutilize available reference code, limiting the effectiveness of large language models (LLMs) in DT tasks. 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 pedagogical and debugging principles, DebugTA decomposes complex DT tasks into structured LLM–tool interactions that reduce reasoning complexity. By aligning reference code with erroneous code, DebugTA enables the LLM to focus on logical errors and improves suggestion accuracy. 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.
Paper
References (51)
Scroll for more · 38 remaining