On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters
Wonyeol Lee, Sejun Park, Alex Aiken
Abstract
Recent work has shown that forward- and reverse- mode automatic differentiation (AD) over the reals is almost always correct in a mathematically precise sense. However, actual programs work with machine-representable numbers (e.g., floating-point numbers), not reals. In this paper, we study the correctness of AD when the parameter space of a neural network consists solely of machine-representable numbers. In particular, we analyze two sets of parameters on which AD can be incorrect: the incorrect set on which the network is differentiable but AD does not compute its derivative, and the non-differentiable set on which the network is non-differentiable. For a neural network with bias parameters, we first prove that the incorrect set is always empty. We then prove a tight bound on the size of the non-differentiable set, which is linear in the number of non-differentiabilities in activation functions, and give a simple necessary and sufficient condition for a parameter to be in this set. We further prove that AD always computes a Clarke subderivative even on the non-differentiable set. We also extend these results to neural networks possibly without bias parameters.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- A mathematical model for automatic differentiation in machine learning cites On Correctness of Automatic Differentiation for Non-Differentiable Functions
- On Correctness of Automatic Differentiation for Non-Differentiable Functions cites A mathematical model for automatic differentiation in machine learning
- What does automatic differentiation compute for neural networks? cites A mathematical model for automatic differentiation in machine learning
- What does automatic differentiation compute for neural networks? cites Automatic differentiation in PCF
- What does automatic differentiation compute for neural networks? cites A simple differentiable programming language
- What does automatic differentiation compute for neural networks? cites On Correctness of Automatic Differentiation for Non-Differentiable Functions
- Automatic differentiation in PCF cites A simple differentiable programming language
- Automatic differentiation in PCF cites On Correctness of Automatic Differentiation for Non-Differentiable Functions
- On Correctness of Automatic Differentiation for Non-Differentiable Functions cites A simple differentiable programming language
Cited by top-tier papers1
Builds on12
- Minimum Width for Universal ApproximationSejun Park, Chulhee Yun, Jaeho Lee, Jinwoo ShinICLR 2021 · 148 citations
- A mathematical model for automatic differentiation in machine learningJérôme Bolte, Edouard PauwelsNeurIPS 2020 · 84 citations
- On Correctness of Automatic Differentiation for Non-Differentiable FunctionsWonyeol Lee, Hangyeol Yu, Xavier Rival, Hongseok YangNeurIPS 2020 · 50 citations
- A simple differentiable programming languageMartín Abadi, Gordon D. PlotkinPOPL 2020 · 49 citations
- Automatic differentiation in PCFDamiano Mazza, Michele PaganiPOPL 2021 · 47 citations
Related papers
- Floating-Point Networks with Automatic Differentiation Can Represent Almost All Floating-Point Functions and Their GradientsSejun Park, Yeachan Park, Geonho HwangICML 2026
- Floating-Point Neural Networks Can Represent Almost All Floating-Point FunctionsGeonho Hwang, Yeachan Park, Wonyeol Lee, Sejun ParkICML 2025
- Floating-Point Neural Networks are Provably Robust Universal ApproximatorsGeonho Hwang, Wonyeol Lee, Yeachan Park, Sejun Park et al.CAV 2025
- On the complexity of nonsmooth automatic differentiationJérôme Bolte, Ryan Boustany, Edouard Pauwels, Béatrice Pesquet-PopescuICLR 2023
- On Minimum Depth and Width of Floating-Point Neural Networks for Representing Floating-Point FunctionsSejun Park, Yeachan Park, Geonho HwangICML 2026
