AI4BayesCode: From Natural Language Descriptions to Validated Modular Stateful Bayesian Samplers

Jungang Zou, Alex Ziyu Jiang, Qixuan Chen
5/18/2026
stat.COcs.AIcs.LG
bayesian

No confident code implementation found for this paper.

Abstract

Coding and computation remain major bottlenecks in Markov chain Monte Carlo (MCMC) workflows, especially as modern sampling algorithms have become increasingly complex and existing probabilistic programming systems remain limited in model support, extensibility, and composability. We introduce \textbf{AI4BayesCode}, an extensible LLM-driven system that translates natural-language Bayesian model descriptions into runnable, validated MCMC samplers.

Show full abstract

To improve reliability, AI4BayesCode adopts a modular design that decomposes models into modular sampling blocks and maps each block to a built-in sampling component, reducing the need to implement complex sampling algorithms from scratch. Reliability is further improved through pre-generation validation of model specifications and post-generation validation of generated sampler code. AI4BayesCode also introduces a novel recursively stateful coding paradigm for MCMC, allowing modular sampling components, potentially developed by different contributors, to be composed coherently within larger MCMC procedures. We develop a benchmark suite to evaluate AI4BayesCode for sampler-generation. Experiments show that AI4BayesCode can implement a wide range of Bayesian models from natural-language descriptions alone. As an open-ended system, its capability can continue to expand with improvements in the underlying AI agent and the addition of new built-in blocks. The software is available at https://ai4bayescode.com/.

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{zou2026aibayescode,
  title  = {AI4BayesCode: From Natural Language Descriptions to Validated Modular Stateful Bayesian Samplers},
  author = {Jungang Zou and Alex Ziyu Jiang and Qixuan Chen},
  year   = {2026},
  eprint = {2605.18476},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.18476v2}
}

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

Discussion