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

Maria-Nicoleta Crăciun, C. -H. Luke Ong, Tom Schrijvers, Sam Staton
8/9/2026
stat.MLcs.LGcs.PL

No official code found. Best implementation: lazyppl-team/lazyhmc (0 stars, MIT, last commit 2026-07-24).

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.

View on arXivView PDF

Code Implementations(1)

MIT

Hamiltonian Monte Carlo for lazy, infinite-dimensional probabilistic programs (LazyHMC & LazyNUTS, built on LazyPPL). Code for the ICFP 2026 paper.

00Jul 22, 20263 months agoMIT

Similar Papers

Cite this paper

@article{crciun2026lazyhmc,
  title  = {LazyHMC: Hamiltonian Monte Carlo Simulation for Lazy, Infinite Dimensional Probabilistic Programs},
  author = {Maria-Nicoleta Crăciun and C. -H. Luke Ong and Tom Schrijvers and Sam Staton},
  year   = {2026},
  eprint = {2608.08588},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.08588v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.08588.svg)](https://codeofpaper.com/paper/2608.08588)

Discussion