Neural Decomposition: Functional ANOVA with Variational Autoencoders

Kaspar Märtens, Christopher Yau

Abstract

Variational Autoencoders (VAEs) are powerful tools for finding low-dimensional patterns in high-dimensional data, but their "black-box" decoders often lack interpretability. We present Neural Decomposition (ND), a framework that structures the VAE decoder according to functional ANOVA principles. By decomposing the generative process into additive marginal effects and non-linear interactions between latent variables and observed covariates, ND provides a rigorous way to quantify sources of variation. To ensure identifiability, we enforce integral constraints using the Modified Differential Multiplier Method (MDMM). Our results across synthetic, image, and single-cell genomics datasets demonstrate that ND achieves high predictive performance while offering clear, statistically grounded insights into data structure.

Introduction

In many scientific applications, such as genomics or healthcare, the goal of modeling is not just prediction but understanding the underlying mechanisms. For instance, in single-cell RNA sequencing, researchers want to know how much a gene's expression is influenced by a cell's developmental state (a latent variable $z$) versus an external stimulus like a drug (a covariate $c$). Standard VAEs fail here because their decoders are unconstrained; the interaction between $z$ and $c$ can arbitrarily absorb the main effects, making the components uninterpretable.

Neural Decomposition (ND) addresses this by bringing the interpretability of classical functional ANOVA (fANOVA) to deep generative models. It allows for a principled disentanglement of effects, enabling scientists to ask: "What part of this observation is due to the latent factor, what part to the covariate, and what part to their specific interaction?"

The Neural Decomposition Framework

The core of ND is a structured decoder that represents the mapping from latent space and covariates to the data space as a sum of distinct neural networks: $$f(z, c) = f_0 + f_z(z) + f_c(c) + f_{zc}(z, c)$$ where $f_0$ is a global intercept, $f_z$ and $f_c$ represent marginal effects, and $f_{zc}$ captures the interaction.

Visualizing the decomposition of observed data into marginal effects and interactions.

To handle high-dimensional data where not every feature (e.g., every gene) is affected by every component, ND incorporates feature-level sparsity. Using Relaxed Bernoulli sparsity masks, the model can automatically learn which components of the decomposition are relevant for each output dimension. This architecture ensures that the model remains scalable while providing granular insights.

The ND architecture showing the flow from latent variables and covariates through sparsity masks to the identifiable decomposition.

Ensuring Identifiability via Constraints

A major challenge in functional decomposition is identifiability. Without constraints, the split between $f_z$, $f_c$, and $f_{zc}$ is non-unique. ND enforces integral constraints derived from fANOVA: $$\int f_{zc}(z, c) dz = 0 \quad \text{and} \quad \int f_{zc}(z, c) dc = 0$$ These constraints ensure that the interaction term only captures variation that cannot be explained by the simpler marginal terms.

Enforcing these constraints in a deep learning setting is non-trivial. Standard penalty methods often fail to satisfy constraints strictly or lead to unstable training. ND utilizes the Modified Differential Multiplier Method (MDMM), a Lagrangian-based optimization strategy that effectively balances the reconstruction loss with the requirement that the integral constraints "average out" to zero across the input space.

Experimental Evaluation

The authors validated ND on three distinct benchmarks:

  1. Synthetic Benchmarks: ND successfully recovered ground-truth variance components in scenarios where standard VAEs and linear models produced biased or unidentifiable results.
  2. Facial Attribute Disentanglement (CelebA): By treating attributes like "Smiling" or "Wearing Glasses" as covariates, ND demonstrated superior extrapolation. It could generate realistic images of rare attribute combinations (e.g., a "smiling man with glasses") more effectively than standard Conditional VAEs by isolating the additive effect of each attribute.
  3. Single-cell Genomics: In a study of mouse dendritic cells, ND identified specific genes where the response to a stimulus (LPS vs. PAM) depended heavily on the cell's progression state (pseudotime). This level of granular interaction analysis is difficult to achieve with traditional linear methods or unconstrained deep models.

Discussion and Conclusion

Neural Decomposition bridges the gap between the flexibility of deep learning and the interpretability of classical statistics. By imposing a functional ANOVA structure on the VAE decoder, it provides a scalable and identifiable way to decompose variance in high-dimensional data. While the method currently requires pre-specifying the interaction hierarchy and relies on approximate integral constraints, it represents a significant step toward "glass-box" generative modeling in the natural sciences. Future work may explore automated structure discovery and more efficient ways to enforce exact functional 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