Checker Bug Detection and Repair in Deep Learning Libraries

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Harzevili, Nima Shiri, Mohajer, Mohammad Mahdi, Shin, Jiho, Wei, Moshi, Uddin, Gias, Yang, Jinqiu, Wang, Junjie, Wang, Song, Ming, Zhen, Jiang, Nagappan, Nachiappan
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913538689204224
author Harzevili, Nima Shiri
Mohajer, Mohammad Mahdi
Shin, Jiho
Wei, Moshi
Uddin, Gias
Yang, Jinqiu
Wang, Junjie
Wang, Song
Ming, Zhen
Jiang
Nagappan, Nachiappan
author_facet Harzevili, Nima Shiri
Mohajer, Mohammad Mahdi
Shin, Jiho
Wei, Moshi
Uddin, Gias
Yang, Jinqiu
Wang, Junjie
Wang, Song
Ming, Zhen
Jiang
Nagappan, Nachiappan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2410_06440
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Checker Bug Detection and Repair in Deep Learning Libraries
Harzevili, Nima Shiri
Mohajer, Mohammad Mahdi
Shin, Jiho
Wei, Moshi
Uddin, Gias
Yang, Jinqiu
Wang, Junjie
Wang, Song
Ming, Zhen
Jiang
Nagappan, Nachiappan
Software Engineering
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.
title Checker Bug Detection and Repair in Deep Learning Libraries
topic Software Engineering
url https://arxiv.org/abs/2410.06440