[论文解读] On Correctness of Automatic Differentiation for Non-Differentiable Functions
本文通过引入PAP(解析分段下的分段解析性)函数类的内涵导数,建立了自动微分(autodiff)系统在应用于深度学习中常见的不可微函数时的形式正确性。证明了这些导数几乎处处存在且与标准导数一致,表明autodiff系统实际上计算的是这些导数,从而为尽管存在理论上的不可微性担忧,其广泛使用提供了理论依据。
Differentiation lies at the core of many machine-learning algorithms, and is well-supported by popular autodiff systems, such as TensorFlow and PyTorch. Originally, these systems have been developed to compute derivatives of differentiable functions, but in practice, they are commonly applied to functions with non-differentiabilities. For instance, neural networks using ReLU define non-differentiable functions in general, but the gradients of losses involving those functions are computed using autodiff systems in practice. This status quo raises a natural question: are autodiff systems correct in any formal sense when they are applied to such non-differentiable functions? In this paper, we provide a positive answer to this question. Using counterexamples, we first point out flaws in often-used informal arguments, such as: non-differentiabilities arising in deep learning do not cause any issues because they form a measure-zero set. We then investigate a class of functions, called PAP functions, that includes nearly all (possibly non-differentiable) functions in deep learning nowadays. For these PAP functions, we propose a new type of derivatives, called intensional derivatives, and prove that these derivatives always exist and coincide with standard derivatives for almost all inputs. We also show that these intensional derivatives are what most autodiff systems compute or try to compute essentially. In this way, we formally establish the correctness of autodiff systems applied to non-differentiable functions.
研究动机与目标
- 解决一个理论问题:当自动微分系统应用于不可微函数(尤其是深度学习中的情况)时,其正确性是否成立。
- 挑战并纠正实践中常见的错误非正式辩护,例如认为不可微点为零测集,从而为autodiff的正确性提供辩护。
- 为autodiff系统定义一个正式的正确性条件,允许不可微函数的存在,只要不可微性发生的集合为零测集。
- 引入并分析一类新函数类(PAP函数),该类函数几乎涵盖了现代深度学习中的所有函数,包括基于ReLU的网络。
- 为PAP函数定义内涵导数,并证明其几乎处处存在,且满足链式法则等关键性质。
提出的方法
- 引入PAP函数类,即分段解析且具有解析分段的函数,该类函数包括了绝大多数深度学习中的函数。
- 定义内涵导数为一种新型导数,可将标准导数推广至不可微点。
- 证明所有PAP函数的内涵导数均存在,且几乎处处(a.e.)与标准导数一致。
- 证明即使在函数不可微的情况下,内涵导数仍满足广义链式法则。
- 证明大多数现有autodiff系统实际上计算或近似了内涵导数,从而为其实际正确性提供理论依据。
- 利用测度论论证及解析函数的性质,建立内涵导数的存在性与一致性。
实验结果
研究问题
- RQ1当应用于具有ReLU激活等不可微函数时,autodiff系统在形式上是否正确?
- RQ2常见的启发式论据(如不可微点构成零测集)是否足以证明autodiff的正确性?
- RQ3能否为不可微函数定义一种新的导数概念,使其在几乎处处与标准导数一致,并确保正确性与一致性?
- RQ4即使函数不可微,内涵导数是否仍满足链式法则等基本微积分规则?
- RQ5现有autodiff系统在多大程度上计算或近似了这些内涵导数?
主要发现
- 所有PAP函数的内涵导数均存在,且几乎处处与标准导数一致。
- 即使函数不可微,内涵导数的链式法则依然成立,确保了复合运算的一致性。
- 大多数现有autodiff系统实际上计算或近似了内涵导数,从而为其实际正确性提供了理论支持。
- PAP函数类包括了现代深度学习中几乎所有使用的函数,如具有ReLU及其他分段解析激活函数的网络。
- 反例表明,常见启发式论据(即不可微点稀少且无害)是不充分且错误的。
- 本文建立了一个形式正确的autodiff系统条件,只要不可微性发生的集合为零测集,即可允许不可微函数的存在。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。