What extra loops buy a looped image model

NOVEMBER 19, 20266 min read
Stick figure turning a crank on a small machine while a picture frame travels around a loop track above it.
The same neon sign prompt at 1, 2, 3, 4 and 8 loops: HELCO, HELIO, then HELLO from 3 loops on

"The word HELLO written in neon letters on a brick wall". Same model, same weights, same noise. Only the number of loops changes. One seed; the other was noisier, see below.

TL;DR

  • A model can spend more compute per step, a kind of "thinking" longer, without more parameters or more VRAM, by running the same transformer blocks in a loop.
  • Here it shows up in the images. At 1 loop the model miscounts objects and mixes up which object is which. At 3-4 loops it gets them right. Peak VRAM was 1.9 GiB at every loop count from 1 to 8.
  • The cost is time, and it grows in a straight line: 4 loops take 1.7-1.9x as long as 1.
  • It's not open-ended. Past the 4 loops it was trained with, the images stop improving.

Looped-DiT is a small text-to-image model from SenseNova that reuses part of itself. Inside each denoising step, a group of blocks runs several times with the same weights. You can pick how many times when you generate. I ran it at 1 to 8 loops on my 5090 to see what the extra passes change, and what they cost.

How looping works

The B/32 model has 17 transformer blocks and 260M parameters. The first 6 run once, the middle 5 run N times, and the last 6 run once. It was trained at N = 4, so the image goes through 32 blocks per step while only 17 blocks' worth of weights exist.

Diagram: noise and prompt go through 6 blocks once, 5 blocks N times with the same weights, then 6 blocks once, giving an image estimate

One denoising step. A 100-step image with classifier-free guidance makes 200 of these passes.

Two things from the paper make this work:

  • Deep supervision. During training, the state after every loop is decoded through the last 6 blocks and scored against the clean image. Without it, only the output after all 4 loops is trained. With it, you can stop after 1, 2 or 3 loops and still get a usable image.
  • Exclusive self-attention (XSA) in the looped blocks. It removes the part of each token's attention output that points along its own value vector, so attention only adds information from other tokens. The paper says plain looping without these two doesn't reliably help.

Setup

  • RTX 5090, WSL2, Docker. The official PyTorch code (OpenSenseNova/Looped-DiT) with the card's settings: 100 Euler steps, guidance 6.0, EMA weights in bf16, 512×512.
  • 12 prompts, 2 seeds each, at 1, 2, 3, 4, 6 and 8 loops. 6 and 8 are past the trained depth.
  • The noise is reset before each loop count. For a given prompt and seed, every loop count starts from the same noise, so any difference comes from the loops.

It works at every loop count

All 144 images came out coherent. Even 1 loop gives a finished-looking image, and 6 and 8 loops don't fall apart.

What more loops change

Grid of four prompts at 1, 2, 3, 4 and 8 loops: apples, cars and truck, HELLO neon sign, pumpkin teapot

Same noise in every row (seed 1). Only the loop count changes.

  • Counting. "Three yellow apples" gave 4 apples at 1 loop in both seeds. From 3 loops on, both seeds had 3.
  • Which object is which. "Two red cars and one white truck" was wrong at 1 loop in both seeds: one car short in one, an extra truck in the other. Right at 3 and 4 loops.
  • Spelling, sometimes. In this seed the neon sign went HELCO, HELIO, then HELLO from 3 loops on. The other seed got it right only at 1 and 8 loops, and wrote HLLO or HELO in between. So text is the noisiest of these.
  • Some extra interpretation. From 2 loops on, "a teapot shaped like a pumpkin" gets a jack-o'-lantern face in both seeds. Nobody asked for one.

2 loops was in between. It fixed some of these and not others.

What they don't change

Grid of a lighthouse painting, an old man portrait and a cat and dog at 1 to 8 loops, looking nearly the same across loop counts

Seed 0. Composition, lighting and style are already there at 1 loop.

Style, lighting and layout come from the noise and the blocks that run once. They barely move with loop count. The extra passes mostly fix whether the picture matches the prompt, not how it looks.

This is also why CLIP score was no help. Averaged over 24 images it stayed between 30.5 and 30.8 at every loop count. CLIP can't count apples or read a sign. The one prompt where it moved was the apples, from 26.5 at 1 loop to 30.3 at 3.

Past the trained depth

To see where the images settle, I compared each one with the 4-loop image from the same noise.

Average pixel difference from the 4-loop image: 10.7% at 1 loop, 7.7% at 2, 4.2% at 3, 0 at 4, 4.6% at 6, 6.3% at 8

Average absolute pixel difference from the 4-loop image, over all 24 images.

  • 1 to 3 loops move steadily toward the 4-loop image. 3 and 4 look almost the same.
  • 6 and 8 move away again, slowly. I couldn't see an improvement in those images, and nothing broke. One small win: 8 loops spelled HELLO right in both seeds.

So you can't keep adding loops for more quality. The model learned to use about 4 passes.

Speed and memory

Each loop adds 5 blocks to every pass, so time grows in a straight line. Memory doesn't grow at all: peak VRAM was 1.9 GiB at every loop count. Each loop overwrites the previous state, so nothing piles up at inference.

Seconds per image against loop count. Eager: 5.0 to 15.6 s for one image, 0.59 to 1.80 s per image in a batch of 8. Compiled: 0.56 to 1.47 s and 0.27 to 0.76 s

Different y scales. The compiled version is about 10 times faster at one image at a time.

LoopsBlocks per passEager, 1 imageEager, batch 8Compiled, 1 imageCompiled, batch 8
1175.0 s0.59 s0.56 s0.27 s
2226.6 s0.76 s0.68 s0.34 s
3278.0 s0.93 s0.82 s0.40 s
4329.6 s1.11 s0.94 s0.47 s
64212.6 s1.46 s1.19 s0.62 s
85215.6 s1.80 s1.47 s0.76 s

Seconds per 512×512 image. Batch-8 columns are per image.

Going from 1 to 4 loops costs 1.7 to 1.9 times the time.

The official sampler is slow for a model this small. At one image at a time the GPU was only about 34% busy. A pass is a few milliseconds of work, so most of the time goes to launching small GPU kernels from Python. A batch of 8 took about as long per pass as a single image.

Wrapping the model in torch.compile with CUDA graphs removed most of that. The code is in looped-dit-fast. 4 loops went from 9.6 s to 0.94 s per image. The images matched the eager ones to within bf16 rounding. Two things needed fixing first:

  • The model caches its rotary-embedding tables in a global dict. If that cache is first filled inside a CUDA graph, the next replay overwrites the cached tensors and PyTorch errors out. One normal forward pass at each shape before compiling avoids it.
  • Each loop count and batch size is its own compiled graph. Six loop counts and two batch sizes hit PyTorch's default limit of 8 recompiles. Raising torch._dynamo.config.recompile_limit fixed it.

Loops vs steps

Loops add depth inside each denoising step. Steps are the other way to spend compute. The project page says "4 loops × 13 steps beat 1 loop × 100 steps", so I tried 4 loops at 13 and 25 steps on the same prompts and noise. At 13 steps the content was mostly right in this seed (3 apples, a mostly legible sign) but the textures broke: zig-zag patterns in the background and a posterised portrait. At 25 steps it beat 1 loop at 100 steps, with clean textures and about half the compute (800 block passes against 1,700). So loops don't replace steps, but a few loops per step bought more than many extra steps at 1 loop.

Grid comparing 1 loop at 100 steps with 4 loops at 13, 25 and 100 steps for apples, an old man portrait and a HELLO neon sign

Seed 1. 4 loops at 13 steps gets the content right but breaks the textures. At 25 steps it looks close to 100.

Takeaways

  • Looping trades time for quality, not memory or parameters. Time is linear in loop count. Memory is flat.
  • The gain stops around the trained depth. 3 loops got most of it here.
  • More loops fixed counts and which object got which colour, and sometimes spelling. Look and style were set by the noise.
  • B/32 is a small 512×512 model. Detail and text are well behind current large image models at any loop count.
  • If you try it, compile it. The official sampler spends most of its time launching kernels. Code here.

Details

  • All runs on 2026-11-19, RTX 5090 (32 GB), WSL2, Docker Desktop.
  • Model: sensenova/Looped-DiT-B32 at revision 83a623e (EMA weights, step 290k). Text encoder: FLAN-T5-Large.
  • Code: OpenSenseNova/Looped-DiT at 18ad35c. PyTorch 2.11.0 (CUDA 12.8), transformers 4.57.1. The repo says transformers 5.x tokenizes differently from training.
  • Sampling: Euler, 100 steps (except in the loops vs steps section), guidance 6.0, noise scale 2.0, bf16.
  • Eager speed is the median of 30 rounds of a forward-pass benchmark, with all loop counts measured in turn so background load hits them evenly. End-to-end eager timings on WSL were noisy. Compiled speed is end-to-end sampling, best of 3. Compiled mode is torch.compile(mode="reduce-overhead", fullgraph=True, dynamic=False).
  • CLIP score: OpenAI ViT-L/14 via open_clip, image-prompt cosine × 100.
  • Compiled sampler, loop-depth sampler and benchmark: github.com/eishan05/looped-dit-fast (MIT).
  • Numbers per loop count are in results.csv.

Limits

24 images per loop count. The quality calls are mine, from looking at the images. I didn't run the benchmarks from the paper. B/32 only, not the larger B/16. One GPU.