[论文解读] Silent Bugs in Deep Learning Frameworks: An Empirical Study of Keras and TensorFlow
本文首次对深度学习框架中的无声错误进行了实证研究,重点关注 Keras 和 TensorFlow。通过分析 1,168 个 GitHub 问题,作者识别出 77 个可复现的无声错误,将其分类为 7 种场景和 4 个影响等级,并通过 103 名深度学习开发者的调查验证了其分类体系,为在深度学习系统中检测此类隐蔽缺陷提供了指导建议。
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.
研究动机与目标
- 调查无声错误(即在不崩溃或不显示错误信息的情况下导致错误行为)在 Keras 和 TensorFlow 等深度学习框架中的普遍性和特征。
- 理解由于其不可检测性,无声错误如何影响用户在模型设计、训练和推理过程中的深度学习实验。
- 基于其表现形式、根本原因组件和影响等级,构建无声错误的分类体系,以支持检测与调试。
- 通过 103 名深度学习实践者的调查,验证所提出的分类体系和影响等级,评估其在实际场景中的相关性与一致性。
- 为开发人员提供可操作的指导建议,以构建能够早期识别无声错误的检测工具,从而支持深度学习开发生命周期中的缺陷发现。
提出的方法
- 从官方仓库收集并分析了 1,168 个与 Keras 和 TensorFlow 相关的已关闭 GitHub 问题,以识别无声错误。
- 筛选出仅包含可复现、被确认为真实框架错误(而非用户错误)且位于特定框架组件中的问题。
- 采用开放式编码方法,并通过多轮评审员共识,将错误按其行为和影响划分为 7 种不同场景。
- 基于对模型准确率、训练稳定性及推理正确性的影响严重程度,定义了 4 个影响等级(低至关键)。
- 通过在线调查收集了 103 名活跃深度学习开发者的反馈,以验证分类体系和影响等级,评估其一致性和实际相关性。
- 提供了一个可复现的代码包,包含匿名化的调查数据和分类体系详情,以确保研究可复现并支持未来研究扩展。
实验结果
研究问题
- RQ1无声错误在 Keras 和 TensorFlow 中最常见的表现场景是什么?它们如何影响模型行为?
- RQ2无声错误在模型准确率、训练过程和推理方面对用户深度学习工作流的影响如何?这些影响的严重程度如何?
- RQ3Keras/TensorFlow 框架的哪些组件最常与无声错误相关?
- RQ4深度学习实践者在多大程度上认可并认同所提出的无声错误分类体系和影响等级?
- RQ5可以提炼出哪些指导原则,以支持在深度学习框架中开发自动化无声错误检测技术?
主要发现
- 在 1,168 个 GitHub 问题中,识别出 77 个可复现的无声错误,证实无声错误是深度学习框架中一类显著但被严重低估的缺陷。
- 这些错误被划分为 7 种不同场景,包括“错误的保存/重载”、“错误的梯度计算”和“错误配置的层行为”,每种场景均以微妙但关键的方式影响模型正确性。
- 影响等级分析显示,32% 的错误被归类为“关键”级别,意味着它们在无任何警告的情况下导致严重模型退化或错误结果。
- 对 103 名开发者的调查结果显示,超过 85% 的一致性共识支持无声错误的重要性以及所提分类体系和影响等级的有效性。
- 研究发现,由于其隐蔽性,无声错误尤其危险,常导致用户错误地将模型失败归因于自身代码,而非框架缺陷。
- 作者识别出模型序列化、优化器更新和层初始化等组件是无声错误的常见根本原因,提示在这些区域进行针对性测试与验证可有效降低其影响。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。