Source-linked AI summary
Silent Bugs in Deep Learning Frameworks: An Empirical Study of Keras and TensorFlow
Florian Tambon, Amin Nikanjam, Le An, Foutse Khomh, Giuliano Antoniol
TL;DR
Silent bugs in deep-learning frameworks can produce wrong behavior without crashes or error messages, making them difficult to detect and especially consequential for opaque, stochastic applications. This paper empirically studies such bugs in TensorFlow/Keras, identifies their characteristics and impacts, and validates the findings through a developer survey.
Problem
Silent framework bugs can preserve apparently successful model creation and training while causing incorrect results that users struggle to link to the framework.
Source: §1 · p. 2Method
The study inspected 1,168 closed TensorFlow GitHub issues, classified 77 reproducible silent bugs by scenario, impact, and component, and surveyed 103 TensorFlow users.
Source: §8 · p. 35Results
Participants generally agreed that silent bugs have significant impacts, with survey perceptions moderately/strongly correlating with the study’s impact categories (τ = 0.51).
Source: §4.2.5 · p. 29, §8 · p. 35Takeaways & Limitations
The findings support developing debugging techniques for detecting silent bugs in deep-learning frameworks.
Source: §8 · p. 35Because the study analyzed only one deep-learning framework, its generalization to other frameworks may be limited.
Source: §7 · p. 35
Abstract
from arXiv · showhide
Deep Learning (DL) frameworks are now widely used, simplifying the creation of complex models as well as their integration to various applications even to non DL experts. However, like any other programs, they are prone to bugs. This paper deals with the subcategory of bugs named silent bugs: they lead to wrong behavior but they do not cause system crashes or hangs, nor show an error message to the user. Such bugs are even more dangerous in DL applications and frameworks due to the "black-box" and stochastic nature of the systems (the end user can not understand how the model makes decisions). This paper presents the first empirical study of Keras and TensorFlow silent bugs, and their impact on users' programs. We extracted closed issues related to Keras from the TensorFlow GitHub repository. Out of the 1,168 issues that we gathered, 77 were reproducible silent bugs affecting users' programs. We categorized the bugs based on the effects on the users' programs and the components where the issues occurred, using information from the issue reports. We then derived a threat level for each of the issues, based on the impact they had on the users' programs. To assess the relevance of identified categories and the impact scale, we conducted an online survey with 103 DL developers. The participants generally agreed with the significant impact of silent bugs in DL libraries and acknowledged our findings (i.e., categories of silent bugs and the proposed impact scale). Finally, leveraging our analysis, we provide a set of guidelines to facilitate safeguarding against such bugs in DL frameworks.
1 Introduction
This study examines silent bugs in TensorFlow’s Keras API, focusing on their effects on users’ deep-learning programs, affected components, and root causes. It analyzes reported issues and validates the resulting bug categories and impact levels with DL users.
Motivation
- Silent framework bugs can preserve apparently successful model creation, training, or inference while producing inaccurate predictions, degraded computation, or incorrect information.Their lack of concrete errors makes it difficult for users to connect suspicious behavior to framework defects such as incorrect weight updates.Source: §1 · p. 2
Research gap
- The work addresses a gap left by prior DL-bug studies that did not precisely examine real silent bugs or their effects on users’ code.It formulates questions about program consequences, API sources and root causes, and relevance to DL users.Source: §1 · pp. 3–4
Validation
- A survey of 103 TensorFlow DL users assessed the relevance and completeness of the categories and impact levels, with participants acknowledging the findings.The survey specifically validated the study’s characterization of how silent bugs impact users’ programs.Source: §1 · p. 4
Study scope
- 1,168 closed TensorFlow issues yielded 77 reproducible silent bugs affecting users’ DL programs.The study classifies these bugs by their observed effects on programs that create, train, or infer DL models.Source: §1 · p. 4
Contributions
- The study identifies seven silent-bug categories, four impact levels, and 14 Keras API components associated with the bugs.It also examines possible root causes using an existing taxonomy and classifies impacts on users’ programs.Source: §1 · pp. 4–5
2 Background
TensorFlow is an open-source ML platform whose computation is represented through dataflow graphs and supported across CPUs, GPUs, and TPUs. Keras provides TensorFlow’s high-level Python API for building and shipping DL solutions, while TensorFlow’s GitHub repository records issues and fixes.
TensorFlow
- TensorFlow uses dataflow graphs to define ML computations, operations, and states, with differentiable programming and tensor operations across CPUs, GPUs, and TPUs.The platform also supports deployment by exporting graphs to external runtime environments.Source: §2.1 · p. 5
Keras
- Keras is a Python DL API running on TensorFlow that supplies high-level abstractions and building blocks for developing and shipping DL solutions.It was designed to enable fast experimentation and lower the expertise required for DL development.Source: §2.1 · p. 6
Issue tracking
- TensorFlow’s GitHub repository stores user issues containing diagnostic details such as platform, version, reproduction code, and expected behavior.Developers use these reports and associated commits to investigate and address library problems.Source: §2.2 · p. 6
3 Silent bugs in Keras and TensorFlow
The study classifies reproducible silent bugs in Keras/TensorFlow by their effects on users’ programs and assigns each an impact level. The results show that many bugs alter expected outcomes without obvious symptoms, with wrong calculations and save/reload failures posing the greatest risks.
Classification
- 77 bugs were classified into 7 impact scenarios and 14 affected API components, with each bug assigned one of four impact levels.The classification used issue descriptions, reproduction artifacts, and observed consequences for users’ programs.Source: §3.1.3 · pp. 9–11
Impact scenarios
- Wrong parameter setting affected 20.8% of bugs and could alter network behavior without warning, potentially causing convergence issues.One example changed an optimizer’s learning-rate behavior even when the learning rate was set to zero.Source: §3.2.1 · p. 13
- Wrong save/reload affected 13% of bugs and could completely change model results, including a reported accuracy collapse after loading saved weights.Without verification, users could obtain mostly incorrect predictions because no errors or warnings were raised.Source: §3.2.1 · pp. 14–15
- Wrong resulting shape affected 7.79% of bugs, while performance degradation affected 5.19%, including excessive memory use and substantially slower execution.The shape category could return incorrect model information without altering operation, whereas performance degradation excluded prediction-accuracy changes.Source: §3.2.1 · pp. 15–16
Impact levels
- Wrong calculation produced the highest-impact scenario, with 13 Level-4 samples, followed by wrong save/reload with 6 high-impact samples.These scenarios could drastically affect model results and often required inspecting the model to detect the problem.Source: §3.2.1 · pp. 18–19
Faulty components
- Engine, Layer, and Model were the most affected components, while all issues in Saving were high-impact and nearly half in Layer and Backend were high-impact.Engine contained 19 samples, Layer 14, and Model 13; Engine is a hidden Keras backbone component.Source: §3.2.2 · p. 21
4 Validation and relevance assessment
The survey assessed whether the study’s silent-bug categories and impact scale were meaningful and relevant to DL users. Respondents generally validated the categories, scale, and the conclusion that silent bugs are more problematic than traditional bugs.
- 97.1% of respondents found the silent-bug definition meaningful, supporting its relevance among surveyed DL users.Source: §4.2.1 · p. 26
- Respondents generally judged the categories difficult or dangerous to diagnose, assess, and fix, with limited evidence for Wrong Shape and Performance Degradation.Source: §4.2.2 · pp. 27–28
- The proposed categories may be too general, while documentation issues remained outside the paper’s silent-bug scope.Source: §4.2.2 · p. 28
- 75.8% of respondents agreed that the proposed impact scale was relevant, although some suggested merging levels 3 and 4.Source: §4.2.3 · p. 28
- 72.8% of respondents considered silent bugs more problematic than traditional bugs that cause errors or program hangs.Source: §4.2.4 · p. 29
- τ = 0.51 indicated a moderate-to-strong correlation between the study’s category impact levels and respondents’ perceived impacts.Source: §4.2.5 · p. 29
5 Discussion
The discussion connects silent bugs’ elusive behavior with difficult diagnosis, repair, and testing in TensorFlow’s Keras API. It argues that their harmful impacts warrant additional attention and targeted safeguards.
- Silent bugs can produce harmful program behavior without obvious symptoms, and respondents largely judged them more problematic than traditional bugs.Source: §5 · p. 31
- Root-cause analysis and repair remain difficult because silent bugs affect framework components differently from their observed user-program impacts.Source: §5 · p. 31
- Wrong save/reload bugs are amenable to tests that compare model structure, parameters, and benchmark predictions before and after reloading.Source: §5 · p. 31
- Existing differential-testing techniques have achieved some success but generally provide low coverage and repeatedly exercise the same code.Source: §5 · p. 32
- Testing should prioritize Engine, Model, and Layer components, especially Engine because dependent modules can mask incorrect behavior.Source: §5 · pp. 32–33
6 Related work
Prior work studied bugs in DL programs and TensorFlow internals, but did not specifically characterize silent bugs’ effects on users’ programs and experiences. Related software-engineering research offers adjacent concepts and detection approaches without directly establishing their applicability to DL frameworks.
- Software-engineering research has studied silent failures, test-code “silent horrors,” miscompilation, and numerical correctness bugs as related but distinct problems.Source: §6 · p. 33
- Equivalent Modulo Input found silent compiler defects effectively, but the paper notes that translating this approach to DL frameworks is unclear.Source: §6 · p. 33
- Earlier DL studies examined reproducible bugs, taxonomies, symptoms, causes, and repair patterns, but focused mainly on DL programs or general TensorFlow bugs.Source: §6 · pp. 33–34
- Unlike prior studies, this paper specifically investigates silent bugs inside a DL framework and their impact on users’ programs and experience.Source: §6 · p. 34
7 Threats to Validity
The study's validity is constrained by issue selection, the limited bug sample, and analysis of only TensorFlow, although the authors used independent raters, consensus coding, survey validation, and a replication package to mitigate these concerns.
Construct validity
- Closed issues may underrepresent silent bugs because open issues lack solutions, commits, or fixed versions needed to verify reproducibility and localization.The study therefore inspected verified reproducible bugs with fixed versions to reduce subjectivity and noise.Source: §7 · p. 34
- Independent raters used open coding, repeated consensus rounds, and a DL-user survey to mitigate bias in the newly developed scenario and impact categories.No prior taxonomy existed for these categories.Source: §7 · pp. 34–35
Internal validity
- The 77-bug sample is smaller than broader TensorFlow studies, but it targets the harder-to-diagnose silent-bug subcategory and yielded seven validated categories.The closest categories in one 250-bug study comprised at most 19% of cases, or 47 bugs.Source: §7 · p. 35
External validity
- Analyzing one framework limits generalization, even though the authors argue TensorFlow's prevalence, Keras's importance, and cross-framework similarities support broader relevance.The authors also state that the established impact remains important even if the phenomenon does not generalize.Source: §7 · p. 35
Reliability validity
- A detailed replication package is provided so other researchers can reproduce or extend the study.Source: §7 · p. 35
8 Conclusion
The paper empirically characterizes silent bugs in TensorFlow through Keras and their effects on deep-learning work. It identifies reproducible bug patterns, validates their impact with users, and proposes guidance for detection and future cross-framework study.
8 Conclusion
- 77 reproducible silent bugs were identified by inspecting 1,168 TensorFlow GitHub issues, then classified into 7 scenarios and 4 impact levels.The classification covers effects on designing models, training, and inference, as well as responsible framework components.Source: §8 · p. 35
- A survey of 103 TensorFlow users found general agreement that silent bugs significantly affect DL libraries and acknowledged the proposed categories and impact scale.Source: §8 · p. 35
- The study provides a basis for detection techniques by showing where silent bugs occur in Keras/TensorFlow and how they manifest in users' programs.Source: §8 · pp. 35–36
- Future work includes comparing bug types across frameworks and designing techniques to identify abnormal behavior and trace silent-bug root causes.The authors suggest similar observations may apply to other frameworks because they face similar issues.Source: §8 · p. 36