Skip to main content
QUICK REVIEW

[Paper Review] Functional Tensors for Probabilistic Programming

Fritz Obermeyer, Eli Bingham|arXiv (Cornell University)|Oct 23, 2019
Gaussian Processes and Bayesian InferenceComputer Science36 references11 citations
TL;DR

This paper introduces functional tensors (funsors), a software abstraction that extends tensor-based computation to probabilistic programming by enabling exact and approximate inference in a unified framework. By generalizing tensors to support continuous distributions and symbolic operations, funsors allow efficient, parallel exact inference via variable elimination and mixed inference strategies, demonstrated in Pyro with support for both discrete and continuous variables.

ABSTRACT

It is a significant challenge to design probabilistic programming systems that can accommodate a wide variety of inference strategies within a unified framework. Noting that the versatility of modern automatic differentiation frameworks is based in large part on the unifying concept of tensors, we describe a software abstraction for integration --functional tensors-- that captures many of the benefits of tensors, while also being able to describe continuous probability distributions. Moreover, functional tensors are a natural candidate for generalized variable elimination and parallel-scan filtering algorithms that enable parallel exact inference for a large family of tractable modeling motifs. We demonstrate the versatility of functional tensors by integrating them into the modeling frontend and inference backend of the Pyro programming language. In experiments we show that the resulting framework enables a large variety of inference strategies, including those that mix exact and approximate inference.

Motivation & Objective

  • To unify diverse inference strategies—such as message-passing, MCMC, and variational inference—within a single probabilistic programming framework.
  • To extend the tensor abstraction to handle continuous probability distributions and symbolic integration, enabling exact inference for complex models.
  • To support mixed inference strategies that combine black-box variational inference with exact methods like Kalman filtering.
  • To provide a performant, composable intermediate representation for probabilistic programs that supports both automatic differentiation and symbolic manipulation.
  • To enable efficient, parallel exact inference through generalized variable elimination and scan-based filtering algorithms.

Proposed method

  • Funsors generalize tensors to include real-valued arrays, Dirac delta functions, and Gaussian distributions, enabling symbolic representation of probability densities.
  • The framework introduces a first-order language of lazy expressions with operations like marginalization (∑), product (∏), substitution, and function application.
  • Key components include Tensor (discrete factors), Gaussian (normalizing distributions), and Delta (point masses), all backed by O(1) memory blocks for efficient GPU-accelerated computation.
  • Broadcasting is extended to support free variables of non-integer types (e.g., real vectors), enabling shape-aware composition of probabilistic models.
  • Inference algorithms are implemented as nonstandard interpretations of funsor expressions, allowing transparent mixing of exact and approximate inference.
  • The system compiles probabilistic programs into a unified intermediate representation that supports both symbolic integration and Monte Carlo sampling.

Experimental results

Research questions

  • RQ1Can a unified software abstraction generalize tensor operations to support continuous probability distributions and enable exact inference?
  • RQ2How can functional tensors enable efficient, parallel exact inference across a wide class of tractable probabilistic models?
  • RQ3Can funsors support mixed inference strategies that combine symbolic variable elimination with black-box variational inference?
  • RQ4What is the performance and expressiveness trade-off of using lazy, symbolic representations for probabilistic programs with continuous and discrete variables?
  • RQ5How can the funsor abstraction be integrated into existing probabilistic programming languages to support both exact and approximate inference?

Key findings

  • The funsor framework successfully extends tensor-based computation to continuous probability distributions, enabling symbolic representation of densities like Gaussians and Dirac deltas.
  • Functional tensors support efficient, parallel exact inference through generalized variable elimination and scan-based filtering algorithms, even for models with complex dependencies.
  • The framework enables mixed inference strategies, such as combining Kalman filtering with black-box variational inference, by unifying symbolic and Monte Carlo computation.
  • Experiments in Pyro demonstrate that funsors can represent and compile complex models—such as Gaussian mixture models—into a single, optimized intermediate representation.
  • The implementation shows that funsor expressions are backed by O(1) memory blocks, enabling GPU-accelerated operations that scale efficiently with model size.
  • The system supports both discrete and continuous latent variables through a unified type system and extends broadcasting to non-integer types, enabling composable, shape-aware probabilistic modeling.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.