Flow Density Control: Generative Optimization Beyond Entropy-Regularized Fine-Tuning

NeurIPS 2025 Spotlight · a distributional fine-tuning scheme for flow & diffusion generative models

Riccardo De Santi, Marin Vlastelica, Ya-Ping Hsieh, Zebang Shen, Niao He, Andreas Krause

ETH Zurich  ·  ETH AI Center

Generative optimization via flow-model fine-tuning: from a pre-trained policy inducing density p_1^pre toward an optimal policy inducing p_1^* that maximizes a utility F while remaining close to the pre-trained model under an arbitrary divergence D.
Generative optimization via flow-model fine-tuning. Starting from noise, a pre-trained flow $\pi^{\mathrm{pre}}$ induces the terminal density $p_1^{\mathrm{pre}}$. Flow Density Control (FDC) fine-tunes it into a new policy $\pi^{\star}$ whose terminal density $p_1^{\star}$ maximizes an arbitrary utility functional $\mathcal{F}$ (e.g., a risk-averse or novelty-seeking objective, an experiment-design criterion, a diversity measure), while remaining close to $p_1^{\mathrm{pre}}$ under an arbitrary divergence $\mathcal{D}$ (KL, Rényi, optimal transport, MMD, …).

Abstract

Adapting large-scale foundation flow and diffusion generative models to optimize task-specific objectives while preserving prior information is crucial for real-world applications such as molecular design, protein docking, and creative image generation. Existing principled fine-tuning methods aim to maximize the expected reward of generated samples, while retaining knowledge from the pre-trained model via KL-divergence regularization. In this work, we tackle the significantly more general problem of optimizing general utilities beyond average rewards, including risk-averse and novelty-seeking reward maximization, diversity measures for exploration, and experiment design objectives among others. Likewise, we consider more general ways to preserve prior information beyond KL-divergence, such as optimal transport distances and Rényi divergences. To this end, we introduce Flow Density Control (FDC), a simple algorithm that reduces this complex problem to a specific sequence of simpler fine-tuning tasks, each solvable via scalable established methods. We derive convergence guarantees for the proposed scheme under realistic assumptions by leveraging recent understanding of mirror flows. Finally, we validate our method on illustrative settings, text-to-image, and molecular design tasks, showing that it can steer pre-trained generative models to optimize objectives and solve practically relevant tasks beyond the reach of current fine-tuning schemes.

Why go beyond KL-regularized reward maximization?

Current principled fine-tuning schemes for flow and diffusion models — Adjoint Matching and its relatives — target a single problem: maximize the expected reward of generated samples while staying close to the pre-trained model under a KL divergence. Formally, they solve

$$\arg\max_{\pi}\; \mathbb{E}_{x \sim p_1^\pi}[\,r(x)\,]\;-\;\alpha\, D_{\mathrm{KL}}\!\bigl(p_1^{\pi}\,\|\,p_1^{\mathrm{pre}}\bigr).$$

This is a natural target — but many practically relevant scientific and creative objectives are not linear expectations, and KL is not always the right way to keep the prior.

Current fine-tuning methods handle only expected reward maximization with KL regularization; this work extends both utility and divergence to arbitrary functionals.
Current: linear utility + KL.  FDC: arbitrary $\mathcal{F}$ and $\mathcal{D}$.
Generative Optimization (GO) Given a pre-trained flow $\pi^{\mathrm{pre}}$, a utility functional $\mathcal{F}$, and a divergence $\mathcal{D}$, find a policy $\pi^{\star}$ inducing terminal density $p_1^{\pi^{\star}}$ solving $$\arg\max_{\pi}\; \mathcal{F}\!\bigl(p_1^\pi\bigr)\;-\;\alpha\,\mathcal{D}\!\bigl(p_1^{\pi}\,\|\,p_1^{\mathrm{pre}}\bigr), \quad \text{s.t. controlled continuity equation.}$$

Concrete tasks that fall outside standard KL-regularized reward maximization include risk-averse generation (control the worst-case cost — validity, safety), novelty-seeking generation (control the upper tail — scientific discovery), manifold exploration and model de-biasing via entropy maximization, optimal experiment design, and optimal-transport-regularized reward maximization when the geometry of the design space is known (e.g. protein docking). All of these are captured by choosing appropriate $\mathcal{F}$ and $\mathcal{D}$ in GO.

An expressivity hierarchy

Writing $\mathcal{G}(p_1^\pi) := \mathcal{F}(p_1^\pi) - \alpha\,\mathcal{D}(p_1^\pi\,\|\,p_1^{\mathrm{pre}})$, three strictly increasing problem classes emerge:

Expressivity hierarchy of generative optimization: Linear GO is a strict subset of Convex GO, which is a strict subset of General GO. Standard entropy-regularized control tackles only Linear GO; FDC covers Convex and General GO.
Linear GO $\subset$ Convex GO $\subset$ General GO. Entropy-regularized control tackles only the innermost class; FDC covers all three.

Flow Density Control (FDC)

FDC solves GO by reduction: rather than designing a bespoke solver for each new $\mathcal{F},\mathcal{D}$ pair, it turns a non-linear generative optimization problem into a short sequence of the standard linear fine-tuning problems that entropy-regularized control already solves well.

The core idea in one line

Given a functional $\mathcal{G}: \mathcal{P}(\mathcal{X}) \to \mathbb{R}$, its first variation $\delta \mathcal{G}(\mu)$ is an infinite-dimensional gradient in the space of probability measures:

$$\mathcal{G}(\mu + \epsilon\,\mu') = \mathcal{G}(\mu) + \epsilon\,\langle \mu',\,\delta \mathcal{G}(\mu)\rangle + o(\epsilon).$$

Linearizing $\mathcal{G}$ at the current policy $\pi_{k-1}$ turns the outer non-linear problem into an inner Entropy-Regularized First Variation Maximization:

Inner subproblem (linear GO) $$\arg\max_{\pi}\; \bigl\langle\,\delta \mathcal{G}\!\bigl(p_1^{\pi_{k-1}}\bigr),\; p_1^{\pi}\bigr\rangle \;-\; \eta_k\, D_{\mathrm{KL}}\!\bigl(p_1^{\pi}\,\|\,p_1^{\pi_{k-1}}\bigr).$$ This is a standard linear reward fine-tuning problem — solvable off-the-shelf by Adjoint Matching, RLHF-style methods, or any entropy-regularized flow-matching solver.

The four moves in a single iteration

1

Linearize the functional. At the current policy $\pi_{k-1}$ inducing density $p_1^{k-1}$, compute (or estimate) the gradient of the first variation $\nabla_x g_k(x) := \nabla_x \delta \mathcal{G}(p_1^{k-1})(x)$. This scalar field plays the role of a per-sample reward gradient.

2

Solve one linear fine-tuning subproblem. Run a scalable entropy-regularized solver (e.g. Adjoint Matching) with $g_k$ as reward and strength $\eta_k$:

$$\pi_k \leftarrow \mathrm{LinearFineTuningSolver}(\nabla_x g_k,\, \eta_k,\, \pi_{k-1}).$$

3

Iterate. The next iteration re-linearizes $\mathcal{G}$ at $\pi_k$, so the sequence of linear surrogates gradually tracks the true non-linear landscape — this is mirror descent in the space of densities.

4

Return $\pi_K$. After $K$ inner problems, output the final policy. In our experiments $K$ is small, typically $K = 2\ldots10$.

Formal algorithm

Algorithm 1 — Flow Density Control (FDC)

Input: pre-trained flow $\pi^{\mathrm{pre}}$, utility functional $\mathcal{G} = \mathcal{F} - \alpha\,\mathcal{D}$, iterations $K$, regularization schedule $\{\eta_k\}_{k=1}^{K}$.

  1. Initialize $\pi_0 \leftarrow \pi^{\mathrm{pre}}$.
  2. for $k = 1, 2, \dots, K$ do
    1. Estimate $\;\nabla_x g_k(x) \;=\; \nabla_x\, \delta \mathcal{G}\!\bigl(p_1^{k-1}\bigr)(x)$.
    2. Solve the linear subproblem: $\;\pi_k \leftarrow \mathrm{LinearFineTuningSolver}(\nabla_x g_k,\, \eta_k,\, \pi_{k-1})$.
  3. end for; return $\pi \coloneqq \pi_K$.

Do we actually need density estimation?

Among the practically-relevant functionals we consider, only Rényi divergences require estimating a density, and the recent Itô density estimator suffices. All others admit closed-form or sample-based gradients of the first variation. For example:

$$ \nabla_x\, \delta \mathcal{Q}(p^\pi)(x) \;=\; \begin{cases} -\nabla_x \log p^\pi(x) & \text{Entropy } (\mathcal{H})\\[4pt] \nabla_x r(x)\,\mathbf{1}\{r(x) \le q^r_\beta(p^\pi)\} & \text{CVaR}\\[4pt] \nabla_x \phi^\star(x),\;\; \phi^\star \in \arg\max_{\|\nabla \phi\|\le 1} \langle \phi,\, p^\pi - p^{\mathrm{pre}}\rangle & \text{Wasserstein-1} \end{cases} $$

Concretely: for entropy, the score is a known linear transform of the learned velocity field; for CVaR, any sample-based quantile estimator works; for $W_1$, $\phi^\star$ is precisely the discriminator in a Wasserstein-GAN and can be learned with standard methods.

Convergence guarantees via mirror descent

A natural worry with linearize-and-solve schemes is that iterating linear surrogates may fail to converge, or that noise in the first-variation gradient and inexactness of the inner solver could derail the outer loop. Reformulating GO as constrained optimization over stochastic processes and invoking the notion of relative smoothness on the space of probability measures, FDC becomes a mirror-ascent scheme with an entropic mirror map. We analyze two regimes.

Idealized: concave $\mathcal{G}$, exact oracles Under exact estimation of $\nabla_x\, \delta \mathcal{G}$ and exact solution of the inner linear subproblem, with step-size $\eta_k = L$, FDC's iterates satisfy $$\mathcal{G}(p_1^\star) - \mathcal{G}(p_1^\pi)\;\le\;\frac{L - \ell}{K}\,D_{\mathrm{KL}}\!\bigl(p_1^\star\,\|\,p_1^{\mathrm{pre}}\bigr),$$ where $\ell, L$ are the relative strong-concavity and relative smoothness constants of $\mathcal{G}$ with respect to the entropic mirror map — an $O(1/K)$ rate to the true optimum $p_1^\star$.
General: non-concave $\mathcal{G}$, noisy & biased oracles Under a Robbins–Monro step-size $\sum_k \eta_k = \infty,\;\sum_k \eta_k^2 < \infty$ and standard summability conditions on the oracle's bias and noise, the sequence of marginals $p_1^k$ produced by FDC converges weakly, almost surely, to a stationary point of $\mathcal{G}$.

Concretely, this is — to our knowledge — the first convergence result for fine-tuning flow / diffusion generative models under general utility functionals and general divergences, and it is obtained by leveraging recent understanding of mirror flows.

Experiments

Across four illustrative 2D settings and two high-dimensional real-world tasks, FDC steers pre-trained models to solve objectives beyond the reach of Adjoint Matching (AM), a classic linear fine-tuning scheme.

Risk-averse generation via CVaR

We fine-tune a pre-trained policy under $\mathrm{CVaR}_\beta$ with $\beta = 0.01$ — the expected cost in the worst 1% of samples. The cost field has a moderate-cost left band, a low-cost right zone, and thin catastrophic red stripes. Adjoint Matching drives the density into the low-cost right area but exposes it to rare extreme costs; FDC settles into the safer moderate-cost area, cutting the 1%-worst-case cost from 288.2 (AM) down to 90.0, well below the initial 262.5.

Pre-trained samples on the CVaR cost landscape AM vs FDC samples Beta-worst-case cost CVaR evaluation
(a) Pre-trained (b) AM vs FDC (c) $\beta$-worst-case cost (d) CVaR evaluation
FDC minimizes the worst-case cost; AM minimizes the average and is punished on the tail.

Novelty-seeking generation via superquantile

The mirror-image problem: maximize $\mathrm{SQ}_\beta$ with $\beta = 0.99$ — the expected reward in the top 1% of samples — over a reward field with a moderate central plateau and sparse extreme-reward spikes. AM drifts into the safe left basin and reaches a top-1% reward of 55.5. FDC instead pushes the density toward the spikes, elevating the top-1% reward to 596.1 — an order of magnitude gain over both AM and the initial 66.6.

Pre-trained samples on the SQ reward landscape AM vs FDC samples Beta-best-case reward SQ evaluation
(a) Pre-trained (b) AM vs FDC (c) $\beta$-best-case reward (d) SQ evaluation
FDC sacrifices average reward to reach rare, high-reward regions in the tail.

Reward maximization under optimal-transport regularization

Same pre-trained model, same reward (top-right maximum), but two anisotropic $W_1$ distances: $d_A$ makes vertical moves more costly than horizontal ones, $d_B$ does the opposite. Both AM (with KL) and FDC-A (with $W_1^A$) reach an expected reward of $35.0$, but FDC-A incurs only $W_1^A = 1.95$ versus $4.67$ for AM, and its mean shift is 280% larger horizontally than vertically. Under $d_B$, FDC-B preferentially shifts the density upward. The geometry of the design space is respected.

Pre-trained samples AM vs FDC-A samples under d_A AM vs FDC-B samples under d_B
(a) Pre-trained (b) AM vs FDC-A (metric $d_A$) (c) AM vs FDC-B (metric $d_B$)
Choosing the right divergence lets us encode which directions of movement are cheap — a capability entirely outside KL-regularized fine-tuning.

Manifold exploration via KL-regularized entropy maximization

The pre-trained density concentrates mass on the left half of the manifold. Fine-tuning to maximize entropy with strength $\alpha$ shifts probability mass into low-coverage regions. Reducing $\alpha$ from $0.5$ to $0.0$ trades off staying close to the prior against exploring — Monte Carlo entropy grows from $6.78$ (pre) to $7.00$ ($\alpha=0.5$) to $7.14$ ($\alpha=0$). This gives explicit, tunable exploration — a capability not supported by prior manifold-exploration methods.

Pre-trained samples FDC entropy maximization, alpha=0.5 FDC entropy maximization, alpha=0.0
(a) Pre-trained — $\mathcal{H} = 6.78$ (b) FDC, $\alpha = 0.5$ — $\mathcal{H} = 7.00$ (c) FDC, $\alpha = 0.0$ — $\mathcal{H} = 7.14$

Text-to-image: creative bridge design

We fine-tune Stable Diffusion 1.4 with prompt "A creative bridge design" to maximize KL-regularized entropy ($\alpha = 0.001$) for $K = 2$ iterations. On a sample of 100 generations the Vendi diversity score climbs from 2.36 (pre-trained) to 2.47 (FDC), and the CLIP prompt-alignment score also improves from 0.19 to 0.22 — more diverse and more on-prompt.

Pre-trained bridge design 1 Pre-trained bridge design 2 Pre-trained bridge design 3

Pre-trained Stable Diffusion 1.4

FDC-fine-tuned bridge design 1 FDC-fine-tuned bridge design 2 FDC-fine-tuned bridge design 3

Stable Diffusion 1.4 fine-tuned with FDC (entropy, $\alpha = 0.001$)

FDC pushes Stable Diffusion off its dominant modes into more diverse (yet still on-prompt) bridge designs.

Molecular design: single-point energy minimization

We fine-tune FlowMol (pre-trained on QM9) to discover molecules minimizing single-point total energy computed at the GFN1-xTB level. We maximize the superquantile of the negative energy at $\beta = 0.998$ — we do not aim to maximize the average sample reward, but rather that of the top 0.2% of designs. Consistent with the objective: AM has a higher mean negative energy (29.1) than FDC (27.5), but on the top-0.2% tail FDC beats AM (41.8 vs. 39.7).

Full distribution of negative energies over generated molecules Top 0.2% tail of negative energies over generated molecules 3D visualization of a molecule generated by an FDC-fine-tuned FlowMol
(a) Full energy distribution (b) Top-$0.2\%$ tail (c) FDC-generated design
FDC trades average reward for a heavier right tail.

Summary of gains over the linear-fine-tuning baseline

Task & metric Pre-trained Adjoint Matching FDC (ours)
CVaR $_{0.01}$ worst-case cost ↓ (toy) 262.5 288.2 90.0
SQ $_{0.99}$ best-case reward ↑ (toy) 66.6 55.5 596.1
$W_1^A$ distance ↓ (toy, matched $\mathbb{E}[r]$) 4.67 1.95
Entropy $\mathcal{H}(p^\pi)$ ↑ (toy) 6.78 7.14
Vendi diversity ↑  (SD 1.4, bridges) 2.36 2.47
CLIP prompt-alignment ↑ (SD 1.4, bridges) 0.19 0.22
Top-$0.2\%$ SQ negative energy ↑ (FlowMol, QM9) 24.2 39.7 41.8

Bold marks the best value in each row. Numbers are means over seeds; see the paper for standard deviations and additional metrics. Across all tasks that are not plain expected-reward maximization, Adjoint Matching's linear objective is insufficient, while FDC's mirror-descent reduction remains effective.

BibTeX

@inproceedings{desanti2025flow,
  title     = {Flow Density Control: Generative Optimization Beyond Entropy-Regularized Fine-Tuning},
  author    = {De Santi, Riccardo and Vlastelica, Marin and Hsieh, Ya-Ping and Shen, Zebang and He, Niao and Krause, Andreas},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
  year      = {2025},
  url       = {https://arxiv.org/abs/2511.22640}
}