In the world of unsupervised learning, we often try to find the "hidden strings" (latent variables) that pull the levers of the data we actually see. While Deep Generative Models (DGMs) like Variational Autoencoders (VAEs) are incredibly flexible, they often struggle with a fundamental probabilistic quirk: explaining away.
A new paper from researchers at UCL and the Gatsby Unit, titled "Structured Recognition for Generative Models with Explaining Away," introduces a framework to fix this, specifically for models where observations depend on multiple hidden factors at once.
The Problem: Ignoring "Explaining Away"
Imagine you see a wet sidewalk. It could be because it rained, or because a sprinkler turned on. If you find out it actually rained, your belief that the sprinkler was on decreases—this is "explaining away." Even if the rain and the sprinkler are independent a priori, the observation couples them in the posterior distribution.
Standard VAEs often ignore this phenomenon. They typically use "mean-field" approximations, assuming latent variables remain independent even after seeing the data. While the Structured VAE (SVAE) improved this by adding structured priors, it still used "singleton" recognition factors. This means the neural network looking at the data couldn't express how different latents should be coupled together. This gap leads to sub-optimal learning, especially in high-dimensional fields like neuroscience where many neurons might fire based on a shared set of overlapping latent signals (like position, speed, and head direction).
The Method: Structured Recognition VAE
To address this, the authors propose the Structured Recognition VAE (SRVAE).
- Structured Potentials: Instead of the recognition network outputting independent parameters for each latent variable, the SRVAE outputs joint factor potentials. These potentials are designed to be conjugate to the prior, allowing the model to use efficient Variational Message Passing (VMP) to compute the full posterior.
- SR-nlGPFA: The authors apply this to a non-linear version of Gaussian Process Factor Analysis (nlGPFA). They use a Deep Generative Model as a "link function" to handle complex data (like neural spikes) but maintain an affine (linear) mapping layer.
- The "Trick": By recasting the recognition network to output likelihoods for the intermediate embeddings rather than the final latent GPs, they allow the model to capture inter-latent correlations through the mixing coefficients of the affine map. This results in a full-covariance Gaussian approximation that is computationally scalable.
Mathematically, the authors prove that the SRVAE objective provides a tighter lower bound on the log-likelihood than the standard SVAE. In machine learning terms, a tighter bound usually translates to a better-performing model.
Key Results across Diverse Datasets
The researchers evaluated their framework on four distinct types of data: a synthetic 2D Pinwheel clustering task, synthetic GPFA data, real-world EEG voltage readings, and high-dimensional population neuronal spiking from rat hippocampi.
- Superior Reconstruction: On the Pinwheel and EEG datasets, SRVAE consistently achieved lower Standardized Mean Squared Error (SMSE) and better Negative Log-Likelihood (NLL) than "Vanilla" VAEs and standard SVAEs. The model's recognition network respects the same structural constraints as the generative model, allowing it to truly understand the data.
- Unsupervised Discovery of Behavior: Perhaps most impressively, the model was able to look at raw neural spikes—without any information about where the rat was or how fast it was moving—and "discover" latent signals that mapped almost perfectly to the rat's position, speed, and head direction.
- Neural Disentanglement: In the hippocampal data, the SR-nlGPFA model successfully disentangled spatial location from the direction of movement. While previous models produced "noisy" latent trajectories, the SRVAE produced smooth, interpretable signals that aligned with the animal's actual behavior. It even identified specific neurons as "direction-modulated" with high accuracy, proving it can identify functional properties of cells in a purely unsupervised way.
Limitations and Future Work
While powerful, the framework has limitations. Training the SR-nlGPFA required processing data in short batches, making latent estimates less naturally continuous at batch boundaries (though mitigated with sparse GP inference). A more integrated approach for long-form time series would be ideal.
Looking ahead, the authors suggest this framework could be extended to other latent models like GP-LVM and could be used to fuse different types of data (e.g., combining EEG with calcium imaging) to uncover even deeper structures in complex biological systems.
Summary updated