D-Flow: Differentiating through Flows for Controlled Generation

Heli Ben-Hamu, Omri Puny, Itai Gat, Brian Karrer, Uriel Singer +1 more
2/21/2024
cs.LG

No official code found. Best implementation: marvinsxtr/d-flow (2 stars, last commit 2025-06-23).

Abstract

Taming the generation outcome of state of the art Diffusion and Flow-Matching (FM) models without having to re-train a task-specific model unlocks a powerful tool for solving inverse problems, conditional generation, and controlled generation in general. In this work we introduce D-Flow, a simple framework for controlling the generation process by differentiating through the flow, optimizing for the source (noise) point. We motivate this framework by our key observation stating that for Diffusion/FM models trained with Gaussian probability paths, differentiating through the generation process projects gradient on the data manifold, implicitly injecting the prior into the optimization process. We validate our framework on linear and non-linear controlled generation problems including: image and audio inverse problems and conditional molecule generation reaching state of the art performance across all.

View on arXivView PDF

Code Implementations(1)

marvinsxtr/d-flowCommunity74%

Minimal implementation of D-Flow: Differentiating through Flows for Controlled Generation

20Dockerfile, Jupyter NotebookJun 22, 20251 years agoNOASSERTION

Similar Papers

Cite this paper

@article{benhamu2024dflow,
  title  = {D-Flow: Differentiating through Flows for Controlled Generation},
  author = {Heli Ben-Hamu and Omri Puny and Itai Gat and Brian Karrer and Uriel Singer and Yaron Lipman},
  year   = {2024},
  eprint = {2402.14017},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.14017v2},
  journal = {ICML 2024 2024}
}

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/2402.14017.svg)](https://codeofpaper.com/paper/2402.14017)

Discussion