MCMC-Correction of Score-Based Diffusion Models for Model Composition

Anders Sjöberg, Jakob Lindqvist, Magnus Önnheim, Mats Jirstrand, Lennart Svensson
7/26/2023
stat.MLcs.LG

Official code: jackonelli/mcmc_corr_score_diffusion (2 stars, MIT, last commit 2025-12-09). 1 more implementation below.

Abstract

Diffusion models can be parameterized in terms of either a score or an energy function. The energy parameterization is attractive as it enables sampling procedures such as Markov Chain Monte Carlo (MCMC) that incorporates a Metropolis-Hastings (MH) correction step based on energy differences between proposed samples. Such corrections can significantly improve sampling quality, particularly in the context of model composition, where pre-trained models are combined to generate samples from novel distributions. Score-based diffusion models, on the other hand, are more widely adopted and come with a rich ecosystem of pre-trained models. However, they do not, in general, define an underlying energy function, making MH-based sampling inapplicable. In this work, we address this limitation by retaining the score parameterization and introducing a novel MH-like acceptance rule based on line integration of the score function. This allows the reuse of existing diffusion models while still combining the reverse process with various MCMC techniques, viewed as an instance of annealed MCMC. Through experiments on synthetic and real-world data, we show that our MH-like samplers offer comparable improvements to those obtained with energy-based models, without requiring explicit energy parameterization.

View on arXivView PDF

Code Implementations(2)

MIT
20Python, Jupyter NotebookJul 24, 202310 months agoMIT
MIT
01Python, Jupyter NotebookJul 2, 202410 months agoMIT

Similar Papers

Cite this paper

@article{sjberg2023mcmccorrection,
  title  = {MCMC-Correction of Score-Based Diffusion Models for Model Composition},
  author = {Anders Sjöberg and Jakob Lindqvist and Magnus Önnheim and Mats Jirstrand and Lennart Svensson},
  year   = {2023},
  eprint = {2307.14012},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.14012v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.14012.svg)](https://codeofpaper.com/paper/2307.14012)

Discussion