Latent variable generative models are commonly fit using simple priors over latent variables, but draws from these priors often fail to produce realistic data. This failure is due to a mismatch between the prior and the aggregated posterior, the distribution of latent variables induced by the fitted model and the data. This mismatch is often viewed as evidence that the prior is misspecified and should be replaced. Alternatively, in modern generative models, a two-stage strategy is increasingly used where first, the model is fit, and second, the aggregated posterior is estimated (van den Oord et al.,2017; Rombach et al., 2022.). Synthetic data are then obtained by sampling from this aggregated posterior instead of the prior. To check such procedures, we introduce the aggregated posterior predictive check (APPC). Theoretically, we establish sufficient conditions under which the APPC is asymptotically calibrated. For probabilistic principal component analysis, we show that the APPC can remain calibrated under a misspecified latent prior when pervasive factors permit recovery of the signal space. Experiments with variational autoencoders show that aggregated posterior sampling improves generation for heavy-tailed and clustered data relative to Gaussian prior sampling while performing comparably to models with more flexible latent priors.
Figures & tables
pAPPC=R1r=1∑R1[d(X(r),rep)≥d(Xnew)];
Algorithm 1 Aggregated posterior predictive check
Figure 1: PPCA example. The empirical aggregated posterior predictive generates realistic samples in both well-specified and misspecified cases. The appc p -values are approximately uniform in both cases, unlike prior or conditional-replicate sampling. Top row: example draws of latent variables z (up to an invertible linear transformation). Bottom row: p -values from predictive checks over 500 trials. Kolmogorov-Smirnov tests of uniformity are in red.
Reference distribution Qm
Reference mean μmrep
Reference covariance Vmrep
P0Kθ⋆,post
B⋆μ0
Vmoracle=R⋆+B⋆Σ0B⋆
P0Kθm,post
Bmμ0
Vmlearn=Rm+BmΣ0Bm
Pagg,mKθm,post
Bmxmagg
Vmemp=Rm+BmΣagg,mBm
Table 1: PPCA reference distributions.
Figure 2: Bivariate t. Top: Draws of synthetic data Xrep . Bottom: p -values from model checks over 200 trials. G-EAP and G-DAP p -values are not uniform but have similar performance as more complex generative models. Here, Ntrain=Nagg=10000,Nnew=2000 .
Figure 3: Clustered t. Top: Draws of synthetic data Xrep . Bottom: p -values from model checks over 200 trials. G-EAP and G-DAP p -values are not uniform but show similar behavior to more complex generative models. Here, Ntrain=Nagg=10000,Nnew=2000 .
Figure 4: Financial. Top: Aggregated posterior with standard VAE (learnable variance, 1000 epochs) produces synthetic Xrep which visually capture the heavy-tailed behavior of financial data. Bottom: G-EAP p -values are approximately uniform. Here, Ntrain=Nagg=4000,Nnew=2000 .
Figure 5: MNIST. Top: G-EAP produces recognizable digits. Bottom: G-EAP p -values are approximately uniform. Here, Ntrain=Nagg=10000,Nnew=2000 .
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: PPCA example (fourth cumulant diagnostic). The appc is calibrated; the empirical aggregated posterior sampling strategy generates realistic samples in both well-specified and misspecified cases. Top row: example draws of latent variables z . Bottom row: p -values from predictive checks over 500 trials.
Figure 7: GMM. Top: Draws of data x . Aggregated posterior with standard VAE (learnable variance, 700 epochs) performs better compared to VAEs with true or mixture-based priors. Bottom: p -values from model checks over 200 trials. Here, Ntrain=Nagg=10000,Nnew=2000 .
Hyperparameter
Bivariate t2
Bivariate clustered t2
Bivariate Gaussian mixture
Financial
MNIST
Input Dimension
2
2
2
2
784
Latent Dimension
2
2
2
64
64
Hidden Dimension
128
128
128
128
400
Epochs
700
700
700
1000
350
Batch Size
256
256
256
64
256
Learning Rate
0.001
0.001
0.001
0.0001
0.0001
Appendix
Table 2: Hyperparameter settings of VAE for the datasets
Hyperparameter
Bivariate t2
Bivariate clustered t2
Bivariate Gaussian mixture
Financial
MNIST
T
100
100
100
100
100
Hidden Dimension
128
128
128
128
256
Epochs
700
500
700
300
200
Batch Size
256
256
256
128
256
Learning Rate
0.001
0.001
0.001
0.0001
0.0001
Appendix
Table 3: Hyperparameter settings of LDM for the datasets
College of Information and Computer Sciences, University of Massachusetts Amherst · Department of Statistics and Data Sciences, University of Texas, Austin