The construction is formulated in the framework of Combinatory Homomorphic Automatic Differentiation (CHAD), treating AD as a structure-preserving transformation of programs, guided by a denotational semantics, and gives a reusable pattern for differentiating discrete-output algebraic effects.
Abstract
We analyse reverse-mode automatic differentiation (AD) for discrete probabilistic programs. Our construction is formulated in the framework of Combinatory Homomorphic Automatic Differentiation (CHAD), treating AD as a structure-preserving transformation of programs, guided by a denotational semantics. The main case study is the finite atomic distribution monad, whose computations have finite support and differentiable weights. The key point is that differentiating probabilistic programs requires cotangents to flow backwards not only through deterministic computations, but also through the probabilistic structure itself. We define the corresponding reverse-mode code transformation and prove its correctness, for handled real-output programs, by a categorical logical-relations argument. Although the paper focuses on finite discrete probability, the construction gives a reusable pattern for differentiating discrete-output algebraic effects, including finite multiset non-determinism (e.g., from fork-join parallelism), exceptions, and writer-style accumulation (e.g., for in-place accumulation of high-dimensional vectors). More broadly, we view this work as a foundational step towards extending CHAD to richer probabilistic languages and to other algebraic effects with handlers.
The empirical evaluation shows two complementary strengths of Slice when paired with discrete backends: it enables exact inference for challenging continuous programs that lie beyond the reach of previous exact systems, and is competitive with state-of-the-art exact inference systems for continuous programs.
Katherine Wu, Jules Jacobs, Kevin Batz et al.· Proceedings of the ACM on Pr...· 0 citations
Automatic differentiation (AD) transforms programs into programs that compute derivatives and is a central tool in scientific computing, machine learning and optimisation. Extending AD to expressive programming languages raises a fundamental question: how can differentiation accommodate higher-order functions, rich dat...
This work is a continuation, and generalization, of Andrew Appel's landmark work on “Compiling with Continuations”, but instead of natural-deduction-based languages like the lambda calculus, it uses sequent-calculus-inspired languages throughout all intermediate stages.
Marius Müller, David Binder, Marco Tzschentke et al.· ACM Transactions on Programm...· 0 citations
An evaluation engine that is algebra-generic and amenable to differentiation, together with an executable specification of the algebras it can accept is presented, both forward and backward.
This work tests whether large language models (LLMs) can help while remaining non-authoritative in a constrained mathematical search for high-order structure-preserving discretization and reconstructs four leading LLM-originated programs exactly.
Data processing using traditional pattern matching syntax and direct recursive functions is straightforward to write but becomes awkward in ambiguous (i.e., nondeterministic) cases: when programmers wish to avoid backtracking, they often end up having to write complicated code that sacrifices clarity and modularity. Ho...
Lu-Yu Cheng, Florent Ferrari, Michael D. Adams et al.· Proceedings of the ACM on Pr...· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.