arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.16897cs.SE
收藏

DeepGroundRepair:从基于API的生成到深度学习程序的形状感知修复

DeepGroundRepair: From API-Grounded Generation to Shape-Aware Repair for Deep Learning Programs

Beihang University(北京航空航天大学);Beijing University of Posts and Telecommunications(北京邮电大学);Beijing University of Technology(北京工业大学)

Xiangyue Ma, Zhen Wang, Xuhui Lu, Xiaoting Du, Chenglong Li, Jun Li, Haotian Li, Zheng Zheng

AI总结:

DeepGroundRepair是三阶段框架,通过锚定API知识、定位形状不匹配原因、用张量形状指导参数修复,在DeepEval任务上较基线大幅减少语法问题、提升代码可执行性等性能。

摘要:

深度学习程序是现代AI应用的基础,从自然语言需求自动生成这类程序可大幅减少深度学习(DL)开发工作量,大语言模型(LLM)在该方向已展现出良好能力。但生成的DL程序常不可靠,因其需满足特定领域的API使用约束和张量形状依赖,违反这些约束会导致API层面的语法问题和运行时失败。现有检索增强生成及反馈引导的代码修复方法未充分解决这些DL特定约束。本文提出DeepGroundRepair,这是一个三阶段框架,建立了生成-定位-修复的工作流以提升LLM生成的DL程序的可靠性,其核心思路是利用DL特定知识和运行时张量信息逐步缩小生成与修复空间:具体而言,它将生成锚定到任务相关的API知识,定位张量形状不匹配失败的上游原因,并使用运行时张量形状指导参数修复。我们在DeepEval的100个模型级DL编程任务上,针对TensorFlow、PyTorch、PaddlePaddle三个框架,使用六个开放权重LLM对DeepGroundRepair进行评估,将其与四个基线方法(两个仅生成方法及各自结合回溯引导自调试的对应方法)对比。结果显示,与这些基线相比,DeepGroundRepair每10个程序文件平均减少5.4个API层面语法问题,代码可执行性平均相对提升85.3%;与两个自调试基线相比,它的语义一致性平均提升18.1%,令牌成本平均降低28.4%。

英文摘要:

Deep learning programs are fundamental to modern AI applications, and automatically generating them from natural language requirements can substantially reduce DL development effort. Large language models have demonstrated promising capabilities for this direction. However, generated DL programs often remain unreliable because they must satisfy domain specific API usage constraints and tensor shape dependencies, violations of which can cause API level syntactic issues and runtime failures. Existing retrieval augmented generation and feedback guided code repair methods do not adequately address these DL specific constraints. In this paper, we propose DeepGroundRepair, a three stage framework that establishes a generation localization repair workflow to improve the reliability of LLM-generated DL programs. Its key idea is to progressively narrow the generation and repair spaces using DL specific knowledge and runtime tensor information. Specifically, it grounds generation in task-relevant API knowledge, localizes the upstream causes of tensor shape mismatch failures, and uses runtime tensor shapes to guide parameter repair. We evaluate DeepGroundRepair on the 100 model-level DL programming tasks in DeepEval using six open-weight LLMs across TensorFlow, PyTorch, and PaddlePaddle. We compare it with four baselines: two generation-only methods and their counterparts incorporating traceback guided self debugging. The results show that, relative to these baselines, DeepGroundRepair reduces the combined number of API-level syntactic issues by an average of 5.4 per 10 program files and achieves an average relative improvement of 85.3% in code executability. Compared with the two self debugging baselines, it improves semantic consistency by an average of 18.1% and reduces token cost by an average of 28.4%.

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

↑