[Paper Review] Inducing Probabilistic Programs by Bayesian Program Merging
This paper proposes Bayesian program merging, a method for inducing probabilistic programs from data by iteratively applying program transformations to compress an initial, overfitting program into a more abstract, generalizable model. By using Bayesian posterior probability as the optimization criterion, the approach discovers recursive structures, parameterized functions, and stochastic patterns in nested list data, achieving effective generalization from few examples.
This report outlines an approach to learning generative models from data. We express models as probabilistic programs, which allows us to capture abstract patterns within the examples. By choosing our language for programs to be an extension of the algebraic data type of the examples, we can begin with a program that generates all and only the examples. We then introduce greater abstraction, and hence generalization, incrementally to the extent that it improves the posterior probability of the examples given the program. Motivated by previous approaches to model merging and program induction, we search for such explanatory abstractions using program transformations. We consider two types of transformation: Abstraction merges common subexpressions within a program into new functions (a form of anti-unification). Deargumentation simplifies functions by reducing the number of arguments. We demonstrate that this approach finds key patterns in the domain of nested lists, including parameterized sub-functions and stochastic recursion.
Motivation & Objective
- To develop a method for learning generative models from small datasets by representing them as probabilistic programs.
- To address the challenge of generalization in probabilistic model learning by identifying abstract, reusable patterns in data.
- To enable automatic discovery of complex structures such as recursion and parameterized functions through program transformation.
- To frame model induction as a Bayesian search problem, optimizing for posterior probability of the program given the data.
- To demonstrate the effectiveness of program transformations—abstraction and deargumentation—in inducing compact, generalizable models.
Proposed method
- Represent data as algebraic data types and construct an initial program that generates exactly the observed examples using uniform priors.
- Apply two core program transformations: abstraction (merging common subexpressions into functions via anti-unification) and deargumentation (reducing function arity to induce generalization).
- Use beam search to explore the space of transformed programs, guided by the posterior probability $ P(M|D) $, balancing likelihood and model complexity.
- Estimate likelihood in the list domain using Monte Carlo sampling and approximate inference to evaluate program quality.
- Leverage a probabilistic programming language (subset of Church) to express models with recursion, higher-order functions, and stochastic choices.
- Formalize search moves as syntactic transformations that improve compression and generalization while maintaining correctness.
Experimental results
Research questions
- RQ1Can program transformations be used to systematically induce abstract, generalizable probabilistic programs from raw data?
- RQ2How can Bayesian model merging be extended to expressive probabilistic programs beyond simple grammars?
- RQ3To what extent can abstraction and deargumentation improve generalization in small-data settings?
- RQ4Can recursive and parameterized functions be automatically discovered through posterior-driven search?
- RQ5How effective is the approach in learning complex, nested data structures like trees and vines from a single or few examples?
Key findings
- The system successfully induces recursive programs from a single observation, such as the 'vine' example, where a single sample suffices to learn a stochastic recursive structure.
- For the 'tree' example, the system learns a parameterized function for flowers and a recursive branching structure, with F1, F2, and F3 corresponding to core reusable components.
- With $\alpha=3$, the system induces a model that generalizes across multiple branch instances, demonstrating the role of the prior in balancing compression and likelihood.
- The approach discovers parameterized sub-functions and stochastic recursion, such as in the flower and petal construction, showing ability to model noisy data with shared structure.
- Beam search with depth 10 and beam width 1 successfully explores the search space and produces models that generate diverse, plausible samples matching the training data.
- The induced programs achieve high posterior probability by compressing repeated patterns, such as shared color and size distributions, through function abstraction and argument reduction.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.