[Paper Review] Adversarial Distillation of Bayesian Neural Network Posteriors
This paper introduces Adversarial Posterior Distillation (APD), a method that uses a Generative Adversarial Network (GAN) to distill the posterior samples from Stochastic Gradient Langevin Dynamics (SGLD) in Bayesian Neural Networks (BNNs). The GAN generator learns to produce high-quality posterior samples, enabling efficient test-time inference with minimal storage overhead while preserving performance on uncertainty-sensitive tasks such as anomaly detection, active learning, and adversarial defense.
Bayesian neural networks (BNNs) allow us to reason about uncertainty in a principled way. Stochastic Gradient Langevin Dynamics (SGLD) enables efficient BNN learning by drawing samples from the BNN posterior using mini-batches. However, SGLD and its extensions require storage of many copies of the model parameters, a potentially prohibitive cost, especially for large neural networks. We propose a framework, Adversarial Posterior Distillation, to distill the SGLD samples using a Generative Adversarial Network (GAN). At test-time, samples are generated by the GAN. We show that this distillation framework incurs no loss in performance on recent BNN applications including anomaly detection, active learning, and defense against adversarial attacks. By construction, our framework not only distills the Bayesian predictive distribution, but the posterior itself. This allows one to compute quantities such as the approximate model variance, which is useful in downstream tasks. To our knowledge, these are the first results applying MCMC-based BNNs to the aforementioned downstream applications.
Motivation & Objective
- Address the high storage cost of maintaining multiple SGLD samples in Bayesian neural networks (BNNs), which limits scalability for large models.
- Enable efficient, parameterized posterior approximation at test time without sacrificing uncertainty estimation quality.
- Demonstrate that MCMC-based BNNs, particularly SGLD, can outperform simpler methods like MC dropout in uncertainty-sensitive applications.
- Show that GAN-based distillation preserves the full posterior structure, including model variance, which is critical for downstream tasks.
- Establish a practical framework for deploying MCMC-based BNNs in real-world applications where uncertainty quantification is essential.
Proposed method
- Use Stochastic Gradient Langevin Dynamics (SGLD) to generate a set of posterior samples over model parameters, representing the true posterior distribution.
- Train a Generative Adversarial Network (GAN) where the generator learns to produce samples that match the distribution of SGLD posterior samples.
- The discriminator distinguishes between real SGLD samples and generated samples, while the generator is optimized to fool the discriminator.
- Employ WGAN-GP with gradient penalty to stabilize training and improve sample quality, ensuring better posterior approximation.
- At test time, generate samples from the trained GAN generator instead of storing SGLD samples, drastically reducing memory usage.
- Use the distilled GAN samples to compute uncertainty measures such as entropy and BALD, enabling downstream tasks like anomaly detection and active learning.
Experimental results
Research questions
- RQ1Can a GAN effectively distill the posterior distribution of a Bayesian neural network obtained via SGLD, preserving its uncertainty characteristics?
- RQ2Does the distilled posterior from a GAN achieve performance comparable to SGLD samples on uncertainty-sensitive tasks such as anomaly detection and adversarial defense?
- RQ3How does the performance of GAN-based distillation compare to simpler approximations like a Mixture of Gaussians (MoG) in terms of accuracy and storage efficiency?
- RQ4Can GAN-based posterior distillation maintain high-quality uncertainty estimates while reducing storage costs compared to storing SGLD samples?
- RQ5What training formulation (e.g., original GAN, WGAN, WGAN-GP) yields the most stable and effective posterior distillation for BNNs?
Key findings
- APD retains 99.8% of the performance of SGLD samples on the notMNIST OOD anomaly detection task, outperforming a 60-component MoG (99.3%) with significantly fewer parameters (1.67M vs. 9.54M).
- The performance of APD improves with more generated samples and reaches the performance of 50 SGLD samples with only 20 generated samples, achieving 2.5x storage savings.
- WGAN-GP with gradient penalty converges faster and exhibits fewer training oscillations than original GAN or WGAN with weight clipping, leading to more stable posterior distillation.
- A single-component Mixture of Gaussians (MoG) performs poorly on anomaly detection, indicating that the SGLD posterior is multimodal and cannot be captured by simple factorized approximations.
- APD enables full posterior access at test time, allowing computation of model variance and other uncertainty metrics, which are essential for active learning and adversarial robustness.
- The framework demonstrates that MCMC-based BNNs, previously avoided due to storage costs, can be practically deployed using adversarial distillation, outperforming simpler methods like MC dropout in key applications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.