Thermalizing Stochastic Programs

Mirko Amico, Andraž Jelinčič, Colin Oscar Nancarrow, Leo Tyrpak, David Roberts +4 more
8/3/2026
cs.ETcs.LG

No confident code implementation found for this paper.

Abstract

We present a set of tools for mapping general stochastic programs to thermodynamic hardware designed for energy-efficient stochastic sampling. Given a target stochastic program expressed as a Directed Factor Graph (DFG) of stochastic channels, or equivalently as a Parametrized Stochastic Circuit (PSC), we first introduce a method to approximately compile each factor in the DFG to an Energy-Based Model (EBM) that is native to the hardware.

Show full abstract

We then analyze how the error of the compiled DFG accumulates from the per-factor errors, and introduce two training refinements, context matching and trajectory-level REINFORCE post-training, which can reduce the residual error left by training each factor in isolation. The \texttt{thermalizers} framework takes a stochastic program expressed in the \texttt{torx} library and replaces its factors with thermodynamic kernels implemented and sampled using the \texttt{thrml} library. We demonstrate it on several example applications, including a market simulator that learns the joint day-to-day dynamics of a panel of financial time series from recorded market history alone, a probabilistic model from mathematical ecology, Gibbs sampling of an EBM the hardware cannot natively express, and a sequential Bayesian design loop over a Gaussian stochastic circuit.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{amico2026thermalizing,
  title  = {Thermalizing Stochastic Programs},
  author = {Mirko Amico and Andraž Jelinčič and Colin Oscar Nancarrow and Leo Tyrpak and David Roberts and Seth Morton and Dalton Sakthivadivel and Ashwin Gopal and Guillaume Verdon},
  year   = {2026},
  eprint = {2608.01615},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.01615v2}
}

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.01615.svg)](https://codeofpaper.com/paper/2608.01615)

Discussion