mlsanityData to 14 Oct 2026

On Correctness of Automatic Differentiation for Non-Differentiable Functions

arXiv 2006.06903 ↗First posted 12 Jun 2020cs.LG stat.MLcited by 20

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 20 papers in the map (data through 14 Oct 2026). First posted on arXiv 12 Jun 2020.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2021: 4; 2022: 4; 2023: 5; 2024: 3; 2025: 2; 2026: 2.

20 papers.

Sort:

  1. 2021Nonsmooth Implicit Differentiation for Machine Learning and Optimizationcited by 43
  2. 2022Automatic differentiation of nonsmooth iterative algorithmscited by 25
  3. 2024Bounds for the smallest eigenvalue of the NTK for arbitrary spherical data of arbitrary dimensioncited by 13
  4. 2025Meta-Learning for Physically-Constrained Neural System Identificationcited by 6
  5. 2021A Gradient Sampling Algorithm for Stratified Maps with Applications to Topological Data Analysiscited by 5
  6. 2021The structure of conservative gradient fieldscited by 4
  7. 2022Learning Sparsity-Promoting Regularizers using Bilevel Optimizationcited by 4
  8. 2023On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameterscited by 3
  9. 2023ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programscited by 3
  10. 2025Deep Learning as the Disciplined Construction of Tame Objectscited by 3
  11. 2023An Efficient Learning-Based Solver for Two-Stage DC Optimal Power Flow with Feasibility Guaranteescited by 1
  12. 2023Understanding Automatic Differentiation Pitfallscited by 1
8 more
  1. 2023Auto-Differentiation of Relational Computations for Very Large Scale Machine Learningcited by 1
  2. 2021Network control by a constrained external agent as a continuous optimization problemcited by 0
  3. 2022An Algebraic Approach to Learning and Groundingcited by 0
  4. 2022Global quantitative robustness of regression feed-forward neural networkscited by 0
  5. 2024On the numerical reliability of nonsmooth autodiff: a MaxPool case studycited by 0
  6. 2024BrowNNe: Brownian Nonlocal Neurons & Activation Functionscited by 0
  7. 2026GradInf: Gradient Estimation as Probabilistic Inferencecited by 0
  8. 2026LazyHMC: Hamiltonian Monte Carlo Simulation for Lazy, Infinite Dimensional Probabilistic Programscited by 0