Modern deep learning is built on a mathematical contradiction. We train networks using gradient-based optimization, yet the most common components of these networks—like ReLU activations, max-pooling, and absolute values—are not differentiable. At the "kinks" of these functions, the gradient is technically undefined.
In practice, deep learning libraries like PyTorch and TensorFlow bypass this by using "proxy" derivatives (e.g., assigning the derivative of ReLU at zero to be 0 or 0.5). While this works empirically, it raises a fundamental theoretical question: Why does the composition of these arbitrary choices through the chain rule result in a mathematically sound signal for optimization?
Recent research led by Jerome Bolte and Edouard Pauwels has resolved this tension by introducing the framework of conservative fields. This theory provides the missing foundation for nonsmooth automatic differentiation (AD), proving that the heuristic "hacks" used in software are actually rigorous generalizations of calculus.
The Failure of the Standard Chain Rule
In classical calculus, the chain rule is the engine of backpropagation. If you compose two smooth functions, their derivatives multiply. However, when functions are nonsmooth, the standard tool for analysis—the Clarke subdifferential—fails to satisfy a stable chain rule.
As Sham M. Kakade and Jason D. Lee pointed out in Provably Correct Automatic Subdifferentiation for Qualified Programs, standard AD libraries can produce "incorrect" subderivatives because they apply the chain rule locally without considering the global structure of the program. This can lead to situations where the computed gradient does not belong to the set of valid generalized derivatives, potentially causing optimization to stall or diverge.
Conservative Fields: A New Foundation
To fix this, Jerome Bolte and Edouard Pauwels introduced conservative set-valued fields in Conservative set valued fields, automatic differentiation, stochastic gradient method and deep learning.
A conservative field is a generalization of the gradient. Intuitively, a vector field is "conservative" if the work done moving along any closed loop is zero. By extending this concept to set-valued mappings (where a single point can have a set of "gradient-like" vectors), the authors proved that:
- Compositionality: Unlike Clarke subdifferentials, conservative fields satisfy a rigorous nonsmooth chain rule.
- AD Compatibility: The specific "proxy" values chosen by libraries like PyTorch (e.g., $\text{ReLU}'(0)=0$) are not just arbitrary; they are consistent selections from a conservative field.
- Convergence: Optimization algorithms like SGD are guaranteed to converge to critical points of the loss function when the updates are drawn from a conservative field.
Why Neural Networks are "Tame"
The reason conservative fields work so well for deep learning is that neural networks are not just any functions—they are tame.
In Deep Learning as the Disciplined Construction of Tame Objects, Gilles Bareilles, Jakub Marecek, and colleagues argue that neural networks belong to "o-minimal structures." Tame geometry ensures that functions don't oscillate infinitely and that their non-differentiable points are well-behaved (e.g., they form lower-dimensional boundaries rather than a chaotic mess).
This "tameness" is what allows Wonyeol Lee and Hongseok Yang to prove in On Correctness of Automatic Differentiation for Non-Differentiable Functions that AD is "correct" for almost all inputs. Even when using finite-precision floating-point numbers, Wonyeol Lee and Sejun Park showed in On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters that backpropagation remains mathematically sound.
Differentiating Through the "Black Box"
The power of conservative fields extends beyond simple ReLU layers to implicit layers, where the output is defined as the solution to an optimization problem or a fixed-point equation.
Standard implicit differentiation relies on the Implicit Function Theorem, which requires second-order smoothness. However, many modern architectures use nonsmooth optimization layers (like Lasso or hard constraints). In Nonsmooth Implicit Differentiation for Machine-Learning and Optimization, Jerome Bolte and Edouard Pauwels developed a nonsmooth implicit function theorem based on conservative Jacobians.
This theoretical breakthrough has enabled new practical tools:
- QPLayer: Antoine Bambade and Adrien Taylor used conservative Jacobians to create QPLayer, a framework for differentiating through convex quadratic programs even when they are infeasible or nonsmooth.
- Iterative Algorithms: In Automatic differentiation of nonsmooth iterative algorithms, researchers proved that differentiating through the steps of a nonsmooth proximal algorithm (like ADMM) correctly converges to a conservative Jacobian of the final solution.
Convergence of Modern Optimizers
Finally, this framework bridges the gap between theory and the optimizers we use every day. While early proofs of convergence for Adam and its variants assumed smoothness, Nachuan Xiao and Kim-Chuan Toh utilized conservative field theory in Adam-family Methods for Nonsmooth Optimization with Convergence Guarantees to provide the first rigorous convergence guarantees for these methods on nonsmooth, nonconvex landscapes.
By treating the outputs of AD as elements of a conservative field, researchers have finally aligned the mathematical "rules" of calculus with the actual numerical behavior of deep learning software, ensuring that as networks become more complex and nonsmooth, our optimization tools remain on solid ground.