Abstract
We make inroads into understanding the robustness of Variational Autoencoders (VAEs) to adversarial attacks and other input perturbations. While previous work has developed algorithmic approaches to attacking and defending VAEs, there remains a lack of formalization for what it means for a VAE to be robust. To address this, we develop a novel criterion for robustness in probabilistic models: $r$-robustness. We then use this to construct the first theoretical results for the robustness of VAEs, deriving margins in the input space for which we can provide guarantees about the resulting reconstruction. Informally, we are able to define a region within which any perturbation will produce a reconstruction that is similar to the original reconstruction. To support our analysis, we show that VAEs trained using disentangling methods not only score well under our robustness metrics, but that the reasons for this can be interpreted through our theoretical results.
Introduction
Variational Autoencoders (VAEs) are fundamental to modern generative modeling, yet their robustness to adversarial perturbations has remained poorly understood. While empirical evidence suggests VAEs are more resilient than deterministic autoencoders, a formal theoretical framework for "probabilistic" robustness has been absent. This work bridges that gap by defining $r$-robustness and deriving certified margins of stability.
Defining Probabilistic Robustness
In deterministic classification, robustness is defined by label stability under input wiggling. For VAEs, which map inputs to latent distributions, this definition is insufficient. We introduce two core concepts:
- $r$-robustness: A model is $r$-robust if a perturbation is more likely to result in a reconstruction within a ball of radius $r$ around the original reconstruction than outside of it.
- Margin of Robustness ($R^r_X(x)$): This represents the maximum radius in the input space within which any perturbation is guaranteed to satisfy $r$-robustness.
Theoretical Foundations
The central theoretical contribution, Theorem 1, provides a bound for the margin of robustness. The analysis reveals that a VAE's resilience is driven by two primary factors:
- Encoder Variance: Higher variance provides a "noise buffer" against targeted latent shifts.
- Encoder Jacobian: A smaller Frobenius norm of the Jacobian indicates a "flatter" mapping, making it harder for small input changes to cause large latent displacements.
This relationship explains why disentangling methods like the $\beta$-VAE, which naturally encourage high variance and penalize the Jacobian norm, result in more robust models.
Experimental Results and Visual Stability
Validation across MNIST, Fashion-MNIST, and CIFAR10 benchmarks shows a high correlation ($\rho \approx 0.84-0.88$) between the theoretical margin and observed numerical robustness.
As shown in the figure above, models with higher theoretical margins ($R^r_X(x)$) exhibit significantly greater visual stability. For instance, a robust model might maintain the shape of a "4" under attack, whereas a non-robust model's reconstruction might morph into a different digit or become unrecognizable.
Discussion and Future Work
While this framework provides the first certified guarantees for VAEs, limitations remain. The current theory relies on a linearization of the encoder, which may be less accurate in highly non-linear regions. Furthermore, there is an inherent trade-off: increasing robustness through higher $\beta$ can lead to blurrier reconstructions. Future work will explore extending these results to non-Gaussian encoders and refining the balance between utility and security.
Summary updated