Forward- or Reverse-Mode Automatic Differentiation: What's the Difference?
Not on the map. Why?
Abstract (arXiv)
Automatic differentiation (AD) has been a topic of interest for researchers in many disciplines, with increased popularity since its application to machine learning and neural networks. Although many researchers appreciate and know how to apply AD, it remains a challenge to truly understand the underlying processes. From an algebraic point of view, however, AD appears surprisingly natural: it originates from the differentiation laws. In this work we use Algebra of Programming techniques to reason about different AD variants, leveraging Haskell to illustrate our observations. Our findings stem from three fundamental algebraic abstractions: (1) the notion of module over a semiring, (2) Nagata's construction of the 'idealization of a module', and (3) Kronecker's delta function, that together allow us to write a single-line abstract definition of AD. From this single-line definition, and by instantiating our algebraic structures in various ways, we derive different AD variants, that have the same extensional behaviour, but different intensional properties, mainly in terms of (asymptotic) computational complexity. We show the different variants equivalent by means of Kronecker isomorphisms, a further elaboration of our Haskell infrastructure which guarantees correctness by construction. With this framework in place, this paper seeks to make AD variants more comprehensible, taking an algebraic perspective on the matter.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 21 Dec 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 1; 2024: 1; 2025: 1; 2026: 1.
4 papers.
- 2024Semirings for Probabilistic and Neuro-Symbolic Logic Programmingcited by 6
- 2025Deep Learning Meets Process-Based Models: A Hybrid Approach to Agricultural Challengescited by 1
- 2023nablaSD: Differentiable Programming for Sparse Tensorscited by 0
- 2026LazyHMC: Hamiltonian Monte Carlo Simulation for Lazy, Infinite Dimensional Probabilistic Programscited by 0
- 2026LazyHMC: Hamiltonian Monte Carlo Simulation for Lazy, Infinite Dimensional Probabilistic Programs9 Aug 2026
- 2025Deep Learning Meets Process-Based Models: A Hybrid Approach to Agricultural Challenges22 Apr 2025
- 2024Semirings for Probabilistic and Neuro-Symbolic Logic Programming21 Feb 2024
- 2023nablaSD: Differentiable Programming for Sparse Tensors13 Mar 2023