# DeepFD: Automated Fault Diagnosis and Localization for Deep Learning Programs

arXiv: https://arxiv.org/abs/2205.01938 · HTML: https://mlsanity.com/paper/2205.01938/

## Key facts

- Cited by 16 papers in the map (data through 14 Oct 2026).
- Builds on 18 of its 72 references that are in the map.
- First posted on arXiv 4 May 2022.

## Builds on (most cited first, 18 of 18)

- [Efficient Neural Architecture Search via Parameter Sharing](https://mlsanity.com/paper/1802.03268/) (2018)
- [Machine Learning Testing: Survey, Landscapes and Horizons](https://mlsanity.com/paper/1906.10742/) (2019)
- [Taxonomy of Real Faults in Deep Learning Systems](https://mlsanity.com/paper/1910.11015/) (2019)
- [A Walk with SGD](https://mlsanity.com/paper/1802.08770/) (2018)
- [DeepMutation: Mutation Testing of Deep Learning Systems](https://mlsanity.com/paper/1805.05206/) (2018)
- [Stable Recurrent Models](https://mlsanity.com/paper/1805.10369/) (2018)
- [A Comprehensive Study on Deep Learning Bug Characteristics](https://mlsanity.com/paper/1906.01388/) (2019)
- [Software Engineering Challenges of Deep Learning](https://mlsanity.com/paper/1810.12034/) (2018)
- [DeepLocalize: Fault Localization for Deep Neural Networks](https://mlsanity.com/paper/2103.03376/) (2021)
- [Repairing Deep Neural Networks: Fix Patterns and Challenges](https://mlsanity.com/paper/2005.00972/) (2020)
- [DeepFault: Fault Localization for Deep Neural Networks](https://mlsanity.com/paper/1902.05974/) (2019)
- [AlphaD3M: Machine Learning Pipeline Synthesis](https://mlsanity.com/paper/2111.02508/) (2021)
- [Random Walk Initialization for Training Very Deep Feedforward Networks](https://mlsanity.com/paper/1412.6558/) (2014)
- [An Empirical Study of Fault Localization Families and Their Combinations](https://mlsanity.com/paper/1803.09939/) (2018)
- [Graph Traversal with Tensor Functionals: A Meta-Algorithm for Scalable Learning](https://mlsanity.com/paper/2102.04350/) (2021)
- [Deep Neural Network Hyperparameter Optimization with Orthogonal Array Tuning](https://mlsanity.com/paper/1907.13359/) (2019)
- [Constructing Deep Neural Networks by Bayesian Network Structure Learning](https://mlsanity.com/paper/1806.09141/) (2018)
- [The effect of Target Normalization and Momentum on Dying ReLU](https://mlsanity.com/paper/2005.06195/) (2020)

## Built on by (most cited first, 16 of 16)

- [Personalized Dialogue Generation with Persona-Adaptive Attention](https://mlsanity.com/paper/2210.15088/) (2022)
- [Mutation-based Fault Localization of Deep Neural Networks](https://mlsanity.com/paper/2309.05067/) (2023)
- [Can Hessian-Based Insights Support Fault Diagnosis in Attention-based Models?](https://mlsanity.com/paper/2506.07871/) (2025)
- [Feature-Guided Analysis of Neural Networks: A Replication Study](https://mlsanity.com/paper/2511.00052/) (2025)
- [Tensor-Aware Energy Accounting](https://mlsanity.com/paper/2311.11424/) (2023)
- [Toward Debugging Deep Reinforcement Learning Programs with RLExplorer](https://mlsanity.com/paper/2410.04322/) (2024)
- [Why Attention Fails: A Taxonomy of Faults in Attention-Based Neural Networks](https://mlsanity.com/paper/2508.04925/) (2025)
- [Imitation Game: Reproducing Deep Learning Bugs Leveraging an Intelligent Agent](https://mlsanity.com/paper/2512.14990/) (2025)
- [Path Analysis for Effective Fault Localization in Deep Neural Networks](https://mlsanity.com/paper/2310.18987/) (2023)
- [An Empirical Study of Fault Localisation Techniques for Deep Learning](https://mlsanity.com/paper/2412.11304/) (2024)
- [BTTackler: A Diagnosis-based Framework for Efficient Deep Learning Hyperparameter Optimization](https://mlsanity.com/paper/2602.23630/) (2026)
- [Quality-Driven Selective Mutation for Deep Learning](https://mlsanity.com/paper/2604.22640/) (2026)
- [Hierarchical Fault Detection and Diagnosis for Transformer Architectures](https://mlsanity.com/paper/2604.28118/) (2026)
- [Training Dynamics of Neural Software Defect Predictors under Coupled Data-Quality Issues](https://mlsanity.com/paper/2606.24968/) (2026)
- [Evaluation-Strategy Gap in Fault Diagnosis of Deep Learning Programs](https://mlsanity.com/paper/2606.26492/) (2026)
- [Deep4ge: DNN Training Trajectories for Fault Detection and Diagnosis](https://mlsanity.com/paper/2607.12868/) (2026)

## Abstract (arXiv)

As Deep Learning (DL) systems are widely deployed for mission-critical applications, debugging such systems becomes essential. Most existing works identify and repair suspicious neurons on the trained Deep Neural Network (DNN), which, unfortunately, might be a detour. Specifically, several existing studies have reported that many unsatisfactory behaviors are actually originated from the faults residing in DL programs. Besides, locating faulty neurons is not actionable for developers, while locating the faulty statements in DL programs can provide developers with more useful information for debugging. Though a few recent studies were proposed to pinpoint the faulty statements in DL programs or the training settings (e.g. too large learning rate), they were mainly designed based on predefined rules, leading to many false alarms or false negatives, especially when the faults are beyond their capabilities. In view of these limitations, in this paper, we proposed DeepFD, a learning-based fault diagnosis and localization framework which maps the fault localization task to a learning problem. In particular, it infers the suspicious fault types via monitoring the runtime features extracted during DNN model training and then locates the diagnosed faults in DL programs. It overcomes the limitations by identifying the root causes of faults in DL programs instead of neurons and diagnosing the faults by a learning approach instead of a set of hard-coded rules. The evaluation exhibits the potential of DeepFD. It correctly diagnoses 52% faulty DL programs, compared with around half (27%) achieved by the best state-of-the-art works. Besides, for fault localization, DeepFD also outperforms the existing works, correctly locating 42% faulty programs, which almost doubles the best result (23%) achieved by the existing works.
