Saved in:
Bibliographic Details
Main Authors: Zou, Jungang, Jiang, Alex Ziyu, Chen, Qixuan
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2605.18476
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916023048863744
author Zou, Jungang
Jiang, Alex Ziyu
Chen, Qixuan
author_facet Zou, Jungang
Jiang, Alex Ziyu
Chen, Qixuan
contents 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. 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.
format Preprint
id arxiv_https___arxiv_org_abs_2605_18476
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle AI4BayesCode: From Natural Language Descriptions to Validated Modular Stateful Bayesian Samplers
Zou, Jungang
Jiang, Alex Ziyu
Chen, Qixuan
Computation
Artificial Intelligence
Machine Learning
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. 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.
title AI4BayesCode: From Natural Language Descriptions to Validated Modular Stateful Bayesian Samplers
topic Computation
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2605.18476