Reference. The Compositional Structure of Bayesian Inference
Bayes’ rule tells us how to invert a causal process in order to update our beliefs in light of new evidence. If the process is believed to have a complex compositional structure, we may observe that the inversion of the whole can be computed piecewise in terms of the component processes. We study the structure of this compositional rule, noting that it relates to the lens pattern in functional programming. Working in a suitably general axiomatic presentation of a category of Markov kernels, we see how we can think of Bayesian inversion as a particular instance of a state-dependent morphism in a fibred category. We discuss the compositional nature of this, formulated as a functor on the underlying category and explore how this can used for a more type-driven approach to statistical inference.
Cite
Cited by (2)
Reinforcement Learning in Categorical Cybernetics hedges-2025-reinforcement
Fundamental Components of Deep Learning: A category-theoretic approach gavranovicFundamentalComponentsDeep
Deep learning, despite its remarkable achievements, is still a young field. Like the early stages of many scientific disciplines, it is marked by the discovery of new phenomena, ad-hoc design decisions, and the lack of a uniform and compositional mathematical foundation. From the intricacies of the implementation of backpropagation, through a growing zoo of neural network architectures, to the new and poorly understood phenomena such as double descent, scaling laws or in-context learning, there are few unifying principles in deep learning. This thesis develops a novel mathematical foundation for deep learning based on the language of category theory. We develop a new framework that is a) end-to-end, b) unform, and c) not merely descriptive, but prescriptive, meaning it is amenable to direct implementation in programming languages with sufficient features. We also systematise many existing approaches, placing many existing constructions and concepts from the literature under the same umbrella. In Part I we identify and model two main properties of deep learning systems parametricity and bidirectionality by we expand on the previously defined construction of actegories and Para to study the former, and define weighted optics to study the latter. Combining them yields parametric weighted optics, a categorical model of artificial neural networks, and more. Part II justifies the abstractions from Part I, applying them to model backpropagation, architectures, and supervised learning. We provide a lens-theoretic axiomatisation of differentiation, covering not just smooth spaces, but discrete settings of boolean circuits as well. We survey existing, and develop new categorical models of neural network architectures. We formalise the notion of optimisers and lastly, combine all the existing concepts together, providing a uniform and compositional framework for supervised learning.
Cites 20 works (5 here)
With notes (5)
Value Iteration is Optic Composition hedges-2023-value
Towards Foundations of Categorical Cybernetics capucci-2022-towards
Dependent Bayesian Lenses: Categories of Bidirectional Markov Kernels with Canonical Bayesian Inversion braithwaite-2022-dependent
We generalise an existing construction of Bayesian Lenses to admit lenses between pairs of objects where the backwards object is dependent on states on the forwards object (interpreted as probability distributions). This gives a natural setting for studying stochastic maps with Bayesian inverses restricted to the points supported by a given prior. In order to state this formally we develop a proposed definition by Fritz of a support object in a Markov category and show that these give rise to a section into the category of dependent Bayesian lenses encoding a more canonical notion of Bayesian inversion.
Compositional Game Theory ghani-2018-compositional
Categorical Logic and Type Theory jacobs-1999
This book is an attempt to give a systematic presentation of both logic and type theory from a categorical perspective, using the unifying concept of fibred category. Its intended audience consists of logicians, type theorists, category theorists and (theoretical) computer scientists.
External (15)
- Categorical foundations of gradient-based learning (2022)
- Predictive Coding: Towards a Future of Deep Learning beyond Backpropagation? (2022)
- On the relationship between predictive coding and backpropagation (2022)
- Mathematical Foundations for a Compositional Account of the Bayesian Brain (2022)
- Compositional active inference I: Bayesian lenses. statistical games (2021)
- An Introduction to Probabilistic Programming (2021)
- A synthetic approach to markov kernels, conditional independence and theorems on sufficient statistics (2020)
- Bayesian updates compose optically (2020)
- Disintegration and bayesian inversion via string diagrams (2019)
- Generalized lens categories via functors C^op → Cat (2019)
- Canonical microcircuits for predictive coding (2012)
- Maximum a posteriori estimation for markov chains based on gaussian markov random fields (2010)
- Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem (2007)
- Handbook of Categorical Algebra 2. Categories and Structures (1994)
- A categorical approach to probability theory (1982)