← Back to projects

Training-Free Hidden-State Refinement for Flow-Matching Image Generators

Yuanyi Yan1, Xinzhe Rao1, Canyu Shen2, Yang Chen1, Yunlu Chen3, Meng Tang4, Teng Long5, Vincent Tao Hu1

  1. 1Huazhong University of Science and Technology
  2. 2Tongji University
  3. 3King Abdullah University of Science and Technology
  4. 4University of California, Merced
  5. 5University of Amsterdam

Accepted at AAAI 2027

Qualitative comparisons and quality-efficiency plots for Dense Token Loop, Sparse Token Loop, and Loop Guidance
Left: matched samples without looping, with Dense Token Loop, and with Loop Guidance. Right: Scale-RAE DiT2.4B uses seed-42 scores and matched generation-call timings. A 25-step Dense Token Loop over layers [12,19] improves both metrics over the 50-step baseline (49 Euler updates), taking 1.7189 versus 2.3401 s/image.

Abstract

We study how to spend additional inference-time computation inside a frozen flow-matching image denoiser, without changing its weights or outer sampler. The framework repeats selected transformer layers and exposes independent controls over token scope, layer depth, sampling progress, loop count, and prediction-space guidance. Across Scale-RAE and RAEv2 generators, the method improves prompt alignment and image-quality metrics while offering useful quality–latency trade-offs.

Key Results

+0.1110

GenEval

0.4622 → 0.5732 with Dense Loop Guidance on DiT2.4B

+0.0312

DPG-Bench

0.7727 → 0.8039 with Dense Loop Guidance on DiT2.4B

13.79%

Lower latency

Sparse versus Dense Token Loop on DiT9.8B

0

Training updates

Weights, conditioning, autoencoder, and sampler stay frozen

Method

Training-free internal looping with sampling-progress gating, dense or sparse token updates, and a selected transformer-layer range
Sampling-Progress Gating controls when looping is active. Dense Token Loop repeats each selected layer for all tokens. Sparse Token Loop restricts repetition to selected tokens and reuses a cached complement residual. The outer sampler and all model weights remain unchanged.

Dense and Sparse Token Loop

Repeat each layer in a transformer-layer window for every token, or focus repeated computation on a subset while retaining full-token attention context.

Sampling-Progress Gating

Activate internal loops only during chosen denoising calls; the strongest shared setting concentrates them in the early half of sampling.

Layer Range and Loop Budget

Choose where repeated updates occur and distribute a total loop strength across a controllable number of inner evaluations.

Loop Guidance

Combine ordinary and looped vector-field predictions, using their difference as a prediction-space correction direction.

Results

The tables follow the revised manuscript. Quality scores average seeds 42, 43, and 44 for DiT2.4B and the 615M proxy. DiT9.8B uses seed 42. GenEval uses GPU evaluation for DiT2.4B and the proxy, and the original CPU evaluation for DiT9.8B. Batch-1 generation-call time includes text forward passes and all denoising with GPU synchronization. It excludes loading, tokenization, image decoding, and file writing. Measurements use two H100s for DiT9.8B and one for each other model.

Direct looping across three RAE-based generators

ModelMethodGenEval ↑DPG-Bench ↑ImageReward ↑Time (s/image) ↓
Scale-RAE DiT2.4Bw/o Loop0.46220.77270.16491.2719
Dense Token Loop (Ours)0.55820.80230.51822.1331
Sparse Token Loop (Ours)0.54260.79810.47561.9043
Scale-RAE DiT9.8Bw/o Loop0.53210.80030.46091.5609
Dense Token Loop (Ours)0.59770.81780.72112.6177
Sparse Token Loop (Ours)0.58570.82060.63652.2566
RAEv2 SigLIP2-B proxy (615M)w/o Loop0.35990.7220-0.26350.8184
Dense Token Loop (Ours)0.37590.7290-0.18041.1273
Sparse Token Loop (Ours)0.36530.7260-0.21601.2203

Loop Guidance improves both primary metrics

ModelLoop GuidanceGenEvalDPG-BenchTime (s/image)
Scale-RAE DiT2.4BDense (g = 2.8)0.4622 → 0.57320.7727 → 0.80391.2719 → 3.2343
Scale-RAE DiT9.8BDense (g = 6.0)0.5321 → 0.64320.8003 → 0.82641.5609 → 3.9644
RAEv2 SigLIP2-B proxy (615M)Dense (g = 9.0)0.3599 → 0.43840.7220 → 0.74560.8184 → 1.5187
RAEv2 SigLIP2-B proxy (615M)Sparse (g = 6.0)0.3599 → 0.41260.7220 → 0.73940.8184 → 1.6151

Each cell shows the no-loop baseline followed by the loop-guided result. Loop Guidance times include both prediction paths.

Qualitative Comparisons

Prompt- and seed-matched samples on Scale-RAE Qwen7B / DiT9.8B compare the ordinary path, Dense Token Loop, and Loop Guidance. Expand either benchmark gallery to inspect the full set shown here.

GenEval gallery · 8 comparisons
GenEval matched comparison 02_prompt085GenEval matched comparison 03_prompt099GenEval matched comparison 07_prompt184GenEval matched comparison 10_prompt269GenEval matched comparison 11_prompt311GenEval matched comparison 13_prompt410GenEval matched comparison 14_prompt510GenEval matched comparison 15_prompt552
DPG-Bench gallery · 9 comparisons
DPG-Bench matched comparison 01_prompt000DPG-Bench matched comparison 02_prompt055DPG-Bench matched comparison 03_prompt082DPG-Bench matched comparison 04_prompt181DPG-Bench matched comparison 05_prompt262DPG-Bench matched comparison 07_prompt453DPG-Bench matched comparison 09_prompt562DPG-Bench matched comparison 10_prompt672DPG-Bench matched comparison 12_prompt753

Scope and Limitations

Improvements are strongest for one- and two-subject prompts, where looping often repairs malformed structure and attribute binding. Aggregate GenEval2 does not improve, so hidden-state refinement alone does not solve difficult counting or crowded multi-object composition.

Reproducibility

The public repository contains the runtime, four backend adapters, exact presets, 2,418 ordered benchmark prompts, aggregate results, CPU-only tests, and generation, export, and aggregation utilities.

Browse the code and reproduction guide →

Citation

@misc{yan2026trainingfree,
  title={Training-Free Hidden-State Refinement for Flow-Matching Image Generators},
  author={Yan, Yuanyi and Rao, Xinzhe and Shen, Canyu and Chen, Yang and Chen, Yunlu and Tang, Meng and Long, Teng and Hu, Vincent Tao},
  year={2026},
  eprint={2608.29160},
  archivePrefix={arXiv},
  primaryClass={cs.CV},
  url={https://arxiv.org/abs/2608.29160}
}