Neural Decomposition: Functional ANOVA with Variational Autoencoders

Kaspar Märtens, Christopher Yau

TL;DR

Neural Decomposition (ND) brings the interpretability of classical statistical models to the power of Variational Autoencoders (VAEs). By integrating functional ANOVA into the VAE decoder and enforcing mathematical identifiability constraints during training, the authors allow researchers to disentangle how latent factors and known covariates independently and jointly drive variation in high-dimensional data.

What Problem Does This Paper Address?

Variational Autoencoders (VAEs) are a staple for dimensionality reduction, especially in fields like genomics where we want to map thousands of gene expressions into a simple latent space ($z$). However, VAE decoders are typically "black boxes." If you add a known covariate ($c$), like a drug treatment, to a Conditional VAE (CVAE), the model can become even harder to interpret.

We often want to know: Is a specific gene's variation caused by the latent biological process ($z$), the treatment ($c$), or a complex interaction between the two? Standard CVAEs can't answer this because the decoder can "absorb" variation into any of its components arbitrarily. This lack of identifiability makes it impossible to trust a feature-level variance decomposition.

Methods

The authors propose Neural Decomposition, which replaces the standard black-box decoder with a structured, additive one: $$f(z, c) = f_0 + f_z(z) + f_c(c) + f_{zc}(z, c)$$ Here, $f_z$ and $f_c$ represent marginal additive effects, and $f_{zc}$ captures non-linear interactions.

To make this structure meaningful, the authors enforce functional ANOVA constraints. Specifically, they require the integrals of the sub-networks to be zero over their respective domains (e.g., $\int f_z(z) dz = 0$). This ensures that the functional subspaces do not overlap—$f_{zc}$ cannot "steal" variation that should be explained by the simpler $f_z$ or $f_c$ terms.

Training under these constraints is difficult for standard optimizers like Adam. The authors utilize the Modified Differential Multiplier Method (MDMM), a hybrid approach that combines penalty terms with Lagrange-like multipliers. As shown in Figure 2, this method leads to much faster and more stable convergence to the required zero-integral state compared to simple penalty methods.

Comparison of optimization strategies for enforcing integral constraints. MDMM (C) converges to zero integral values significantly faster than the basic penalty method (A) or the oscillating BDMM (B).

To further aid interpretability, they introduce Sparse Neural Decomposition using Bernoulli masks (implemented via the Gumbel-Softmax trick) to automatically detect which genes are actually affected by which components (see Figure 3).

The Neural Decomposition architecture, showing how latent variables and covariates pass through separate decoder networks, which are then combined with sparsity masks to reconstruct the observed data.

Datasets

The model was evaluated on:

  • Synthetic Data: Designed to mimic gene expression patterns with both linear and non-linear dependencies.
  • CelebA: A large-scale dataset of facial images. The authors used this to test pixel-level decomposition and extrapolation to unseen subgroups (e.g., "smiling men" when none were in the training set).
  • Single-cell RNA-seq (scRNA-seq): Real-world data from mouse dendritic cells responding to different bacterial stimuli (LPS and PAM).

Key Insights and Ideas

  • Identifiability is the Linchpin: You cannot simply add networks together and expect them to represent independent effects. Mathematical constraints are required to define the "territory" of each network.
  • Improved Extrapolation: Because ND separates the effects of $z$ and $c$, it generalizes better to unseen combinations. In the CelebA experiment, ND produced much clearer images of "smiling men" than a standard CVAE because it could combine the learned "smiling" effect with the "male" effect independently (Figure 6).
  • Scalability over Gaussian Processes: While similar decompositions can be done with Gaussian Processes (GPs), ND is significantly more scalable to high-dimensional data in terms of both compute time and memory.
ND produces clearer reconstructions for unseen subgroups (like smiling men) compared to standard CVAE by leveraging its additive structure.

Key Results

  • Synthetic Accuracy: ND correctly identified the true variance components where linear models and unconstrained neural networks failed.
  • CelebA Performance: ND achieved a higher log-likelihood on held-out images of smiling men (-2497 ± 319) compared to a standard CVAE (-3181 ± 630).
  • Biological Discovery: On the scRNA-seq data, ND successfully decomposed gene variation into pseudotime (latent progression), stimulus type, and their interactions. It confirmed findings from previous linear studies while providing a more flexible, non-linear framework that is more robust to model misspecification.

Limitations and Future Work

The authors note that while the functional decomposition is identifiable for fixed inputs, the entire VAE model (including the latent space $z$) is not fully identifiable without further restrictions, such as monotonicity constraints. Additionally, while MDMM is effective, it introduces extra hyperparameters (penalty weights and learning rates for multipliers) that require careful tuning. Future work could explore more automated ways to balance these constraints.

Summary updated

BibTeX
@inproceedings{martens2020neural,
  author = {Kaspar Märtens and Christopher Yau},
  title = {{Neural Decomposition: Functional ANOVA with Variational Autoencoders}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2020},
}
Figure