SearcharxivSearch

arXiv subjects

Moritz Schauer

Publications and source records attributed to Moritz Schauer.

At least 19 recordsLinked to original sources

GradInf: Gradient Estimation as Probabilistic Inference

Gradient estimation -- the task of computing the gradient of the expected value of a probabilistic program -- has diverse applications in scientific computing, but is notoriously difficult because of issues such as high-dimensional integration, discrete random choices, and complex stochastic dependencies. This article introduces gradient inference, a new approach to developing sound and efficient gradient estimators for probabilistic programs. Gradient inference rests on a formal reduction from a gradient estimation problem to a closely related probabilistic inference problem, whose solution can be differentiated to obtain a gradient estimator. This inference problem is obtained by applying two powerful statistical operations -- coupling and factorization -- to the input probabilistic program. Our reduction lets us leverage the rich toolkit of probabilistic inference algorithms to design novel gradient estimators that extend and improve upon existing methods. We introduce GradInf, a probabilistic programming system that facilitates the sound and automated implementation of gradient inference. GradInf is centered around programmable source-to-source transformations for coupling and factorizing higher-order probabilistic programs, whose soundness is proven in terms of a denotational semantics. Key to our development is the use of information-flow typing to allow random choices in a probabilistic program to be factored out and partially evaluated, which improves our ability to deploy sophisticated probabilistic inference algorithms. The resulting system offers practitioners a principled framework for designing gradient estimators. We apply GradInf to several challenging case studies, showing that it can express prominent gradient estimators from the literature and enables the construction of new state-of-the-art estimators that outperform the best existing baselines.

cs.PL

Causality--\Delta: Jacobian-Based Dependency Analysis in Flow Matching Models

Flow matching learns a velocity field that transports a base distribution to data. We study how small latent perturbations propagate through these flows and show that Jacobian-vector products (JVPs) provide a practical lens on dependency structure in the generated features. We derive closed-form expressions for the optimal drift and its Jacobian in Gaussian and mixture-of-Gaussian settings, revealing that even globally nonlinear flows admit local affine structure. In low-dimensional synthetic benchmarks, numerical JVPs recover the analytical Jacobians. In image domains, composing the flow with an attribute classifier yields an attribute-level JVP estimator that recovers empirical correlations on MNIST and CelebA. Conditioning on small classifier-Jacobian norms reduces correlations in a way consistent with a hypothesized common-cause structure, while we emphasize that this conditioning is not a formal do intervention.

cs.LG

Backward Filtering Forward Guiding

We develop a general methodological framework for probabilistic inference in discrete- and continuous-time stochastic processes evolving on directed acyclic graphs (DAGs). The process is observed only at the leaf nodes, and the challenge is to infer its full latent trajectory: a smoothing problem that arises in fields such as phylogenetics, epidemiology, and signal processing. Our approach combines a backward information filtering step, which constructs likelihood-informed potentials from observations, with a forward guiding step, where a tractable process is simulated under a change of measure constructed from these potentials. This Backward Filtering Forward Guiding (BFFG) scheme yields weighted samples from the posterior distribution over latent paths and is amenable to integration with MCMC and particle filtering methods. We demonstrate that BFFG applies to both discrete- and continuous-time models, enabling probabilistic inference in settings where standard transition densities are intractable or unavailable. Our framework opens avenues for incorporating structured stochastic dynamics into probabilistic programming. We numerically illustrate our approach for a branching diffusion process on a directed tree.

stat.ME

Rebalancing Markov jump processes for non-reversible continuous-time sampling

Markov chain Monte Carlo methods are central in computational statistics, and typically rely on detailed balance to ensure invariance with respect to a target distribution. Although straightforward to construct by Metropolization, this can induce diffusion-like exploration of the sample space, requiring careful tuning of parameters such as step size. We introduce a general mechanism for constructing non-reversible continuous-time samplers, without requiring detailed balance. Our approach transforms jump processes satisfying a skew-detailed balance condition for a reference measure into processes sampling a target measure absolutely continuous with respect to it. Unbounded balancing functions allow such samplers to dynamically select favourable transitions. We establish invariance under weak criteria and demonstrate how to verify geometric ergodicity. Numerical experiments demonstrate that the resulting samplers are more robust to parameter tuning.

math.ST

Controlled stochastic processes for simulated annealing

Simulated annealing solves global optimization problems by means of a random walk in a cooling energy landscape based on the objective function and a temperature parameter. However, if the temperature is decreased too quickly, this procedure often gets stuck in suboptimal local minima. In this work, we consider the cooling landscape as a curve of probability measures. We prove the existence of a minimal norm velocity field which solves the continuity equation, a differential equation that governs the evolution of the aforementioned curve. The solution is the weak gradient of an integrable function, which is in line with the interpretation of the velocity field as a derivative of optimal transport maps. We show that controlling stochastic annealing processes by superimposing this velocity field would allow them to follow arbitrarily fast cooling schedules. Here we consider annealing processes based on diffusions and piecewise deterministic Markov processes. Based on convergent optimal transport-based approximations to this control, we design a novel interacting particle--based optimization method that accelerates annealing. We validate this accelerating behaviour in numerical experiments.

math.OC

Guided smoothing and control for diffusion processes

The smoothing distribution is the conditional distribution of the diffusion process in the space of trajectories given noisy observations made continuously in time. It is generally difficult to sample from this distribution. We use the theory of enlargement of filtrations to show that the conditional process has an additional drift term derived from the backward filtering distribution that is moving or guiding the process towards the observations. This term is intractable, but its effect can be equally introduced by replacing it with a heuristic, where importance weights correct for the discrepancy. From this Markov Chain Monte Carlo and sequential Monte Carlo algorithms are derived to sample from the smoothing distribution. The choice of the guiding heuristic is discussed from an optimal control perspective and evaluated. The results are tested numerically on a stochastic differential equation for reaction-diffusion.

math.PR

Score matching for bridges without learning time-reversals

We propose a new algorithm for learning bridged diffusion processes using score-matching methods. Our method relies on reversing the dynamics of the forward process and using this to learn a score function, which, via Doob's $h$-transform, yields a bridged diffusion process; that is, a process conditioned on an endpoint. In contrast to prior methods, we learn the score term $\nabla_x \log p(t, x; T, y)$ directly, for given $t, y$, completely avoiding first learning a time-reversal. We compare the performance of our algorithm with existing methods and see that it outperforms using the (learned) time-reversals to learn the score term. The code can be found at https://github.com/libbylbaker/forward_bridge.

stat.ML

Gradient Estimation via Differentiable Metropolis-Hastings

Metropolis-Hastings estimates intractable expectations - can differentiating the algorithm estimate their gradients? The challenge is that Metropolis-Hastings trajectories are not conventionally differentiable due to the discrete accept/reject steps. Using a technique based on recoupling chains, our method differentiates through the Metropolis-Hastings sampler itself, allowing us to estimate gradients with respect to a parameter of otherwise intractable expectations. Our main contribution is a proof of strong consistency and a central limit theorem for our estimator under assumptions that hold in common Bayesian inference problems. The proofs augment the sampler chain with latent information, and formulate the estimator as a stopping tail functional of this augmented chain. We demonstrate our method on examples of Bayesian sensitivity analysis and optimizing a random walk Metropolis proposal.

math.ST

Simulating conditioned diffusions on manifolds

To date, most methods for simulating conditioned diffusions are limited to the Euclidean setting. The conditioned process can be constructed using a change of measure known as Doob's $h$-transform. The specific type of conditioning depends on a function $h$ which is typically unknown in closed form. To resolve this, we extend the notion of guided processes to a manifold $M$, where one replaces $h$ by a function based on the heat kernel on $M$. We consider the case of a Brownian motion with drift, constructed using the frame bundle of $M$, conditioned to hit a point $x_T$ at time $T$. We prove equivalence of the laws of the conditioned process and the guided process with a tractable Radon-Nikodym derivative. Subsequently, we show how one can obtain guided processes on any manifold $N$ that is diffeomorphic to $M$ without assuming knowledge of the heat kernel on $N$. We illustrate our results with numerical simulations of guided processes and Bayesian parameter estimation based on discrete-time observations. For this, we consider both the torus and the Poincar\'e disk.

math.PR

Causal structure learning with momentum: Sampling distributions over Markov Equivalence Classes of DAGs

In the context of inferring a Bayesian network structure (directed acyclic graph, DAG for short), we devise a non-reversible continuous time Markov chain, the ``Causal Zig-Zag sampler'', that targets a probability distribution over classes of observationally equivalent (Markov equivalent) DAGs. The classes are represented as completed partially directed acyclic graphs (CPDAGs). The non-reversible Markov chain relies on the operators used in Chickering's Greedy Equivalence Search (GES) and is endowed with a momentum variable, which improves mixing significantly as we show empirically. The possible target distributions include posterior distributions based on a prior over DAGs and a Markov equivalent likelihood. We offer an efficient implementation wherein we develop new algorithms for listing, counting, uniformly sampling, and applying possible moves of the GES operators, all of which significantly improve upon the state-of-the-art run-time.

stat.ML

Differentiating Metropolis-Hastings to Optimize Intractable Densities

We develop an algorithm for automatic differentiation of Metropolis-Hastings samplers, allowing us to differentiate through probabilistic inference, even if the model has discrete components within it. Our approach fuses recent advances in stochastic automatic differentiation with traditional Markov chain coupling schemes, providing an unbiased and low-variance gradient estimator. This allows us to apply gradient-based optimization to objectives expressed as expectations over intractable target densities. We demonstrate our approach by finding an ambiguous observation in a Gaussian mixture model and by maximizing the specific heat in an Ising model.

stat.ML

Compositionality in algorithms for smoothing

Backward Filtering Forward Guiding (BFFG) is a bidirectional algorithm proposed in Mider et al. [2021] and studied more in depth in a general setting in Van der Meulen and Schauer [2022]. In category theory, optics have been proposed for modelling systems with bidirectional data flow. We connect BFFG with optics by demonstrating that the forward and backwards map together define a functor from a category of Markov kernels into a category of optics, which is furthermore lax monoidal in the case when the guiding kernels coincide with the generative dynamics

math.CT

Methods and applications of PDMP samplers with boundary conditions

We extend Monte Carlo samplers based on piecewise deterministic Markov processes (PDMP samplers) by formally defining different boundary conditions such as sticky floors, soft and hard walls and teleportation portals. This allows PDMP samplers to target measures with piecewise-smooth densities relative to mixtures of Dirac and continuous components and measures supported on disconnected regions or regions which are difficult to reach with continuous paths. This is achieved by specifying the transition kernel which governs the behaviour of standard PDMPs when reaching a boundary. We determine a sufficient condition for the kernel at the boundary in terms of the skew-detailed balance condition and give concrete examples. The probabilities to cross a boundary can be tuned by introducing a piecewise constant speed-up function which modifies the velocity of the process upon crossing the boundary without extra computational cost. We apply this new class of processes to two illustrative applications in epidemiology and statistical mechanics.

stat.CO

Automatic Differentiation of Programs with Discrete Randomness

Automatic differentiation (AD), a technique for constructing new programs which compute the derivative of an original program, has become ubiquitous throughout scientific computing and deep learning due to the improved performance afforded by gradient-based optimization. However, AD systems have been restricted to the subset of programs that have a continuous dependence on parameters. Programs that have discrete stochastic behaviors governed by distribution parameters, such as flipping a coin with probability $p$ of being heads, pose a challenge to these systems because the connection between the result (heads vs tails) and the parameters ($p$) is fundamentally discrete. In this paper we develop a new reparameterization-based methodology that allows for generating programs whose expectation is the derivative of the expectation of the original program. We showcase how this method gives an unbiased and low-variance estimator which is as automated as traditional AD mechanisms. We demonstrate unbiased forward-mode AD of discrete-time Markov chains, agent-based models such as Conway's Game of Life, and unbiased reverse-mode AD of a particle filter. Our code package is available at https://github.com/gaurav-arya/StochasticAD.jl.

cs.LG

Flexible Group Fairness Metrics for Survival Analysis

Algorithmic fairness is an increasingly important field concerned with detecting and mitigating biases in machine learning models. There has been a wealth of literature for algorithmic fairness in regression and classification however there has been little exploration of the field for survival analysis. Survival analysis is the prediction task in which one attempts to predict the probability of an event occurring over time. Survival predictions are particularly important in sensitive settings such as when utilising machine learning for diagnosis and prognosis of patients. In this paper we explore how to utilise existing survival metrics to measure bias with group fairness metrics. We explore this in an empirical experiment with 29 survival datasets and 8 measures. We find that measures of discrimination are able to capture bias well whereas there is less clarity with measures of calibration and scoring rules. We suggest further areas for research including prediction-based fairness metrics for distribution predictions.

cs.CY

Conditioning continuous-time Markov processes by guiding

A continuous-time Markov process $X$ can be conditioned to be in a given state at a fixed time $T > 0$ using Doob's $h$-transform. This transform requires the typically intractable transition density of $X$. The effect of the $h$-transform can be described as introducing a guiding force on the process. Replacing this force with an approximation defines the wider class of guided processes. For certain approximations the law of a guided process approximates - and is equivalent to - the actual conditional distribution, with tractable likelihood-ratio. The main contribution of this paper is to prove that the principle of a guided process, introduced in Schauer et al. (2017) for stochastic differential equations, can be extended to a more general class of Markov processes. In particular we apply the guiding technique to jump processes in discrete state spaces. The Markov process perspective enables us to improve upon existing results for hypo-elliptic diffusions.

math.PR

Applied Measure Theory for Probabilistic Modeling

Probabilistic programming and statistical computing are vibrant areas in the development of the Julia programming language, but the underlying infrastructure dramatically predates recent developments. The goal of MeasureTheory.jl is to provide Julia with the right vocabulary and tools for these tasks. In the package we introduce a well-chosen set of notions from the foundations of probability together with powerful combinators and transforms, giving a gentle introduction to the concepts in this article. The task is foremost achieved by recognizing measure as the central object. This enables us to develop a proper concept of densities as objects relating measures with each others. As densities provide local perspective on measures, they are the key to efficient implementations. The need to preserve this computationally so important locality leads to the new notion of locally-dominated measure solving the so-called base measure problem and making work with densities and distributions in Julia easier and more flexible.

stat.CO

Weak solutions to gamma-driven stochastic differential equations

We study a stochastic differential equation driven by a gamma process, for which we give results on the existence of weak solutions under conditions on the volatility function. To that end we provide results on the density process between the laws of solutions with different volatility functions.

math.PR