用符号推理指导小模型修复代码,提升准确率与可解释性。
Reasoning Distillation for Lightweight Automated Program Repair
- 大模型提供结构化推理标签,指导小模型学习程序深层逻辑。
- 在IntroClass数据集上,少样本类别修复准确率显著提升。
- 无需增大模型规模,适合资源受限场景的代码修复应用。
我们研究轻量级符号推理监督是否能提升紧凑型自动化程序修复模型的修复类型分类能力。小型代码模型适用于资源受限环境,但通常仅输出单一预测,难以判断其是否真正理解程序结构,还是依赖浅层关联。本文提出一种推理蒸馏方法:由大型教师模型提供结构化的符号推理标签及修复类型标签,这些标签捕捉漏洞的高层因果特性,不依赖自由文本解释。我们在IntroClass基准上,以CodeT5为基础,在仅标签和推理蒸馏两种设置下训练学生模型。结果表明,推理监督持续提升了宏平均性能,尤其在较少见的漏洞类别上表现更优,且未增加模型大小或复杂度。进一步分析显示,正确推理路径与正确预测强相关,但并不完全决定预测结果。研究说明,符号推理蒸馏是提升轻量级程序修复模型可解释性与鲁棒性的有效方式。
原文摘要 · Abstract (English)
We study whether lightweight symbolic reasoning supervision can improve fix type classification in compact automated program repair models. Small code models are attractive for resource-constrained settings, but they typically produce only a single prediction, making it unclear whether they learn meaningful program structure or rely on shallow correlations. We propose a reasoning distillation approach in which a large teacher model provides structured symbolic reasoning tags alongside fix-type labels. These tags capture high-level causal properties of bugs without relying on free-form explanations. We train a CodeT5-based student model under label-only and reasoning-distilled settings on the IntroClass benchmark. Reasoning supervision consistently improves macro averaged performance, particularly on less frequent bug categories, without increasing model size or complexity. We further analyze the relationship between reasoning accuracy and fix-type prediction, showing that correct reasoning traces strongly correlate with correct predictions, while not fully determining them. Our results suggest that symbolic reasoning distillation is a practical way to improve interpretability and robustness in lightweight program repair models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。