LoopFit: Retrofitting Pretrained Diffusion Transformers with Recurrent Refinement

Xiaocheng Lu, Haoxi Li, Dazhao Du, Tao Han, Jian Liu, Hao Chen, Bohai Gu, Siyu Yan, Jingcai Guo, Jie Zhang, Song GuoarXiv 2026

TL;DR

When image-generating Diffusion Transformers tackle complex visual problems, simply taking more denoising steps isn't enough—each step still relies on a shallow, fixed-depth "thought." LoopFit retrofits already-pretrained models to loop through their middle layers multiple times within a single step, using patch-level feedback to fix stubborn local mistakes without starting pretraining from scratch. As a result, a tiny 0.26B-parameter model outperforms 20B-parameter baselines at solving complex visual mazes, Sudokus, and text-rendering challenges.

What Problem Does This Paper Address?

Diffusion Transformers (DiTs) generate images by iteratively chipping away at random noise over dozens of sampling steps. If you want better output—say, accurately spelling text on a sign or drawing an unbroken 600-step path through a maze—the standard trick is to take more denoising steps. However, every individual step still passes through the exact same fixed-depth neural network, limiting how much "reasoning" happens per update.

Recurrently looping the middle Transformer blocks inside a step gives the model extra depth to refine its internal representation before committing to an update. Better yet, retrofitting an existing pretrained DiT with a loop avoids expensive pretraining from scratch.

The catch? Pretrained blocks expect inputs from a specific layer, not their own recycled output. Furthermore, different parts of an image need opposite corrections at the exact same moment. Imagine fixing a misspelled sign from "CAEF" to "CAFE": midway through refinement, the bottom strokes of the last two letters might look identical, even though one needs to shrink into an 'F' and the other needs to grow into an 'E'. Global signals like diffusion time and loop count give every patch the exact same instructions, leaving the model blind to local trajectory.

Figure 1. What returns to the shared DiT core? The schematic follows the last two letters of the sign. Their bottom strokes reach the same length as one shrinks (dashed outline) and the other grows (solid blue). Both models reuse the current state at fixed diffusion time. LoopFit also conditions the next pass on each patch’s signed feature change.

Methods

The authors take a pretrained pixel-space DiT (MiniT2I, 0.26B parameters), keep its initial ("prelude") and final ("coda") blocks intact, and loop the middle core $L$ times at a fixed noise level. While standard looped models supervise every pass uniformly, LoopFit introduces three targeted mechanisms:

  • Residual Attention Modulation (RAM): After each pass through the shared core, RAM records the signed feature change at each individual image patch—essentially remembering how that patch just moved. On the next pass, this spatial update scales and shifts that specific patch's input right before attention, allowing neighboring patches to receive customized steering.
  • Residual Relay Loss (RRL): During training, uniform loss weights let stubborn local errors hide in the average. RRL tracks each patch's prediction error across consecutive passes using an exponential moving average, dynamically boosting the training loss weight on patches where errors persist. (At inference, RRL disappears entirely.)
  • Noise-Dependent Depth & Early Exit: Instead of running 4 loops at every denoising step, LoopFit front-loads computation: it runs 4 passes during the first 40% of steps (when the image is mostly noise) and drops to 1 pass thereafter. An optional adaptive early-exit rule halts looping early for a given image once its largest patch updates settle down.
Figure 2. LoopFit. (a) The pretrained core repeats at fixed t. Training decodes every exit ˆyr. Sampling decodes only the selected exit. The marked cells in (b) and (c) trace one position i in computations applied to every image patch. (b) From the second pass, Residual Attention Modulation (RAM) adds a correction from the preceding signed feature update at i to the time-and-loop term shared across patches. Their sum sets the scale and shift before the image QKV projections. (c) Residual Relay Loss (RRL) compares the velocity derived from ˆyr with the training target. The history through exit r sets the weight on the new error er+1(i) at that position. Weights average to one across patches in each image. Dashed signal arrows mark detachment.

Datasets

LoopFit is evaluated on two fronts: visual puzzle solving (by drawing the solution directly onto the board image) and general text-to-image generation.

  • Visual Puzzles: Four tasks spanning 12 settings—FrozenLake, Maze, Traveling Salesperson Problem (TSP), and Sudoku—building on benchmarks from DiffThinker. To stress-test long-horizon coherence, the authors also evaluate on Hard splits, including independently generated long-path 32×32 mazes (median path length of 609 moves vs. 202 in standard Maze-32), 100-move FrozenLake boards, 18-city TSP, and 30-given Sudoku puzzles re-rendered to match training layouts.
  • Text-to-Image Benchmarks: T2I-CoReBench (composition and reasoning), OneIG-Bench (English text rendering), PRISM-Bench, SpatialGenEval, and DPG-Bench.

Key Insights and Ideas

  • Errors are remarkably stubborn: In a uniformly trained loop, 93.6% of the patches in the worst-error quintile on pass 1 stay in the worst quintile by pass 4. Giving the loss function a memory (RRL) directly targets this bottleneck.
  • Deeper thoughts beat more steps: Given the same inference compute budget (~2.35s per batch), increasing Euler steps from 20 to 38 yields zero improvement on hard mazes and Sudokus. Keeping 20 steps and looping the core 4 times per step solves dozens of new boards.
  • Think hard early, coast late: Moving extra recurrent passes from the noisy beginning of generation to the clean end causes Maze accuracy to collapse from 366/384 solved down to 23/384. Global structure and path topology are locked in while the canvas is still mostly noise.
  • Spatial location actually matters: When the authors deliberately shifted RAM's patch residuals by half the sequence at test time, maze accuracy plummeted below a baseline with patch feedback turned off completely—proving the model actively relies on spatially aligned momentum.

Key Results

  • Punching way above its weight: Across all 12 visual puzzle settings, LoopFit (0.26B parameters) solves 89.8% of boards, beating 20B-parameter specialized baselines like SelfCondFM (87.8%), DiffThinker++ (64.7%), and zero-shot Gemini-3-Flash (10.4%).
  • Long-horizon dominance: On Maze Hard (609-move median paths), LoopFit solves 94% of boards compared to 85% for SelfCondFM, 80% for EndoCoT, and just 7% for DiffThinker++.
Comparison on FrozenLake Hard showing LoopFit completing a 100-move path
  • Text-to-Image gains: On T2I-CoReBench, LoopFit boosts overall performance from 56.00 (base MiniT2I) and 57.09 (NaiveLoop) to 58.55, while improving English text rendering on OneIG from 14.02 to 15.53.
  • Inference speedup: The fixed 4→1 depth schedule matches the accuracy of running 4 passes at every step (95.3% on Maze, 55.8% on Sudoku) while cutting batch inference time by 29.8%. Adaptive early exit shaves off another 13.7% on Maze for a negligible 0.52% accuracy dip.

Limitations and Future Work

While the paper does not feature a standalone limitations section, the authors transparently highlight several trade-offs across their experiments:

  • Task-dependent depth scaling: Training and inferring with more passes isn't universally better. Doubling training depth from 4 to 8 passes (at inference depth 8) solves 37 more hard mazes, but solves 16 fewer hard Sudokus. Similarly, cumulative error history gives big gains on long mazes, whereas simple uniform weights slightly edge it out on regular Sudoku.
  • Slight reasoning trade-off in T2I: While LoopFit improves overall text-to-image scores and composition over both the base model and NaiveLoop, its T2I-CoReBench reasoning sub-score (49.40), though recovering most of NaiveLoop's drop (47.80), remains slightly below the original pretrained model (49.77).
  • Sudoku Hard formatting: On 30-given Hard Sudoku, LoopFit trails the 20B SelfCondFM baseline slightly (80% vs. 82%) and required re-rendering the test puzzles to match its training typeface and layout.

Summary updated

Abstract

Scaling inference computation offers a way to improve diffusion transformers (DiTs), but taking more sampling steps leaves the depth of each denoising prediction unchanged. Recurrently reusing Transformer blocks increases computation within each step, allowing further refinement of hidden representations. Retrofitting pretrained models enables this capability without repeating pretraining, but requires blocks learned for fixed-depth computation to refine states produced by their own repeated application. The challenge is to use each additional pass to correct local errors without disrupting the structure established by earlier passes. We introduce LoopFit, which uses feedback from earlier passes to guide refinement at each image patch. Residual Attention Modulation (RAM) uses each patch's feature change in one pass to scale and shift its input to attention in the next. During training, Residual Relay Loss (RRL) gives greater weight to patches whose prediction errors persist across passes. A noise-dependent depth schedule speeds up sampling by using four passes at high noise and one at lower noise levels. At comparable cost, backbones trained with four passes solve more problems using recurrent depth than extra sampling steps. Across 12 visual puzzle settings, LoopFit solves 89.8% of boards, compared with 87.8% for the strongest baseline evaluated on all 12. Most of the gain comes from tracing long paths on mazes and frozen lakes.
BibTeX
@misc{lu2026loopfit,
  author = {Xiaocheng Lu and Haoxi Li and Dazhao Du and Tao Han and Jian Liu and Hao Chen and Bohai Gu and Siyu Yan and Jingcai Guo and Jie Zhang and Song Guo},
  title = {{LoopFit: Retrofitting Pretrained Diffusion Transformers with Recurrent Refinement}},
  year = {2026},
  eprint = {2611.32175},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32175},
}
Figure