Introduction
In modern scientific computing, researchers frequently combine three powerful paradigms: Probabilistic Programming (PPL) for Bayesian inference, Differentiable Programming for optimization via automatic differentiation (AD), and Ordinary Differential Equation (ODE) solvers for physical modeling. However, composing these tools is mathematically hazardous. For instance, differentiating a function with random branching is often ill-defined, and ODE solutions require specific continuity properties that random effects can easily violate. CoreDPPL addresses this by providing a formal, unified foundation that guarantees these compositions are mathematically sound.
The CoreDPPL Framework
CoreDPPL is a higher-order calculus that introduces a novel type system to track both randomness and differentiability. The system employs effects to distinguish between deterministic (Det) and random (Rnd) computations. More uniquely, it uses coeffects to track differentiability levels for real numbers:
- A (Analytic): Represents smooth functions.
- P (Piecewise Analytic): Handles functions with "kinks," such as
absorifstatements. - N (Non-differentiable): Used for functions that cannot be differentiated, like realizations of a Wiener process.
Methods and Formalization
The authors defined a small-step operational semantics to explicitly manage the interactions between infer (probabilistic inference), diff (differentiation), and solve (ODE integration). To ensure the logic is robust, the entire type system and its safety proofs—specifically Progress and Preservation—were mechanized and proven in the Agda proof assistant. A prototype was implemented by extending Miking CorePPL, a compiler for universal probabilistic programming.
Case Studies and Results
The language's expressiveness was evaluated through three complex case studies:
- ODE Sensitivities: Computing how ODE solutions change with parameters.
- Random ODEs (RODEs): Modeling systems driven by continuous but non-differentiable noise.
- Bayesian Parameter Estimation: Using the Lotka-Volterra model to estimate biological growth rates from noisy data.
A key result is the "Deterministic Guarantee": a theorem proving that "deterministically typed" terms are independent of random seeds and weights. This ensures that derivatives calculated during optimization are not corrupted by the stochastic nature of the inference engine. The implementation successfully handled the Lotka-Volterra "stress test," producing posterior distributions for sensitivities that matched theoretical expectations.
Conclusion and Future Work
CoreDPPL represents a significant step toward bringing higher-order PPLs, first-class AD, and ODE primitives into a single, sound mathematical framework. While currently focused on forward-mode AD and ODEs, future work aims to extend the system to Differential-Algebraic Equations (DAEs), implement reverse-mode AD, and automate differentiability type inference to reduce the need for manual annotations.
Summary updated