Value Gradient Guidance for Flow Matching Alignment

Zhen Liu, Tim Z. Xiao, Carles Domingo-Enrich, Weiyang Liu, Dinghuai Zhang

Abstract

Flow Matching (FM) has emerged as a powerful framework for generative modeling, offering efficient sampling and straight trajectories. However, aligning these models with human preferences via reward functions remains challenging, often leading to "reward hacking" or high computational costs. We present Value Gradient Guidance (VGG-Flow), a novel alignment framework that treats the problem through the lens of optimal control. By matching the model's velocity field to the gradient of a learned value function, VGG-Flow achieves superior image quality and diversity compared to existing methods like ReFL and DRaFT. Our approach leverages a forward-looking initialization and a consistency objective to ensure efficient convergence and robust alignment across various reward landscapes, including aesthetic scores and human preference datasets.

Introduction

Generative models, while capable of producing high-fidelity images, often require post-hoc alignment to better reflect human values and aesthetic preferences. This process typically involves fine-tuning a pre-trained model using a reward function derived from human feedback. While alignment for diffusion models is well-established, Flow Matching (FM) models—such as Stable Diffusion 3—present unique difficulties for standard fine-tuning techniques.

Existing alignment strategies for FM generally fall into two categories: direct reward maximization and adjoint methods. Direct maximization often suffers from "reward hacking," where the model optimizes for the reward signal at the expense of image quality, resulting in over-saturated or distorted outputs. Conversely, adjoint methods are mathematically sound but computationally prohibitive, requiring full backpropagation through the entire sampling chain. VGG-Flow addresses these issues by providing a computationally efficient "middle way" that preserves the model's creative prior while effectively maximizing rewards.

Methodology: Optimal Control for Flow Alignment

VGG-Flow is built upon the principles of Optimal Control Theory. The core insight is that the optimal adjustment to a generative model's velocity field can be derived from the Hamilton-Jacobi-Bellman (HJB) equation.

Overview of the VGG-Flow framework, illustrating the optimal control formulation and the progression of image quality over fine-tuning steps.

The Value Gradient Signal

The framework identifies that the ideal "correction" to the velocity field is the gradient of a value function, which represents the expected future reward from a given state. To avoid the cost of full ODE simulation during training, VGG-Flow trains a separate neural network to estimate this value gradient. The generative model is then optimized to match its residual velocity to this guidance signal.

Forward-Looking Parametrization

To accelerate convergence, VGG-Flow employs a "forward-looking" initialization. Instead of learning the value function from scratch, it is initialized using the reward gradient of a one-step Euler prediction. This allows the model to anticipate the final image's reward at each step of the sampling process, providing an immediate and informative training signal from the start of the fine-tuning process.

Prior Preservation and Consistency

To ensure the learned value gradient remains accurate across the sampling trajectory, a "value consistency" objective is applied. Furthermore, the training objective includes a regularization term that penalizes large deviations from the base model's velocity field. This prevents mode collapse and ensures the model retains the diverse knowledge of the original pre-trained foundation while being nudged toward higher-reward outcomes.

Experiments and Results

We evaluated VGG-Flow using Stable Diffusion 3 (SD3) as the base model across three primary reward landscapes: Aesthetic Score, HPSv2 (Human Preference Score), and PickScore.

Quantitative Performance

VGG-Flow consistently outperformed baseline methods such as ReFL, DRaFT, and Adjoint Matching. In Pareto front evaluations (balancing Reward vs. FID/Diversity), VGG-Flow achieved significantly higher rewards for any given level of image quality. Notably, while direct maximization methods often lead to a sharp decline in sample diversity (as measured by DreamSim and CLIP variance), VGG-Flow maintained diversity levels comparable to the original pre-trained model.

Qualitative Comparison

Visual analysis confirms that VGG-Flow avoids common pitfalls of over-optimization. Unlike other methods that may produce "deep-fried" or repetitive images, VGG-Flow generates outputs that are both aesthetically pleasing and faithful to the input prompts.

Qualitative comparison of VGG-Flow against various baselines. VGG-Flow and its PMP variant achieve higher rewards while maintaining superior visual fidelity and diversity.

Conclusion

VGG-Flow introduces a robust and efficient framework for aligning Flow Matching models with human preferences. By amortizing the cost of alignment through a learned value gradient, it bypasses the computational bottlenecks of adjoint methods while avoiding the quality degradation associated with direct reward maximization. Future work will explore more specialized architectures for the value function and investigate the exploration-exploitation dynamics in high-dimensional image spaces.

Summary updated

BibTeX
@inproceedings{liu2025value,
  author = {Zhen Liu and Tim Z. Xiao and Carles Domingo-Enrich and Weiyang Liu and Dinghuai Zhang},
  title = {{Value Gradient Guidance for Flow Matching Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=6MmOy2Ji8V},
}
Figure