[Paper Review] Autoconj: Recognizing and Exploiting Conjugacy Without a Domain-Specific Language
Autoconj automates the recognition and exploitation of conjugacy in probabilistic models by operating directly on Python functions that compute log-joint densities, enabling efficient derivation of complete conditionals and marginals without requiring a domain-specific language. It accelerates structure-exploiting inference algorithms in any Python-embedded probabilistic programming language, with performance gains up to 10x on GPU via TensorFlow integration.
Deriving conditional and marginal distributions using conjugacy relationships can be time consuming and error prone. In this paper, we propose a strategy for automating such derivations. Unlike previous systems which focus on relationships between pairs of random variables, our system (which we call Autoconj) operates directly on Python functions that compute log-joint distribution functions. Autoconj provides support for conjugacy-exploiting algorithms in any Python embedded PPL. This paves the way for accelerating development of novel inference algorithms and structure-exploiting modeling strategies.
Motivation & Objective
- To automate the derivation of complete conditionals and marginals using conjugacy, reducing manual derivation errors and development time.
- To enable conjugacy-exploiting inference algorithms in any Python-embedded probabilistic programming language (PPL), without requiring a domain-specific language.
- To support efficient, composable inference by exposing conjugate structure through a simple Python API for log-joint functions.
- To accelerate research in novel inference algorithms and structure-aware modeling by leveraging automatic conjugacy detection.
Proposed method
- Autoconj operates directly on Python functions that compute log-joint densities, treating them as first-class objects for analysis.
- It identifies conjugate relationships by analyzing the algebraic structure of the log-joint function, particularly its representation as a multilinear polynomial in sufficient statistics.
- The system derives complete conditionals and marginals by symbolic manipulation of the log-joint function, returning new Python functions that implement the derived distributions.
- It supports integration with multiple numerical backends, including NumPy and TensorFlow, enabling GPU acceleration via automatic operation translation.
- Autoconj enables block coordinate-ascent variational inference (CAVI) and Gibbs sampling by automatically generating conditional distributions from the log-joint.
- It uses automatic differentiation and optimization tools (e.g., from Autograd and scipy) to enhance inference performance.
Experimental results
Research questions
- RQ1Can conjugacy relationships be automatically recognized and exploited in probabilistic models without requiring a domain-specific language?
- RQ2How can conjugacy detection be integrated into general-purpose Python-embedded probabilistic programming languages?
- RQ3What performance gains can be achieved by automating conjugacy exploitation in inference algorithms like CAVI and Gibbs sampling?
- RQ4To what extent can Autoconj scale with hardware acceleration, such as GPUs and TPUs?
Key findings
- Autoconj reduces the time and error rate associated with manual derivation of complete conditionals and marginals in conjugate exponential family models.
- The system enables efficient block coordinate-ascent variational inference (CAVI) and Gibbs sampling by automatically generating correct conditional distributions from log-joint functions.
- On a mixture-of-Gaussians model, Autoconj with TensorFlow on a GPU achieved inference in 4.3 seconds for 500 iterations, a 10x speedup over CPU-only NumPy.
- Autoconj’s performance scales significantly with hardware: 19.7 seconds on 6 CPU cores and 4.3 seconds on a single GPU, demonstrating strong parallelization benefits.
- The system successfully supports structure-exploiting inference in Bayesian factor analysis, outperforming mean-field ADVI in both accuracy and convergence speed.
- Autoconj enables seamless integration with existing Python ecosystems, including automatic differentiation and optimization libraries, facilitating rapid prototyping of novel inference algorithms.
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.