Learning Energy-Based Prior Model with Diffusion-Amortized MCMC

Latent space Energy-Based Models (EBMs), also known as energy-based priors, have drawn growing interests in the field of generative modeling due to its flexibility in the formulation and strong modeling power of the latent space. However, the common practice of learning latent space EBMs with non-convergent short-run MCMC for prior and posterior sampling is hindering the model from further progress; the degenerate MCMC sampling quality in practice often leads to degraded generation quality and instability in training, especially with highly multi-modal and/or high-dimensional target distributions. To remedy this sampling issue, in this paper we introduce a simple but effective diffusion-based amortization method for long-run MCMC sampling and develop a novel learning algorithm for the latent space EBM based on it. We provide theoretical evidence that the learned amortization of MCMC is a valid long-run MCMC sampler. Experiments on several image modeling benchmark datasets demonstrate the superior performance of our method compared with strong counterparts

Paper

References (82)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer rkuE3/10 · confidence 2/52023-07-06

Summary

The paper presents a new training and sampling procedures for learning energy based generative models. The method is compared to earlier (few-step) MCMC based approaches and to diffusion models. The procedure is evaluated on computer vision tasks.

Strengths

The paper presents an original algorithm, with a clear methodological description, and a large collection of benchmarking results.

Weaknesses

The paper could make clearer for the general audience why additional energy based modeling methodology is needed. As a researcher who has been working extensively on diffusion models for the past two years, but has not worked with (other) energy based models in approaches in recent years additional context in goals of this direction and the limitations of previous approaches would be helpful. For example, the authors comment that EBMs are "closely related to" DDPMs. Which do not suffer from the "sampling issue" associated with "non-convergent short-run MCMC" used for EBMs. Is there something that can be accomplished with EBMs that is not solved by DDPMs that motivates their continued study? The paper is also unclear with respect to the claim for "theoretical evidence that the learned amortization of MCMC is a valid long-run MCMC sampler". Could the authors make this theoretical claim more explicit (e.g. as a proposition or theorem)?

Questions

No further questions.

Rating

3: Reject: For instance, a paper with technical flaws, weak evaluation, inadequate reproducibility and incompletely addressed ethical considerations.

Confidence

2: You are willing to defend your assessment, but it is quite likely that you did not understand the central parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

2 fair

Contribution

2 fair

Limitations

Limitations are adequately addressed.

Reviewer hz9t4/10 · confidence 4/52023-07-07

Summary

This paper proposes the DAMC sampler (Diffusion-Amortized MCMC) and develops a new learning algorithm for LEBM (Latent-space Energy-Based Model) based on it. Theoretical and empirical evidences are provided for the effectiveness of our method.

Strengths

The paper is generally well-written. The idea of amortizing the LD with DDPM in learning the LEBM seems to be new.

Weaknesses

The basic idea of using an auxiliary model to amortize the LD in learning energy-based models has been well known and explored in the literatures, e.g. in [a,b] to name a few. Methodology connection and experiment comparison with those methods are needed. By looking at FID on CIFAR-10 (Table 1), the performance of the proposed method (FID 57.72) is far behind previous methods [a,b] (33.61, 20.9). In the current literature, long-run MCMC analysis is typically conducted over a range of 10,000 to 100,000 Langevian Dynamics iterations. However, in this paper (Figure 4), the authors perform a much shorter 2,500 Langevian dynamics update, which is considerably less extensive compared to other studies in the field. [a] Cooperative Training of Descriptor and Generator Networks, arXiv:1609.09408v3 [b] Learning Neural Random Fields with Inclusive Auxiliary Generators, arXiv:1806.00271v4

Questions

see above.

Rating

4: Borderline reject: Technically solid paper where reasons to reject, e.g., limited evaluation, outweigh reasons to accept, e.g., good evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

see above.

Reviewer NcyD8/10 · confidence 3/52023-07-13

Summary

The authors propose DAMC, an amortization of MCMC sampling, via a scheme based on diffusion models, as an alternative to pure MCMC sampling, which usually suffers from either long mixing time or from being short and biased,for priors and posteriors in energy based models. The method is theoretically sound, and experimentally argued for.

Strengths

The theoretical analysis is sound. The algorithm is clear. The experiments are convincing.

Weaknesses

N/A

Questions

Are there some constraints that the latent space needs to satisfy for the proposed method to have an advantage over the vanilla MCMC counterpart ?

Rating

8: Strong Accept: Technically strong paper, with novel ideas, excellent impact on at least one area, or high-to-excellent impact on multiple areas, with excellent evaluation, resources, and reproducibility, and no unaddressed ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

4 excellent

Presentation

4 excellent

Contribution

4 excellent

Limitations

I see None for now.

Reviewer ga256/10 · confidence 3/52023-07-16

Summary

This paper proposed a diffusion-based amortised method to address the short-run MCMC samplers issues in the latent-space energy-based models. One interesting part is that it interleaves the distill T-steps of Langevin dynamics and KL divergence minimisation to sample from the target distribution $\pi$. Regarding the choice of amortised sampler parameters $\phi$, it uses the gradient of DDPM objective function to optimise them. The experimental results has verified the effectiveness of the DAMC.

Strengths

The paper has the following strengths: **1**, the usages of KL minimization and amortised MCMC transition is a well defined framework. Also, the usages of DDPM gradient for the long-run MCMC sampling in LEBMs is interesting. **2**, the experimental evaluation is sufficient and clearly verifies the advantages of DAMC.

Weaknesses

Regarding the weakness, I think the paper may need another round of polish. Some notations are not well defined before use and some introductory statement is not consistent. For example: **1**, p_{uncond} may need more explanation, rather than a short word in the input of Algorithm. **2**, $z_+^{(i)}, z_-^{(i)}$ are a bit confusing. **3**, it may be a better idea if the notations of section 2.1 and 2.2 are consistent

Questions

Sorry I am not an expert in this topic. I do not have questions for the authors.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

2 fair

Contribution

3 good

Limitations

I believe the authors has addressed the limitations.

Reviewer x1ko6/10 · confidence 3/52023-07-16

Summary

The paper proposes a diffusion-based amortized MCMC method for sampling the prior and posterior in latent space energy-based models. The paper provides some theoretical evidence using directly the result from Li et al., 2017. The paper shows the effectiveness of the proposed method throughout an extensive campaign on a variety of tasks such as image generation and construction, anomaly detection.

Strengths

- This paper aims at tackling an important task in deep latent variable models, which is to improve energy-based prior model. - The paper is well-motivated and is well-written. - The experiments on image datasets are extensive and diverse.

Weaknesses

- The idea of amortizing the short-run MCMC sampling of the prior and posterior distributions is already proposed in the original work of Pang et al., 2020. This paper aims to improve this amortization using a diffusion model. In addition, the theoretical contribution is weak, as the convergence property is already shown by Li et al., 2017. - Although the authors claim that the theoretical evidence that the learned amortization of MCMC is a valid long-run MCMC sampler, this result is taken directly from Li et al., 2017. As such, the authors should show that the proposed amortization scheme can converge to the true distributions, at least via toy examples. For example, the authors could use examples from this work [1]. - The improvement is expectable as the authors use a very powerful diffusion model to amortize the prior and posterior. However, this increases the computational costs, as the authors discussed at the end of Section 4.1. - As, again, the authors employ a power diffusion model in latent space. To be fair, the authors should consider the baselines of using diffusion models in the latent space of latent variable models; for example [2], at the very least. [1] Taniguchi et al., Langevin Autoencoders for Learning Deep Latent Variable Models. NeurIPS 2022. [2] Pandey et al., DiffuseVAE: Efficient, Controllable and High-Fidelity Generation from Low-Dimensional Latents. TMLR 2022.

Questions

- There are a lot of hyper-parameters in the proposed methods. How do the authors choose $T$? - It would be great if the authors could ablate the amortization gap of the proposed method by considering different capacities of the $q_{\phi}$

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

Yes

Reviewer x1ko2023-08-10

Post Rebuttal Reply

I thank the authors for their response and the effort they put in resolving my concerns. The new results are very encouraging. Might I kindly ask the authors to provide the code for toy examples? This would enable both me and other reviewers can quickly validate the proposed method and the results.

Authorsrebuttal2023-08-11

Anonymous Code Submission

We thank the reviewer for your prompt reply! We are pleased to hear that our new results are very encouraging. We have asked our AC for details about anonymous code submission, since we are only allowed to submit the code link to AC according to the instructions this year. We have prepared the code and will submit the link immediately once permitted. Here we provide more details about our code submission to help you reproduce and validate our results. - Environment Specification - We use Pytorch to train our models. We did not use other third-party python packages for implementation. Please feel free to let us know if there are any dependency issues. We will be more than happy to help. - Version of packages used in the toy example experiments: - Python == 3.9.2 - Pytorch == 1.10.0 - numpy == 1.21.2 - matplotlib == 3.3.4 - Code Structure We have added comments to most functions and code blocks in our code. The code files should have the following structure: ``` toy_code/ src/ diffusion_helper_func.py diffusion_net.py toy_example.py ``` - `toy_example.py`is the main file. It includes the training algorithm, data generation pipeline and visualization functions. - `src/diffusion_net.py` contains the detailed network structure of the diffusion network. - `src/diffusion_helper_func.py` contains helper function for implementing the denoising diffusion process. - How to Run To train the model on the toy example, you can simply run the following command in the `toy_example` folder. ``` CUDA_VISIBLE_DEVICES=<DEVICE_ID> python toy_example.py --seed <RANDOM_SEED_TO_SPECIFY> ``` For example, ``` CUDA_VISIBLE_DEVICES=0 python toy_example.py --seed 0 ``` - Here `--seed` argument specifies the random seed, which basically decides the ground-truth posterior distribution. The script will automatically generate a `logs/toy/<TIMESTAMP>` folder in the `toy_code` folder, where `<TIMESTAMP>` indicates the time you started this training process. - There will be two automatically created additional folders in `logs/toy/<TIMESTAMP>` once running the script: i) `ckpt` which saves the trained weights and ii) `viz` folder that saves the visualization of ground-truth and learned posterior distributions. The image file names are `<ITERATION>_lang_post_Q` and `<ITERATION>_lang_post_gt`, which indicates visualization of the learned distribution and the ground-truth distribution respectively. These visualization results are saved every 100 iterations. - Important Tips about Training - For most random seeds, we observed that our learned sampler could achieve decent approximation of the ground-truth posterior distributions obtained by long-run langevin dynamics within 300-3000 training iterations. This would take from several minutes to an hour or so on a NVIDIA RTX A6000 GPU. The training process takes ~2GB GPU memory. It is possible that there are some extreme cases where longer training iterations are needed to produce decent results. - For some random seeds, the default 1000-step langevin dynamics for sampling ground-truth posterior distribution might not converge. You may consider using 2000 or more steps by modifying the `g_l_steps` argument in the `sample_langevin_post_z` function at L277 in the `toy_example.py`. One possible sign is that the `g_loss (avg) Q` (reconstruction error obtained by learned posterior samples) is significantly lower than `g_loss (avg) L` (reconstruction error obtained by langevin dynamics samples). Finally, we kindly ask the reviewer to not distribute our code, since we have not officially published our work. Thank you again for your time for evaluating our work, please feel free to let us know if you have any additional questions/comments/concerns.

Authorsrebuttal2023-08-12

Anonymous Code Submitted

Thank you for your patience. We have submitted the anonymous code for reproducing the results for the toy example to our AC. Please feel free to let us know if you have any problems with the code.

Reviewer x1ko2023-08-17

Response from Reviewer x1ko

Thank the authors for providing the code. > For some random seeds, the default 1000-step langevin dynamics for sampling ground-truth posterior distribution might not converge. You may consider using 2000 or more steps by modifying the g_l_steps argument in the sample_langevin_post_z function at L277 in the toy_example.py. One possible sign is that the g_loss (avg) Q (reconstruction error obtained by learned posterior samples) is significantly lower than g_loss (avg) L (reconstruction error obtained by langevin dynamics samples). I encourage the authors to discuss the sensitivity of hyperparameters such as this in the paper. I've checked the code. While I could not achieve near-perfect approximations of the target distributions as presented in the rebuttal, the approximations I obtained are acceptable. If the authors cherry-picked results, I encourage the authors to showcase not only favorable outcomes but also include instances that demonstrate less favorable results. I strongly recommend the authors incorporate the new results in the rebuttal into the next version of the paper as I believe they will strengthen the paper. In light of the new results and the responses from the authors, I will increase my score to 6.

Authorsrebuttal2023-08-20

Thank you!

Thank you for your kind response and constructive feedback! For the toy example, we believe it is largely because of the steps of Langevin dynamics for sampling the ground-truth posterior distribution mentioned in our previous response. We will add more explicit illustrations in the revision of our paper for clearer guidance for obtaining our results. We would like to thank the reviewer again for the detailed and thoughtful comments. We will make sure to add these new results to the next version of this paper to further improve the quality of this work.

Reviewer rkuE2023-08-11

Thank you and follow-up question

Thank you for your replies. To follow-up on your question, in the context of your paper is a DDPM an example of an energy based model once (re-)parameterized in terms of its implied approximation to the gradient of log-densities? If so statement (w.r.t. reference [1] above) this seems to be more of a statement about what parameterization of diffusion models than energy based models as a distinct class of models. As the motivation for why this class of models is considered and how it might hope to address limitations of existing diffusion base generative models remains unclear to me, I maintain my score and low-confidence.

Authorsrebuttal2023-08-12

Thanks for your reply

Thank you for your prompt response. We would like to point out that although DDPM estimates the gradient of the log density of *noise-perturbed versions of the target density*, this gradient estimate **does not** translate to reliable estimate of the *target density (without noise)* via re-parametrization. For a given noise level $\sigma > 0$, the denoising score matching or DDPM objective is not a consistent objective for learning the underlying target density without noise. Annealing the noise level $\sigma \to 0$ can mitigate this problem, but the gradient estimation is only reliable in the immediate vicinity of the modes of the target distribution, where the density is high. For low-density regions of the target distribution, the objective may not have enough evidence to estimate score functions accurately, due to the lack of samples [1]. In contrast, EBM is typically learned through Maximum Likelihood Estimation, which theoretically is the most accurate estimate in terms of asymptotic variance [2]. This formulation together with its learning algorithm produces much more reliable explicit (unnormalized) density estimation. From this point of view, these two models are different. In our previous response, we discussed the importance of energy-based modeling, i.e., learning the density of target distribution explicitly. We hope the key differences between EBM and DDPM mentioned above in this response further clarifies the necessity of learning the explicit density of the target distribution. Specifically in the set-up of our submission, we care about modeling the latent space. The latent space EBM provides explicit prior probability density $p_\alpha(z)$ for modeling latent variables $z$, and consequently defines explicit posterior density $p_\theta(z|x) \propto p_\alpha(z)p_\beta(x|z)$ for posterior inference upon which we build our approximate MLE learning algorithm. Simply plugging a DDPM into the latent space does not provide us with this well-defined MLE learning framework and could lead to problematic learning algorithms. Finally, we would like to kindly refer to [3] for a comprehensive discussion about EBM and its connection with DDPM. We hope our response helps to address your concerns and explains why latent space EBM is considered in this work. Please feel free to let us know if you have any additional questions/comments/concerns. [1] Yang Song, and Stefano Ermon. Generative Modeling by Estimating Gradients of the Data Distribution. NeurIPS 2019. [2] Peter J. Bickel and Kjell A. Doksum, Mathematical Statistics: Basic Ideas and Selected Topics, Volume I. [3] Yang Song and Diederik P. Kingma. How to Train Your Energy-Based Models, arXiv:2101.03288

Reviewer rkuE2023-08-16

Thank you for your reply.

I appreciate the replies but remain uncertain in my assessment. Thank you.

Reviewer hz9t2023-08-17

Concern about the insufficiency of experimental results remains

--after reading feedback-- Thanks for the feedback from the authors. The new result from long-run MCMC seems good. Learning the energy-based model in the latent space may require more delicate design than learning in the pixel space. But the basic math required is not so innovative. The authors refer their architectures to previous works [d,e], and I can see that the network architectures used in this work are weaker than those used in [a,b]. However, remarkably, the results in [a,b] dates back to 2016-2018. If the results in 2023 cannot show improvements over these classic ones, I'm not convinced that the claimed effectiveness of the new method in this work makes a real progress in learning EBMs. One may doubt whether the proposed method can work or not when using a deeper architecture. My main concern about the insufficiency of experimental results remains. I suggest that the authors show results using a bit deeper advanced network, which is not difficult for experiments. I think, such comparison would be really beneficial for the community to advance the EBM study.

Authorsrebuttal2023-08-20

Thank you for your reply

Thank you for your further response. We provide point-to-point replies below. - > If the results in 2023 cannot show improvements over these classic ones, the proposed method might not make a real progress in learning EBMs. We respectfully disagree with this statement for the following reasons. - **The proposed method and the mentioned previous methods work for different models in completely different set-ups.** We would like to continue our discussion in our previous response to further clarify that these methods are essentially different. As mentioned in sec. 1 L16-28 in the main text, we specifically consider *learning an EBM in the latent space for latent variables $z$ (LEBM) as an informative prior* for the generator network in this work. Although our focus is also on learning an EBM, the LEBM stands on the generator to capture the regularity of its latent variables $z$, while the main generation process is done by the generator network $g$. The learning process is built upon the posterior inference of $z$ to formulate an EM-like approximate MLE learning algorithm. In this formulation, the generator is directly supervised by the reconstruction error of the observed data $x$. In contrast, in the set-up of [a,b], the EBM resides explicitly in the data space for $x$ and serves as a refiner of the initial output of the generator network. The learning process does not involve inference of $z$ or modeling of the latent space. In [a], the refined output is further used as the training sample of the generator, while in [b] the generator is trained by optimizing the learned energy score function. In sum, the key differences between our set-up and [a,b] include, at least, the following ones: - Although we all consider learning EBMs, the roles of EBMs are completely different. In our work, the light-weight LEBM is used as a flexible yet powerful prior for the generator, while in [a,b] the EBMs are used as a refiner or the main generation model; the learning processes in [a,b] do not involve inference of $z$ or modeling of the latent space. - Although both our work and [a,b] involve learning the generator, we can see in [a,b] the generator is supervised by a different objective that incorporates the training signal from the data-space EBM, rather than directly optimizing the reconstruction error of the original observed data $x$, i.e., $\log p(x | z)$ in our set-up. Therefore, we think the differences of FID scores of these methods **may not** serve as valid indicators, since the methods work for different models in completely different set-ups and are not directly comparable. - **The proposed method and the mentioned previous methods are not direct competitors, but are actually complementary to each other.** Following our discussion above, we would like to add that a more reasonable comparison would be incorporating the LEBM in the latent space of the generator used in [a,b], and jointly train the LEBM, generator and the data-space EBM to see whether the composed methods achieve higher performance. These methods are not direct competitors, but can be complementary to each other to further improve previous methods. In our initial submission here, we prefer to keep our model and learning method clean and simple, without involving extra networks and learned computations. We are happy to explore these directions in future works. - > One may doubt whether the proposed method can work or not when using a deeper architecture. We would like to point out that in sec. 4.1 L215-228 and tab. 1 and fig. 2 CelebA-HQ columns we have explicitly provided the results on higher dimension data (256x256) to show that our method can scale up with deeper architecture (supp. C tab. 2). To further verify the effectiveness of this method on more advanced architecture, in sec. 4.1 *GAN inversion* paragraph L229-254 we have provided further results using the StyleGAN network as the generator. Therefore, we believe we have provided positive evidence that our method can effectively work with deeper architectures to scale up. - > Suggest that the authors show results with a bit deeper advanced network, which is not difficult for experiments. Thank you for the constructive suggestion. Due to the time limit, we were only able to experiment on slightly deeper generators and report very preliminary results on CIFAR-10. Here we only add `conv3x3` layers to the original one; `+N` shows the number of additional layers and `w/ res` means adding residual connection to the conv layers. Please note that these models have not reached their best performances, but have already shown some initial improvements over the original model. ||+0|+1|+2|+4 w/ res| |:--:|:--:|:--:|:--:|:--:| |FID|57.72|57.63|55.50|54.59| We hope our response helps to address your concerns. Please feel free to let us know if you have any additional questions.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC