The training method is very similar to Importance Weighted Autoencoders: https://arxiv.org/abs/1509.00519
IWAE: sample a bunch of latents, weight the loss of training the model using each one by softmax(-error). For images and text where the errors have large variance, those weights become one-hot, yielding this algorithm.