Stop brute-forcing your posteriors: structured Bayesian inference in Julia

Mapping disease risk across a region, modelling how insurance claims accumulate, tracking a fish stock as it rises and falls: these come from different fields, but the underlying models are alike.
Each describes a smooth, structured process that we never see directly, only through noisy data.
The standard approach is to hand these models to a general-purpose sampler and wait.
The trouble is that the sampler sees a black box, and brute-forces structure that the model states plainly.
By contrast, a family of specialized methods uses this structure, and they turn out to form one spectrum, from fast (orders of magnitude faster than MCMC) to faithful.
This talk introduces Latte.jl, a probabilistic programming language for latent Gaussian models that unifies this spectrum of structure-exploiting inference methods.


The same modelling shape shows up all over science. You have a Gaussian latent field, over space, over time, or over a smooth curve, controlled by some hyperparameters. Disease mapping, insurance risk, fisheries stock assessment, and generalized additive models look unrelated, but underneath they are structurally the same object: a latent Gaussian model.

If you've heard of probabilistic programming, you know the usual recipe for fitting these.
You write the model, hand it to a sampler like NUTS, and wait.
That generality is also the catch.
A general-purpose sampler treats every model as a black box, so it never takes advantage of the structure these models share.
For models like these, that amounts to brute force: the sampler works hard to rediscover what the structure already tells you, and you pay for it in speed and reliability.

Specialized methods take advantage of the structure instead.
INLA, the TMB-style Laplace approximation, and embedded-Laplace HMC all marginalize the latent field analytically rather than sampling it.
Each has tended to live in its own ecosystem, and adopting one used to be a project in itself.
This talk shows that the three are really one spectrum, trading speed for fidelity: the same inner approximation, with three ways of handling the hyperparameters.
With Latte.jl we define a single model, run it through all three engines without changing it, and watch the posterior sharpen as we move along that spectrum.
When we want a ground-truth check, we fall back to full MCMC on the same model (via a bridge to Turing.jl), with no rewrite.
What makes this practical is Julia's composability: the engines share automatic differentiation, sparse linear algebra, and a common modelling surface, so methods that once needed separate ecosystems now fit in a single package.

Outline

  • The same model in disguise: three problems from different fields, one shared structure (about 4 min)
  • Why a general-purpose sampler struggles here, and what it costs (about 3 min)
  • One idea, three engines: the shared approximation, and the spectrum from fast to faithful (about 6 min)
  • One model, every engine, live in Latte.jl: define once, run all three, fall back to MCMC as a check (about 9 min)
  • Choosing your point on the spectrum: where each engine is trustworthy, and how to decide (about 3 min)

Intended audience & level

Researchers, data scientists, and practitioners who fit (or want to fit) statistical models in any field.
Introductory to intermediate.
Knowing some regression and the basic Bayesian ideas (priors, posteriors) is enough.
No experience with Julia, INLA, MCMC is needed.

Tim Weiland

Tim Weiland is a PhD student in the Methods of Machine Learning group at the University of Tübingen, where he works on scalable probabilistic PDE solvers.
His research combines Bayesian inference, sparse linear algebra, and physics-informed priors to make uncertainty quantification practical for large-scale scientific computing problems.