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

深度学习库中Checker Bug的检测与修复

Checker Bug Detection and Repair in Deep Learning Libraries

Nima Shiri Harzevili, Mohammad Mahdi Mohajer, Jiho Shin, Moshi Wei, Gias Uddin, Jinqiu Yang, Junjie Wang, Song Wang, Zhen Ming, Jiang, Nachiappan Nagappan

AI总结:

该研究首次针对TensorFlow和PyTorch中的DL checker bug开展综合研究,分析其根因、症状与修复模式,并提出基于RAG和LLM的工具TensorGuard,实现高召回率的bug检测与更优的补丁生成效果,还在JAX库中发现了新bug。

摘要:

深度学习(DL)库中的checker bug是一类关键但尚未得到充分研究的问题。这类bug通常隐藏在DL库的输入验证与错误检查代码中,可能导致DL应用出现静默失败、结果错误或程序行为异常。尽管它们可能对基于这些库构建的深度学习系统的可靠性和性能产生重大影响,但checker bug受到的关注仍然有限。\n我们针对两个广泛使用的DL库——TensorFlow和PyTorch——开展了首个关于DL checker bug的综合研究。首先,我们使用与checker bug相关的特定关键词,自动收集了2016年9月至2023年12月期间GitHub上TensorFlow和PyTorch代码仓库的2418个提交,构成数据集。通过人工检视,我们从中识别出527个DL checker bug。随后,我们从根本原因、表现症状和修复模式三个维度对这些bug进行了分析。基于checker bug根本原因分析所得的知识,我们进一步提出了TensorGuard——一个概念验证型、基于检索增强生成(RAG)和大语言模型(LLM)的工具,它通过对一系列ChatGPT提示词进行提示工程,实现DL库中checker bug的检测与修复。我们在一个测试数据集上评估了TensorGuard的性能,该数据集包含2024年1月至2024年7月期间TensorFlow和PyTorch中92个存在bug的、以及135个无问题的checker相关变更。实验结果表明,使用思维链(Chain of Thought)提示策略时,TensorGuard的平均召回率高达94.51%;使用零样本(Zero-Shot)和少样本(Few-Shot)提示策略时,其精确率与召回率表现均衡。在补丁生成方面,TensorGuard的准确率达到11.1%,比当前最优的bug修复基线方法高出2%。我们还将TensorGuard应用于谷歌JAX库最近六个月的checker相关变更(共493个变更),成功检测出64个新的checker bug。

英文摘要:

Checker bugs in Deep Learning (DL) libraries are critical yet not well-explored. These bugs are often concealed in the input validation and error-checking code of DL libraries and can lead to silent failures, incorrect results, or unexpected program behavior in DL applications. Despite their potential to significantly impact the reliability and performance of DL-enabled systems built with these libraries, checker bugs have received limited attention. We present the first comprehensive study of DL checker bugs in two widely-used DL libraries, i.e., TensorFlow and PyTorch. Initially, we automatically collected a dataset of 2,418 commits from TensorFlow and PyTorch repositories on GitHub from Sept. 2016 to Dec. 2023 using specific keywords related to checker bugs. Through manual inspection, we identified 527 DL checker bugs. Subsequently, we analyzed these bugs from three perspectives, i.e., root causes, symptoms, and fixing patterns. Using the knowledge gained via root cause analysis of checker bugs, we further propose TensorGuard, a proof-of-concept RAG-based LLM-based tool to detect and fix checker bugs in DL libraries via prompt engineering a series of ChatGPT prompts. We evaluated TensorGuard's performance on a test dataset that includes 92 buggy and 135 clean checker-related changes in TensorFlow and PyTorch from January 2024 to July 2024. Our results demonstrate that TensorGuard has high average recall (94.51\%) using Chain of Thought prompting, a balanced performance between precision and recall using Zero-Shot prompting and Few-Shot prompting strategies. In terms of patch generation, TensorGuard achieves an accuracy of 11.1\%, which outperforms the state-of-the-art bug repair baseline by 2\%. We have also applied TensorGuard on the latest six months' checker-related changes (493 changes) of the JAX library from Google, which resulted in the detection of 64 new checker bugs.

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

↑