Unraveling the iterative CHAD

Fernando Lucatelli Nunes, Gordon Plotkin, Matthijs Vákár
5/21/2025
cs.PLcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Combinatory Homomorphic Automatic Differentiation (CHAD) was originally formulated as a semantics-driven source-to-source transformation for reverse-mode automatic differentiation of total functional programs. We extend CHAD to programs with partial operations, data-dependent conditionals, and while-loops, preserving its defining principle of structure-preserving semantics.

Show full abstract

Our main contribution is the introduction of iteration-extensive indexed categories, which integrate iteration into dependently typed programming languages. Iteration in the base category lifts to parameterized initial algebras in the indexed category, yielding fibred iteration on the op-Grothendieck construction. Its total category is the category of containers associated with the dependently typed target language. This framework characterizes iterative CHAD as the unique iterative Freyd category morphism from the source language's syntactic category to the target language's category of containers that maps each primitive operation to its transposed derivative. Using the universal property of the syntactic model, we prove that the transformed programs compute the reverse-mode derivatives of the original programs. The resulting theory connects fixpoint operators in indexed categories with a structure-preserving construction and correctness proof for iterative CHAD.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nunes2025unraveling,
  title  = {Unraveling the iterative CHAD},
  author = {Fernando Lucatelli Nunes and Gordon Plotkin and Matthijs Vákár},
  year   = {2025},
  eprint = {2505.15002},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.15002v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.15002.svg)](https://codeofpaper.com/paper/2505.15002)

Discussion