Squared Neural Families: A New Class of Tractable Density Models

Russell Tsuchida, Cheng Soon Ong, Dino Sejdinovic · DOI

Abstract

Probabilistic modeling often faces a trade-off between the flexibility of deep neural networks and the tractability of classical exponential families. We present Squared Neural Families (SNEFY), a novel class of density models defined by squaring a neural network. By leveraging mathematical identities from the theory of infinitely wide networks, SNEFYs achieve exact, closed-form normalizing constants across various activation functions. This paper demonstrates SNEFY's efficacy in density estimation, handling missing data through analytical marginalization, and modeling complex distributions on manifolds like spheres.

Introduction

In machine learning, a fundamental tension exists between model expressivity and computational tractability. While deep Energy-Based Models (EBMs) can represent complex data distributions, they are notoriously difficult to normalize, often requiring expensive Markov Chain Monte Carlo (MCMC) approximations. Conversely, traditional Exponential Families are easy to normalize but lack the capacity to model high-dimensional, non-linear data. Normalizing Flows offer a middle ground but impose strict architectural constraints, such as invertibility.

Researchers from CSIRO’s Data61 and the University of Adelaide have introduced Squared Neural Families (SNEFY) to bridge this gap. SNEFY leverages the representational power of neural networks while maintaining the exact tractability of classical statistics.

Methodology

The SNEFY framework defines a probability density $p(x)$ as proportional to the squared 2-norm of a single-hidden-layer neural network: $$p(x) \propto \|V \sigma(Wt(x) + b)\|_2^2$$ where $\sigma$ is an activation function, $V$ and $W$ are weight matrices, and $t(x)$ is a sufficient statistic. Crucially, $t(x)$ can be a deep feature extractor, allowing the model to inherit the benefits of deep representation learning.

Exact Normalization

The primary innovation of SNEFY is its closed-form normalizing constant $z$. The authors prove that $z$ can be computed via a trace operation: $$z = \text{Tr}(V^\top V K_\Theta)$$ where $K_\Theta$ is a Neural Network Kernel (NNK). This kernel represents the expectation of the product of two activations over the base measure. Unlike standard Gaussian Process limits that marginalize over weights, SNEFY marginalizes over the data space. The authors identify numerous "tractable settings"—specific combinations of activation functions and base measures—where this kernel is analytically computable.

Table 1: Examples of settings (activation functions, base measures, and statistics) that allow for closed-form normalization.

Key Properties

SNEFY models possess several unique mathematical advantages:

  • Non-negative Densities with Negative Weights: Because the network output is squared, the density is guaranteed non-negative even if mixture coefficients are negative. This allows for "subtractive" modeling of complex distribution patterns.
  • Closure Under Conditioning: The conditional distribution $p(x|y)$ of a joint SNEFY $p(x, y)$ remains a SNEFY, facilitating efficient conditional density estimation.
  • Analytical Marginals: SNEFYs allow for closed-form marginalization. This is particularly valuable for missing data tasks, where incomplete samples can be processed by integrating out missing dimensions analytically.

Experimental Results

The researchers evaluated SNEFY on synthetic 2D benchmarks, astronomical redshift estimation, and spherical galaxy distributions.

In 2D density estimation, SNEFY matched or exceeded the performance of state-of-the-art Normalizing Flows while maintaining a more compact parameter footprint. On the astronomy dataset, SNEFY outperformed Conditional Normalizing Flows and Kernel Density Estimation. A key highlight was the missing data experiment, where SNEFY’s ability to marginalize analytically led to superior log-likelihoods compared to models that required data imputation or deletion.

Visualizing SNEFY densities. Left: Samples from an untrained SNEFY. Right: A SNEFY trained on galaxy locations on a sphere.

Conclusion

SNEFY represents a significant step toward unifying deep learning flexibility with statistical tractability. While currently limited to single-hidden-layer architectures for the kernel calculation, future work exploring "stacked" SNEFY layers could further enhance expressivity. The framework's ability to handle complex manifolds and missing data makes it a robust tool for scientific and industrial probabilistic modeling.

Summary updated

BibTeX
@inproceedings{tsuchida2023squared,
  author = {Russell Tsuchida and Cheng Soon Ong and Dino Sejdinovic},
  title = {{Squared Neural Families: A New Class of Tractable Density Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=FDzQQTPqEJ},
}
Figure