LeapAlign: Post-Training Flow Matching Models at Any Generation Step by Building Two-Step Trajectories

Zhan-Hao Liang, Tao Yang, Jie Wu, Cheng Feng, Liang Zheng
4/1/2026
7 citations
diffusion-flow

No official code found. Best implementation: RockeyCoss/LeapAlign_Code (61 stars, Apache-2.0, last commit 2026-06-13). 1 more below.

Abstract

This paper focuses on the alignment of flow matching models with human preferences. A promising way is fine-tuning by directly backpropagating reward gradients through the differentiable generation process of flow matching.

Show full abstract

However, backpropagating through long trajectories results in prohibitive memory costs and gradient explosion. Therefore, direct-gradient methods struggle to update early generation steps, which are crucial for determining the global structure of the final image. To address this issue, we introduce LeapAlign, a fine-tuning method that reduces computational cost and enables direct gradient propagation from reward to early generation steps. Specifically, we shorten the long trajectory into only two steps by designing two consecutive leaps, each skipping multiple ODE sampling steps and predicting future latents in a single step. By randomizing the start and end timesteps of the leaps, LeapAlign leads to efficient and stable model updates at any generation step. To better use such shortened trajectories, we assign higher training weights to those that are more consistent with the long generation path. To further enhance gradient stability, we reduce the weights of gradient terms with large magnitude, instead of completely removing them as done in previous works. When fine-tuning the Flux model, LeapAlign consistently outperforms state-of-the-art GRPO-based and direct-gradient methods across various metrics, achieving superior image quality and image-text alignment.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
RockeyCoss/LeapAlign_CodeCommunity61–Apache-2.02026-06-13
nktkt/leap-alignCommunity1–MIT2026-04-17
Apache-2.0

[CVPR2026] LeapAlign: Post-Training Flow Matching Models at Any Generation Step by Building Two-Step Trajectories

611May 4, 20265 months agoApache-2.0
diffusiondiffusion-modeldiffusion-modelsdiffusion-rlflow-matching+3 more
nktkt/leap-alignCommunity64%
MIT

Mathematically faithful PyTorch reference implementation of LeapAlign (arxiv 2604.15311)

10Apr 17, 20267 months agoMIT

Similar Papers

Cite this paper

@article{liang2026leapalign,
  title  = {LeapAlign: Post-Training Flow Matching Models at Any Generation Step by Building Two-Step Trajectories},
  author = {Zhan-Hao Liang and Tao Yang and Jie Wu and Cheng Feng and Liang Zheng},
  year   = {2026},
  eprint = {2604.15311},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2604.15311},
  journal = {Computer Vision and Pattern Recognition}
}

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

Discussion