arXiv:2608.08588stat.MLAug 2026

Manuscript Offprint

arXiv:2608.08588

LazyHMC: Hamiltonian Monte Carlo Simulation for Lazy, Infinite Dimensional Probabilistic Programs

Maria-Nicoleta Crăciun, C. -H. Luke Ong, Tom Schrijvers, Sam Staton

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

DOI: 10.1145/3828696Journal: PACMPLVolume: 10ICFP2988icfp26main-p82-pCCS: Mathematics of computing Markov-chain Monte Carlo methodsCCS: Software and its engineering Functional languagesCCS: Theory of computation Denotational semanticsCCS: Theory of computation Program analysisCCS: Mathematics of computing Nonparametric statisticsCCS: Mathematics of computing Stochastic processes

Received 2026-05-13

Abstract.

Hamiltonian Monte Carlo (HMC) is a successful generic inference method in probabilistic programming, but in its ordinary formulation it needs gradients and finite-dimensional parameter spaces. In Haskell, lazy evaluation lets probabilistic programs express stochastic processes and other non-parametric Bayesian models over implicit infinite-dimensional spaces. This paper develops new formulations of gradient-based HMC for this infinite-dimensional setting, via lazy evaluation. For automatic differentiation, we provide an analysis based on a new notion of “piecewise analytic under cylindrical analytic partition” (PACAP), to show that even if a program is infinite-dimensional and defined lazily, the gradient of the likelihood function is finitely supported. For the Monte Carlo method itself, we develop several HMC variants and a No-U-Turn Sampler that operate over the infinite-dimensional parameter space but are still productive because of lazy evaluation. Experiments cover Gaussian mixture clustering, random walks, and piecewise-constant regression with Poisson-process changepoints.

Keywords:

probabilistic programming, Hamiltonian Monte Carlo, lazy evaluation, automatic differentiation, measure-theoretic semantics, non-parametric Bayesian inference, No-U-Turn Sampler

References (18)