Bayesian deep learning promises a solution to the overconfidence of standard neural networks by treating weights as probability distributions. However, performing inference in these models is notoriously difficult. A primary reason for this difficulty is symmetry: if you swap two neurons in a hidden layer and adjust the surrounding weights, the function the network computes remains identical.
While these symmetries seem like a mathematical curiosity, they create a nightmare for Variational Inference (VI). Recent research suggests that by shifting our perspective from learning individual features to learning the relationships between data points—the Gram matrix—we can bypass these symmetries entirely.
The Failure of Feature-Space Inference
In a standard Bayesian Neural Network (BNN) or Deep Gaussian Process (DGP), we typically try to approximate the posterior distribution of weights or hidden features. However, as Yoav Gelberg, Mark van der Wilk, and colleagues demonstrate in Variational Inference Failures Under Model Symmetries, the posterior in these models is highly multimodal. Because of permutation symmetry (swapping neurons), there are $H!$ equivalent peaks in the posterior for a layer with $H$ units.
Standard VI usually employs a simple, unimodal distribution (like a Gaussian) to approximate this complex landscape. When faced with many equivalent peaks, the optimizer often tries to "stretch" the Gaussian to cover multiple modes or collapses into a single one, leading to a poor fit and underestimation of uncertainty. As networks get wider, these peaks become more numerous and closer together, exacerbating the failure.
Collapsing Symmetries via Gram Matrices
The key insight of Deep Kernel Processes (DKPs), introduced by Laurence Aitchison, Sebastian W. Ober, and Adam X. Yang, is to perform inference in a representation that is naturally invariant to these symmetries.
Instead of propagating feature vectors $H$ through the layers, DKPs propagate the Gram matrix $K = HH^T$, which represents the pairwise similarities between all data points in a batch.
- Rotation Invariance: If you rotate the features $H$, the Gram matrix $K$ remains unchanged.
- Permutation Invariance: If you permute the hidden units (the columns of $H$), $K$ remains unchanged.
By defining the model directly in terms of these matrices, the complex, multi-peaked posterior in "feature-space" collapses into a much simpler, often unimodal posterior in "kernel-space." In Deep kernel processes (icml 2021), the authors show that this simplification allows variational inference to achieve a significantly higher Evidence Lower Bound (ELBO), meaning the approximation is much closer to the true posterior.
The Deep Wishart Process
To make this kernel-centric view work, we need a way to define a "prior" over these Gram matrices. The natural choice for a distribution over positive semi-definite matrices is the Wishart distribution.
In A variational approximate posterior for the deep Wishart process, Sebastian W. Ober and Laurence Aitchison develop the Deep Wishart Process (DWP). They prove that a DWP is exactly equivalent to a Deep Gaussian Process, but it operates entirely without explicit features.
To perform inference, they introduce the Generalised Singular Wishart distribution. This allows them to maintain a "feature-free" pipeline where each layer transforms the previous layer's Gram matrix. This approach sidesteps the "multi-modal symmetry problem" because the model never has to decide which neuron is which; it only cares about how the relationships between data points evolve through the hierarchy.
Symmetrizing the Posterior
While DKPs change the model structure to avoid symmetry, an alternative approach is to change the variational distribution to respect it. In Variational Inference Failures Under Model Symmetries, Yoav Gelberg and Yarin Gal propose "baking in" permutation invariance.
Instead of a single Gaussian, they use a symmetrized posterior—effectively an average of a base distribution over all possible permutations of the neurons. This creates a symmetric mixture model that can capture all equivalent peaks simultaneously. This ensures that the variational approximation is strictly better than a non-invariant one, providing a more stable and accurate estimate of the model's true uncertainty.
Why It Works: Intuition
The transition from feature-based models to kernel-based processes (like the Deep Inverse Wishart Process) works because it removes redundancy. In a standard neural network, the specific index of a neuron (e.g., "Neuron 5") carries no meaning; only the collective representation matters.
By performing inference on Gram matrices, we are essentially saying: "I don't care which specific neurons are firing; I only care how similar Image A and Image B look to this layer." As Sebastian W. Ober notes in Towards Improved Variational Inference for Deep Bayesian Models, this shift from "unit activations" to "data relationships" eliminates the optimization hurdles caused by architectural symmetries, leading to models that are not only more mathematically sound but also more performant in practice.