TL;DR
Steering pre-trained generative models using external, black-box reward functions usually wastes precious compute because existing methods evaluate intermediate samples, take one step, and throw that feedback away. Flow-Direct solves this by accumulating every single reward-evaluated sample into a persistent, non-parametric "guidance field" that continuously gets smarter over time. Better yet, once you finish optimizing, that collected dataset acts like a free, plug-and-play steering wheel—letting you generate brand-new target samples or mix-and-match multiple objectives with zero extra reward queries.
What Problem Does This Paper Address?
Pre-trained diffusion and flow models are brilliant at generating realistic images, 3D shapes, or molecules from broad data distributions. However, real-world engineering and scientific problems usually demand samples with very specific properties—like a 3D car body with minimal aerodynamic drag, or a protein with high binding affinity. Often, the only way to check if a generated sample hits the mark is via an external "black-box" reward function (like a slow physics simulator or a paid API) that has no gradients to backpropagate through.
To avoid expensive model fine-tuning, researchers use training-free guidance to steer generation at inference time. Current methods rely on local zero-order gradient estimates, particle resampling (Sequential Monte Carlo), or tree search. The catch? They treat feedback like a disposable napkin. At a given denoising step, they query the expensive reward function to make a local decision, step forward, and immediately discard the evaluated samples. Because no historical knowledge is preserved, these methods require a massive budget of reward evaluations to get good results.
Methods
Flow models generate data by transporting simple Gaussian noise ($t=0$) to complex data ($t=1$) along a continuous vector field governed by an ordinary differential equation (ODE). Standard inference just follows this pre-trained velocity field.
Flow-Direct modifies this vector field directly by adding a persistent guidance field, analytically derived from the log-density ratio between the base pre-trained distribution and a reward-weighted target (Boltzmann) distribution. Rather than training a neural network to learn this shift, the authors show it is mathematically equivalent to the difference between the target and base posterior expectations—essentially, a vector pointing from expected "normal" clean data toward expected "high-reward" clean data given the current noisy state $x_t$.
What is novel is how they compute this:
- Non-Parametric Softmax Estimator: They approximate these expectations directly from empirical datasets of evaluated samples using a closed-form, softmax-weighted sum, where higher rewards directly boost a sample's softmax logit.
- Iterative Accumulation: Optimization runs in batches over $L$ iterations. Every generated batch is scored by the black-box reward and permanently added to a growing dataset. The guidance field becomes a telescoping sum over all past batches, growing sharper with every single evaluation.
- Contrastive Reusability: Post-optimization, they aggregate all collected data into a single set and construct a symmetric contrastive shift around it. This creates a standalone guidance field that requires zero new reward queries, and multiple fields can be linearly summed to satisfy multiple rewards at once.
Datasets
Because Flow-Direct is a training-free, inference-time framework, it does not use standard static training datasets. Instead, it evaluates pre-trained models (Stable Diffusion 3.5 Medium for images and TRELLIS for 3D generation) using dynamic prompts and external reward evaluators:
- Demonstration Datasets: Small synthetic sets of 64 images each (e.g., puppy vs. cartoon puppy or golden wings) to validate data-driven steering.
- Image Tasks: Six simple animal prompts and complex text prompts evaluated against six black-box rewards: Aesthetic quality, HPSv3 human preference, JPEG Compressibility and Incompressibility, and VLM-based Attribute and Prompt Alignment (via Gemma and Gemini).
- 3D Task: Prompting TRELLIS with "car" and evaluating aerodynamic drag coefficients using the DoMINO physics evaluator.
Key Insights and Ideas
- Natural Manifold Regularization: Unconstrained guidance often pushes generations into weird, adversarial territory full of visual artifacts. Because Flow-Direct’s guidance vector is strictly a linear combination of real, generated data points, the update stays confined to the subspace (and roughly tangent to the manifold) of valid data.
- Cross-Prompt Generalization: The learned guidance fields capture pure attribute shifts rather than memorizing specific prompts. A guidance field optimized solely on dog prompts (e.g., for high aesthetics or sketch styles) seamlessly transfers those exact traits when generating an unseen cat prompt.
- Sampler-Agnostic & Tuning-Free: Because it modifies the continuous vector field itself rather than hacking a specific stochastic noise schedule, Flow-Direct works out-of-the-box with both deterministic ODE and stochastic SDE solvers, with no learning rates or step sizes to tune.
Key Results
Under a strict budget of 1,600 reward evaluations (800 for Prompt Alignment), Flow-Direct outperformed four state-of-the-art baselines (Evolvable, FK-Steering, TreeG, and DSearch) across every single image and 3D benchmark:
- Higher Rewards: Achieved top scores across the board, including 7.18 on Aesthetic (vs. second-best DSearch at 6.61), 10.94 on HPSv3 (vs. 9.90), and lowered 3D car aerodynamic drag to 0.16 (reported inverted as $-0.16$, beating FK-Steering's $-0.18$ and Evolvable's $-0.30$).
- Massive Query Efficiency: Flow-Direct matched or beat baseline final rewards using 2.03× to 6.64× fewer evaluations than DSearch, and up to 100× fewer evaluations than FK-Steering and Evolvable on certain tasks.
- Zero-Query Reuse: Using a frozen dog dataset to generate 1,600 new unseen cat images boosted mean Aesthetic scores from 5.54 to 6.13 without a single reward evaluation.
Limitations and Future Work
- Higher NFE Cost: Flow-Direct trades model compute for query efficiency. Because it runs full generation trajectories iteratively across $L$ batches rather than steering within a single pass, it incurs higher Neural Function Evaluations (NFEs). It is built specifically for regimes where the black-box reward (like lab tests or CFD simulations) is the true bottleneck, not the generative model itself.
- Continuous Spaces Only: The mathematical derivation relies on continuous state spaces and differentiable score functions, meaning it cannot currently be applied to discrete diffusion models. Future extensions are not explicitly discussed in the paper.
Summary updated