Reverse AD at Higher Types: Pure, Principled and Denotationally Correct
Matthijs V\'ak\'ar

TL;DR
This paper presents a categorical, denotationally correct approach to defining forward- and reverse-mode automatic differentiation in higher-order functional languages, ensuring pure, correct, and flexible code generation.
Contribution
It introduces a principled, categorical framework for AD transformations that are purely functional, correct by semantic proof, and adaptable to standard functional languages using abstract data types.
Findings
Semantic proof of correctness for AD transformations
Code generation with linear types in a pure functional setting
Implementation using abstract data types without sacrificing correctness
Abstract
We show how to define forward- and reverse-mode automatic differentiation source-code transformations or on a standard higher-order functional language. The transformations generate purely functional code, and they are principled in the sense that their definition arises from a categorical universal property. We give a semantic proof of correctness of the transformations. In their most elegant formulation, the transformations generate code with linear types. However, we demonstrate how the transformations can be implemented in a standard functional language without sacrificing correctness. To do so, we make use of abstract data types to represent the required linear types, e.g. through the use of a basic module system.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Service-Oriented Architecture and Web Services · Model-Driven Software Engineering Techniques
