Joint Distillation for Fast Likelihood Evaluation and Sampling in Flow-based Models

Xinyue Ai, Yutong He, Albert Gu, Ruslan Salakhutdinov, J. Zico Kolter, Nicholas M. Boffi, Max Simchowitz · 2025

Read Joint Distillation for Fast Likelihood Evaluation and Sampling in Flow-based Models by Xinyue Ai, Yutong He, Albert Gu, Ruslan Salakhutdinov, J. Zico Kolter, Nicholas M. Boffi, Max Simchowitz (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2512-02636.txt.

Introduction

Xinyue Ai and six co-authors make likelihood scores cheaper for diffusion and flow based generators. A likelihood says how probable a sample is under the model, enabling model comparison and some fine tuning. Paradoxically, today's best generators need hundreds or thousands of network runs for one likelihood.

Their joint distillation approach trains a faster stand in for both likelihood evaluation and sampling. Cutting that cost opens downstream uses that were too slow to run before. Cheaper likelihoods could help detect odd samples, rank models fairly, and tune generators with clearer feedback. Fast scores also let teams test new forms of a model on the same day they dream them up.

Catalog record

CREATORXinyue Ai, Yutong He, Albert Gu, Ruslan Salakhutdinov, J. Zico Kolter, Nicholas M. Boffi, Max Simchowitz
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE61 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2512-02636

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Joint Distillation for Fast Likelihood Evaluation and Sampling in Flow-based Models Xinyue Ai, Yutong He, Albert Gu, Ruslan Salakhutdinov, J. Zico Kolter, Nicholas M. Boffi, Max Simchowitz Abstract Log-likelihood evaluation enables important capabilities in generative models, including model comparison, certain fine-tuning objectives, and many downstream applications. Yet paradoxically, some of today’s best generative models – diffusion and flow-based models – still require hundreds to thousands of neural function evaluations (NFEs) to compute a single likelihood. While recent distillation methods have successfully accelerated sampling to just a few steps, they achieve this at the cost of likelihood tractability: existing approaches either abandon likelihood computation entirely or still require expensive integration over full trajectories. We present fast flow joint distillation ( F2D2 ), a framework that simultaneously reduces the number of NFEs required for both sampling and likelihood evaluation by two orders of magnitude. Our key insight is that in continuous normalizing flows, the coupled ODEs for sampling and likelihood are computed from a shared underlying velocity field, allowing us to jointly distill both the sampling trajectory and cumulative divergence using a single model. F2D2 is modular, compatible with existing flow-based few-step sampling models, and requires only an additional divergence prediction head. Experiments demonstrate F2D2 ’s capability of achieving accurate log-likelihood with few-step evaluations while maintaining high sample quality, solving a long-standing computational bottleneck in flow-based generative models. As an application of our approach, we propose a lightweight self-guidance method that enables a 2-step MeanFlow model to outperform a 1024 step teacher model with only a single additional backward NFE. 1 Introduction Log-likelihood evaluation and likelihood-based inference have long been fundamental to statistical modeling and machine learning, serving as the backbone for parameter estimation ( 11 ) , model selection ( 1 ) , and hypothesis testing ( 26 ) . In the era of generative AI, the ability to efficiently evaluate log-likelihood (log-density) has become even more critical, as it directly enables key post-training techniques including reinforcement learning and preference optimization, where likelihoods are important for methods like PPO, DPO and GRPO ( 38 ; 29 ; 31 ; 39 ) . Beyond these applications, optimizing log-likelihood also encourages generative models to capture all modes of the data distribution, avoiding mode collapse that plagues adversarial approaches ( 32 ) . While likelihood evaluation is useful for modern generative modeling, the most successful generative models for images and video ( 34 ; 4 ; 28 ; 30 ; 15 ) , namely diffusion and flow matching models, suffer from a critical weakness: computing likelihood requires prohibitively expensive iterative neural function evaluations (NFEs). In particular, discrete-time diffusion models like DDPM ( 19 ; 27 ) require summing up variational bounds across all timesteps, which needs hundreds to thousands of forward passes to compute a single likelihood. Similarly, continuous-time formulations like score SDE ( 43 ) and flow matching ( 23 ; 2 ; 24 ; 3 ) also must integrate the divergence along the learned (probability) flow ODE, which typically requires numerical integration with 100-1000 NFEs for accurate likelihood evaluation. While advanced solvers can significantly reduce NFEs ( 20 ) , they fundamentally cannot escape the integration requirement and produce vastly inaccurate results when restricted to very few steps ( \leq 10 NFEs). This computational burden makes many likelihood-based finetuning objectives, model comparison, and downstream applications prohibitively expensive for modern diffusion/flow matching models. Interestingly, diffusion and flow matching models faced the same NFE bottleneck for sampling when they were first introduced, where they initially required 1000+ steps to generate a single image. Research addressing this issue has been remarkably successful, with methods that learn to skip multiple steps, either through distillation or self-consistency objectives, emerging as particularly powerful solutions ( 36 ; 40 ; 21 ; 12 ; 14 ; 5 ; 6 ) . However, despite achieving few-step sampling, most of these methods completely lose the ability to compute likelihoods, and the few methods that preserve likelihood computation (e.g. 21 ) still require integrating over the entire trajectory with hundreds of NFEs, making fast likelihood evaluation impossible. Thus, while practitioners have solutions to fast sampling for diffusion and flow matching models, fast log-likelihood evaluation remains an unsolved problem. Here, we show that it is possible to achieve both at the same time. Contributions. Our key insight is that, in flow matching and continuous normalizing flows (CNFs) in general ( 8 ) , computing exact likelihoods requires solving coupled ODEs: the sampling trajectory \frac{\mathrm{d}}{\mathrm{d}t}x_{t}=v_{\theta}(x_{t},t) and the log-density evolution \frac{\mathrm{d}}{\mathrm{d}t}\log p_{t}(x_{t})=-\operatorname{div}(v_{\theta}(x_{t},t)) , both depending on the same learned velocity v_{\theta} . Since the divergence term can be viewed as another output derived from the same velocity model, we can learn to distill both the flow trajectory and its corresponding divergence computation simultaneously within a single model. By jointly optimizing for both accurate few-step sampling and log-likelihood evaluation, we can potentially achieve a model that succeeds at both tasks. Based on these insights, we propose fast flow joint distillation ( F2D2 ), a simple and modular framework for jointly learning fast sampling and fast log-likelihood evaluation in flow-based models. Our key idea is to leverage the flow map framework ( 6 ) to train a single model to predict both the sampling trajectory and cumulative divergence in parallel using a joint self-distillation objective, ensuring both outputs learn to skip the numerous steps in training. This makes F2D2 plug-and-play with any CNF-based few-step sampling method like shortcut models and MeanFlow, and requires only a new divergence prediction head alongside the existing velocity prediction. To our knowledge, F2D2 is the first method to enable accurate few-step log-likelihood evaluation in diffusion/CNF-based generative models, solving a long-standing limitation of these frameworks. We demonstrate that our method produces both calibrated likelihoods and high quality samples with few-step NFEs on image datasets CIFAR-10 ( 22 ) and ImageNet 64\times 64 ( 9 ) . We show that our F2D2 are compatible with and can be directly apply to pre-trained shortcut models, MeanFlow and a new distillation method we propose in this paper. As an application of our method, we introduce maximum likelihood self-guidance, a lightweight test-time intervention which uses rapid likelihood evaluation to optimize over generated samples, requiring only an additional forward and backward pass through the model. Remarkably, we show that F2D2 with maximum likelihood self-guidance instantiated with 2-step MeanFlow achieves lower FID than a 1024-step flow matching model of the same size on CIFAR-10. This proof of concept demonstrates the expanded algorithmic sandbox enabled by rapid likelihood evaluation. 2 Background Let p_{\rm{data}} denote the data distribution with samples x\in\mathbb{R}^{d} . We consider a time variable t\in[0,1] where t=0 corresponds to a simple noise distribution p_{0}=\mathcal{N}(0,I) and t=1 corresponds to the data distribution p_{1}=p_{\text{data}} . We denote the marginal distribution at time t as p_{t}(x) . Flow Matching. Flow matching ( 23 ; 2 ; 24 ; 3 ) is a scalable training method for generative modeling that learns a time-dependent velocity field v_{\theta}:\mathbb{R}^{d}\times[0,1]\rightarrow\mathbb{R}^{d} to transport samples from a simple noise distribution p_{0} to the data distribution p_{1} . Along a straight-line path x_{t}=(1-t)x_{0}+tx_{1} that linearly interpolates between a noise sample x_{0}\sim p_{0} and a data sample x_{1}\sim p_{1} , it models the evolution dynamic with the ordinary differential equation

Read the complete text