← all repositories
probcomp/Gen.jl

Probabilistic programming where you write the inference, not just the model

Gen.jl treats inference algorithms as first-class code, not black-box solvers.

1.8k stars Julia ML FrameworksAgents
Gen.jl
Velocity · 7d
+0.6
★ / day
Trend
steady
star history

What it does

Gen.jl is a probabilistic programming system embedded in Julia. You write generative models in its modeling language, then pick or build inference algorithms — SMC, variational inference, MCMC, or custom hybrids — to fit them to data. It also supports gradient-based training of generative models and Bayesian structure learning.

The interesting bit

Most PPLs let you define the model and hand you a fixed inference algorithm. Gen.jl inverts that: inference is programmable. You can write custom proposal distributions, variational families, or MCMC kernels without deriving gradients or densities by hand. The system handles the math plumbing so you can experiment with inference strategies the way you’d experiment with model architectures.

Key highlights

  • Multi-paradigm inference: SMC, variational inference, MCMC, wake-sleep learning, parameter optimization
  • Custom inference components via well-defined APIs (proposals, kernels, trace translators)
  • Specialized modeling constructs for incremental computation to speed up inference
  • Support for Bayesian structure learning via involutive MCMC and SMCP³
  • Extensible: custom generative functions, distributions, and gradients
  • Active research project at MIT Probabilistic Computing Project (PLDI 2019 paper)

Caveats

  • Julia-only; no Python or R bindings mentioned
  • Documentation and tutorials live on a separate site (gen.dev), not in the repo itself
  • “Ongoing research” may mean API instability or sparse enterprise support

Verdict

Worth a look if you’re doing Bayesian modeling and have hit the limits of black-box inference — or if you want to treat inference as a design space, not a solved problem. Skip if you need a mature, batteries-included ecosystem in Python.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.