Importance Corrected Neural JKO Sampling

Johannes Hertrich, Robert Gruhlke

TL;DR

This paper introduces Importance Corrected Neural JKO, a novel sampling method that combines the local refinement of continuous normalizing flows (CNFs) with the global mass correction of importance-based rejection-resampling. By alternating these steps, the algorithm effectively navigates non-convex loss landscapes to sample from complex, high-dimensional, and multimodal unnormalized probability densities without the "mode collapse" common in standard generative models.

The Challenge of Unnormalized Densities

Sampling from an unnormalized probability density function—where the shape of the distribution $g(x)$ is known but its total volume (the normalizing constant $Z_g$) is not—is a foundational challenge in statistics and machine learning.

Traditional methods like Markov Chain Monte Carlo (MCMC) often struggle with multimodal distributions; they can get trapped in a single local mode and fail to explore the rest of the space. Recent deep learning approaches, such as Neural JKO (based on the Jordan-Kinderlehrer-Otto scheme), attempt to solve this by approximating the Wasserstein gradient flow of the reverse Kullback-Leibler (KL) divergence. However, the reverse KL is non-convex when the target distribution has multiple modes. This leads to mode collapse, where the model ignores some parts of the distribution entirely because it is easier to minimize the loss by focusing on just one mode.

Proposed Method: A Hybrid Approach

The authors propose a hybrid approach that alternates between two types of updates to overcome these limitations:

  1. Local Flow Steps (Neural JKO): Continuous Normalizing Flows (CNFs) are used to move samples locally. These flows are trained to minimize a regularized version of the reverse KL divergence, effectively "shaping" the samples to match the local geometry of the target density.
  2. Non-local Correction (Importance-Based Rejection): To ensure each mode has the correct amount of probability mass, a rejection-resampling step is introduced. Using the ratio between the target density and the current model's density, the algorithm identifies samples in over-represented regions and replaces them with fresh samples from the current model.
Iterative application of neural JKO steps and rejection steps. The flow moves points toward modes, while the rejection step (orange) prunes over-represented modes to balance weights.

This combination allows the model to refine the position of samples locally while periodically resetting the global distribution of mass to avoid getting stuck in suboptimal local minima.

Key Insights

  • The Model is its Own Proposal: Classical rejection sampling fails in high dimensions because it is nearly impossible to design a good proposal distribution. Here, the iterative JKO steps ensure the model is always a "good enough" proposal for the next rejection step, making the process efficient even in higher dimensions.
  • Convexifying the Objective: While the reverse KL is non-convex, the Wasserstein proximal mapping (the core of the JKO scheme) effectively converts the objective into a strongly convex one for small enough time steps, stabilizing optimization.
  • Density Evaluation: Unlike many MCMC or diffusion-based samplers, this method allows for the explicit evaluation of the generated density at any point, which is useful for error monitoring and calculating normalizing constants.

Experimental Results

The method was evaluated on several challenging synthetic test distributions, including 2D Gaussian Mixture Models (GMMs) designed to test mode balancing, a 10D "Funnel" distribution, and a 1600-dimensional Log-Gaussian Cox Process (LGCP) derived from spatial statistics.

The "Neural JKO IC" (Importance Corrected) method significantly outperformed standard Neural JKO, MCMC variants (MALA, HMC), and other deep learning samplers (DDS, CRAFT).

Table 1: Energy distance comparison across different samplers. Neural JKO IC achieves significantly lower distances on multimodal targets.
  • Energy Distance: As shown in the comparison table, the proposed method achieved energy distances orders of magnitude lower than competitors on multimodal targets like "shifted 8 Modes."
  • Mode Balancing: In GMM tests, the method uniquely distributed mass correctly across all modes, whereas other methods often collapsed to a subset.
  • High-Dimensional Scaling: The method successfully sampled from the 1600D LGCP distribution, outperforming state-of-the-art diffusion-based samplers.

Limitations and Future Work

While highly effective, the sampling time grows with the number of rejection steps because a constant fraction of samples is resampled in each step. Additionally, using CNFs requires solving Ordinary Differential Equations (ODEs) and estimating traces of large matrices, which can be computationally heavy in very high dimensions. Future work may explore replacing CNFs with diffusion models for the local flow steps to resolve runtime drawbacks while maintaining the benefits of importance correction.

Summary updated

BibTeX
@inproceedings{hertrich2025importance,
  author = {Johannes Hertrich and Robert Gruhlke},
  title = {{Importance Corrected Neural JKO Sampling}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=yQBZZeWPdQ},
}
Figure