NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Nonsmooth Implicit Differentiation for Machine-Learning and Optimization

Jérôme Bolte, Tam Le, Edouard Pauwels, Antonio Silveti-Falls

Introduction

Modern deep learning frequently relies on implicit layers, where the output is not a simple sequence of explicit operations (like $y = \sigma(Wx)$) but rather the solution to an equation, such as a fixed-point problem $z = f(z, x)$ or an internal optimization problem. To train these models using gradient descent, practitioners must differentiate through this implicit relationship.

The standard mathematical tool for this is the Implicit Function Theorem (IFT). However, the classical IFT requires functions to be continuously differentiable ($C^1$). This poses a significant theoretical problem because most modern machine learning components—such as ReLU activations, max-pooling layers, and Lasso penalties—are nonsmooth. They contain "kinks" where traditional derivatives are undefined.

In practice, engineers often bypass this limitation by applying "formal" differentiation, essentially plugging in a Jacobian wherever possible using automatic differentiation libraries. While this heuristic often works empirically, it has lacked a solid theoretical justification. This paper bridges the gap between the heuristic application of algorithmic differentiation and rigorous mathematical theory, providing a foundation for nonsmooth implicit differentiation.

Theoretical Framework: Conservative Jacobians

To justify formal backpropagation for non-differentiable architectures, the authors build their theory on the concept of conservative Jacobians. Unlike standard derivatives, conservative Jacobians are set-valued mappings that comply with the chain rule and perfectly align with how automatic differentiation frameworks (like PyTorch or JAX) handle points of non-differentiability.

Key methodological contributions include:

  • Nonsmooth IFT: The establishment of a new Implicit Function Theorem applicable to "path differentiable" functions, a broad class encompassing almost all functions used in machine learning.
  • Operational Calculus: A "plug-and-play" formula for computing these nonsmooth derivatives, rigorously justifying the use of Clarke Jacobians in standard differentiation formulas.
  • Definable Functions: The theory is grounded in "definable" problems from o-minimal geometry. This covers virtually all practical ML architectures, including those utilizing log-exp functions, semialgebraic sets, and common neural network layers.

Pathological Dynamics and the Invertibility Condition

A critical insight from the paper is that while formal subdifferentiation is valid for a wide class of problems, the invertibility condition is non-negotiable. In smooth calculus, if a matrix isn't invertible, the IFT simply does not apply. In the nonsmooth regime, failing this condition leads to severe consequences for training dynamics.

Pathological gradient dynamics and nonsmooth functions

To demonstrate this, the authors designed synthetic numerical experiments. They show that without the proposed invertibility conditions, gradient descent can fall into "limit cycles" (looping endlessly without converging) or exhibit entirely chaotic, "Lorenz-attractor" style trajectories. This proves that ignoring the underlying mathematics doesn't just make the theory incomplete—it can make the training dynamics absurd, even on seemingly ordinary problems.

Key Results and Applications

The paper provides the first theoretical guarantees that, under mild conditions (definability and nonsmooth invertibility), implicitly defined functions are path differentiable, and their conservative Jacobians can be computed explicitly. This yields the first convergence guarantees for stochastic gradient descent (SGD) applied to complex, nonsmooth implicit architectures.

Furthermore, the authors provide explicit, ready-to-use formulas for several advanced applications:

  • Monotone Deep Equilibrium Networks (DEQs): Rigorously justifying the heuristic Jacobians used in previous empirical work.
  • Conic Optimization Layers: Extending the calculus for layers that solve internal optimization problems during the forward pass.
  • Lasso Hyperparameter Tuning: Offering a mathematically sound method to tune the regularization parameter $\lambda$ in Lasso-type models using first-order optimization methods.

Limitations and Future Directions

While the theoretical framework is robust, checking the required nonsmooth invertibility condition in high-dimensional, complex neural networks remains a significant practical challenge. Additionally, the paper focuses heavily on the calculus of computing the derivative, assuming the implicit function already exists. A more unified theory combining existence, regularity, and calculus for broader classes of functions is a promising direction for future research. Finally, because local failures of invertibility can have global effects on training dynamics, future work could explore how to design architectures that are inherently "globally well-behaved" under this nonsmooth lens.

Summary updated

BibTeX
@inproceedings{bolte2021nonsmooth,
  author = {Jérôme Bolte and Tam Le and Edouard Pauwels and Antonio Silveti-Falls},
  title = {{Nonsmooth Implicit Differentiation for Machine-Learning and Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=EwBaLZYQWOn},
}
Figure