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.
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.
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++.
- 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