Huazhong University of Science and Technology CWI University of Trento
Code
In Submission · Training-Free Multimodal Inference

Evolving Loop Programs Discovering How Frozen Transformers Should Loop

Yang Chen1 · Kaitai Shen1 · Xuemei Zhou2 · Teng Long3 · Vincent Tao Hu1

1School of Software Engineering, Huazhong University of Science and Technology · 2Centrum voor Wiskunde en Informatica (CWI) · 3University of Trento  ·  VibeLab

OVERVIEW FILM
Image · 3 Diffusion Backbones
5.19× FLOPs Cut
RAE (+5.86 GenEval) & Looped-DiT (4.00×)
9.68× lower FLOPs than Loop+LG on RAE; 85.08% GenEval at 25 steps on Looped-DiT-B32.
Video · 4 World & T2V Models
−61.3% Revisit Drift
LongLive 2.0/1.0, Self-Forcing & Wan2.1
Mean LPIPS drops 0.3852 → 0.1492 across 100 RememBench scenes; 2.22× speedup on Wan2.1.
Text · 2 Reasoning LLMs
1.7× Faster & Higher Avg
Dory1.0-4B & Qwen3-4B (+1.67 Micro Acc)
Beats both native K=2 and K=4 across IFBench, GPQA Diamond, and SciCode (8-repeat avg).
01 · Multimodal Overview

Find better loops for image, text, and video models

Repeating transformer blocks can improve a pretrained model without changing its weights. ELP uses an AI agent to find useful loops: which blocks to repeat, how to update their hidden states, and when to reuse earlier work.

The agent also adjusts sampling schedules and guidance. After search, selected programs run as fixed code and settings, with no further search-agent calls. We test them on 9 frozen backbones for image generation, text reasoning, and video generation.

01

Search over code

The search can change both the update code and its settings, instead of choosing only from a fixed menu.

02

Inspect each run

The agent writes checks to see how features, guidance, and updates change during generation. It uses these observations to propose edits.

03

Test across 9 models

The same framework is tested on 9 image, reasoning, and video models. Their weights stay fixed.

Multi-domain Pareto improvements with frozen weights. Interactive vector plots across Scale-RAE, Looped-DiT-B32 (panels a–c) and RememBench video world models (panel d).

Executable program editing expands the retained Pareto frontier. On Scale-RAE under an 80-candidate budget (R0–R8), full loop program search reaches a cumulative hypervolume of 0.9148 vs. 0.7923 for configuration-only search.

Comparison between grid enumeration and feedback-guided loop program search

Feedback-guided search vs. grid enumeration. Coordinating structure, state dynamics, and outer execution control avoids exponential grid sweeps.

02 · Methodology

How the search works

Search runs offline for each model. The selected programs then run without further calls to the search agent or changes to model weights.

Choose Scale-RAE, Looped-DiT-B32, LongLive 2.0, or Dory1.0-4B to follow the code changes, observations, and results.

ELP four-component search loop architecture diagram

ELP tests each program and records what happened. The agent uses those results to improve the next round of programs.

1. Write a loop program

Structure · Dynamics · Control

Each candidate p = (c, λ) contains code c and settings λ. Together, they decide which blocks repeat, how states change, and when earlier work is reused.

st(k+1) = Uθ,p(st(k); t, k) Eq. (2)

2. Inspect the run

Runtime Traces

The agent writes checks Dr for development inputs. These inspect how features, guidance, and updates change between repetitions and sampling steps.

𝓞r(p) = Dr( Traceθ(p, 𝓧dev) ) Eq. (3)

3. Improve the program

Offline Refinement

At round r, the agent uses earlier results, failures, and observations to propose new programs. The target a tells it which outcomes to prioritize.

𝓟r+1 = LLM(𝓒r, 𝓗r, 𝓞≤r; a) Eq. (4)

4. Choose a speed–quality trade-off

Frozen Deployment

Keep programs that offer useful trade-offs between quality and speed. Select fixed Speed, Balanced, and Quality programs for use after search.

v(p) = (q1(p), …, qm(p), T(p0)/T(p)) Eq. (5)

Examples of discovered loops

Different models lead to different loop structures, update rules, and ways to reuse memory or reference features.

BackboneModalityStructureDynamicsControl & Reuse
Scale-RAE / RAEImage · Unlooped DiTLayerwise middle band (12–27) / modality-split sparse (19–22)Damped / split Euler + LoopGuidanceEarly-half looping, periodic ref refresh & prefix sharing
Looped-DiT-B32Image · Pretrained Looped DiTAdaptive per-step depth redistribution (Kt ∈ {4, 2})Dual-stream latent extrapolation & damped AB2Curvature-warped SNR schedule & cached text preamble
Qwen3-4BText · Unlooped LLMNon-overlapping dual windows [14]+[15..18] & [25..28] (K=3)Post-L14 tapered RK3 & anchored Ralston RK3Full-token FP32 updates; read-only probes, single KV commit
Dory1.0-4BText · Pretrained Looped LLMWeight-tied elastic recurrent block (K ∈ {2, 3, 4})Spherical velocity / geodesic extrapolation & annealed injectionMatched-K compute (1.17× at K=2 STEM); last-loop / per-loop KV
LongLive 2.0 / 1.0Video · World ModelContiguous middle window (11–18 5B / 11–17 1.3B, K ∈ {4, 6, 8})Windowwise Euler (step size 1/K)High-noise steps only; final-pass causal KV commit
Wan2.1-1.3BVideo · Short-Video DiffusionCond. cross-attn on 10–13 (K=3) or 3 windows (K=2)Convex ODE weights / curvature-lookahead RK2Early-to-mid noise window, CFG decay & interval-5 reuse
03 · Qualitative Showcase

Compare videos and image details

Inspect frame-accurate world-model revisit memory on LongLive 2.0 (5B) and 5-way image comparisons on Scale-RAE and RAE.

LongLive 2.0 (5B) Departure & Revisit Memory Retention

Baseline (No Loop · Frozen 5B) Native Rollout
ELP (Ours · Frozen Weights) Blocks 11–18, K=6
00.0s / 15.8s

Text Rendering, Color Attribution & Object Composition

Interactive Side-by-Side Slider

Drag horizontally to compare any baseline against ELP (Ours).

ELP Ours image
Baseline comparison image
↔
Baseline ELP (Ours)
04 · Quantitative Benchmarks

Results across image, text, and video

Explore frozen-program evaluations across Image diffusion, Text reasoning LLMs, and Video world & diffusion models.

Table 1a: Text-to-Image Diffusion Models Trained without Loops

Speedup reports baseline / program inference FLOPs relative to standard Baseline and Loop + LoopGuidance (LG). ELPqualityultra uses a stronger target model and is shown unranked for reference.

Backbone & MethodStepsTFLOPs ↓Speedup vs. Base ↑Speedup vs. Loop+LG ↑GenEval (%) ↑DPG-Bench (%) ↑
Backbone: Scale-RAE (Unlooped Baseline: 25 steps)
Baseline2531.581.00×2.29×51.6477.21
Loop w/o LG2556.040.56×1.29×57.0480.00
Loop + LG2572.460.44×1.00×58.5679.71
ELPspeed (Ours)1019.561.61×3.71×60.5480.19
ELPquality (Ours)1427.131.16×2.67×60.9880.19
ELPqualityultra (Ours, unranked)1631.231.01×2.32×61.6380.22
Backbone: RAE SigLIP2-B/DDT 615M (Unlooped Baseline: 50 steps)
Baseline5029.071.00×1.86×38.5670.91
Loop w/o LG5039.670.73×1.37×38.8772.44
Loop + LG5054.200.54×1.00×43.2874.68
ELPspeed (Ours)65.605.19×9.68×44.4274.96
ELPquality (Ours)109.333.12×5.81×44.9474.47

Table 1b: Pretrained Looped Diffusion Model (Looped-DiT-B32, Native K=4)

ELP reorganizes loop depth and step schedules at matched sampling step budgets.

SettingMethod#StepsTFLOPs ↓Speedup vs. Full ↑GenEval (%) ↑DPG-Bench (%) ↑
Full referenceLooped-DiT (Native K=4)10053.181.00×84.6585.34
Matched 14-stepLooped-DiT (Native K=4)147.457.14×79.3681.31
Matched 14-stepELPspeed (Ours)146.807.82×83.4385.11
Matched 25-stepLooped-DiT (Native K=4)2513.304.00×83.1684.76
Matched 25-stepELPquality (Ours)2513.304.00×85.0885.09

Scale-RAE Pareto trajectory across 9 search rounds (R0–R8).

Looped-DiT-B32 Pareto trajectory beyond native anchors under matched steps.

Table 1c: Text Reasoning on Unlooped Qwen3-4B

ELP outperforms both standard Non-looped inference and Fixed Loop on individual and aggregate STEM reasoning metrics.

Metric (%) ↑Non-loopedFixed LoopELP (Ours)
Individual Benchmarks
MMLU-STEM Acc62.4364.2064.72
GPQA-Main Acc31.9233.2634.82
ARC Acc50.6051.7151.71
ARC Acc Norm54.1854.9554.61
SciQ Acc95.7096.2096.50
Aggregate Scores
Micro Acc63.8165.0465.48
Micro Acc Norm64.2765.7265.91
Macro Group60.1661.3461.94
Macro Domain58.3759.6060.36

Dory1.0-4B Open-Ended Generative Reasoning, Coding & Instruction Following (8-Repeat Average)

Means across eight stochastic runs per prompt; speedups use ratios of means relative to native K=2 and K=4.

MethodIFBench
(%) ↑
GPQA Diamond
(%) ↑
SciCode
(%) ↑
Average
(%) ↑
Total
TFLOPs ↓
Wall Speedup
(K=2 / K=4) ↑
FLOPs Speedup
(K=2 / K=4) ↑
Native (K=2, per-loop KV)78.4870.3933.9060.9296,3001.00× / 1.72×1.00× / 1.67×
Native (K=4, per-loop KV)78.7171.0233.8161.18161,1980.58× / 1.00×0.60× / 1.00×
ELP (Ours, K=2, last-loop KV)78.9471.7234.0761.5895,7190.96× / 1.65×1.01× / 1.68×
ELP (Ours, K=2, per-loop KV)78.8871.5333.9461.4595,2231.00× / 1.72×1.01× / 1.69×

Dory1.0-4B Matched-K Multiple-Choice STEM Reasoning

Bold highlights the higher score within each matched-K pair (ties unbolded).

SettingMethodGFLOPs/tok ↓MMLUGPQAARCARC N.SciQMicro ↑M. Norm ↑M. Grp ↑M. Dom ↑
Matched K=2Native11.0354.6928.5747.7849.6695.0059.6460.1456.5151.98
Matched K=2ELP (Ours)9.45 (1.17×)55.0230.1346.7648.2195.2059.6960.0756.7852.93
Matched K=3Native14.7455.0228.7947.9549.8394.9059.8160.2956.6752.15
Matched K=3ELP (Ours)14.7455.6730.1349.3250.8595.3060.6860.9757.6153.05
Matched K=4Native18.4455.5429.6948.8949.9194.6060.2960.6857.1853.02
Matched K=4ELP (Ours)18.4456.0730.8049.4950.5195.1060.8961.2157.8653.96

Relative Revisit Drift Cut (LPIPS ↓) & Semantic Gain (CLIP ↑) on RememBench T2V

Scale: 0%–70% LPIPS Cut

Bars plot LPIPS drift reduction on a 0%–70% scale alongside revisit CLIP cosine gains across all 100 RememBench scenes.

LongLive 2.0 5BLPIPS 0.3852 → 0.1492
+8.1% CLIP −61.3% LPIPS
LongLive 1.0 1.3BLPIPS 0.2609 → 0.1480
+6.3% CLIP −43.3% LPIPS
Self-Forcing 1.3BLPIPS 0.4874 → 0.3607
+15.7% CLIP −26.0% LPIPS
0% 20% 40% 60% 70% Cut

Table 1d: Long-Video Consistency on RememBench T2V (100 Scenes)

Cells report Mean (Median) across all 100 scenes. Higher CLIP & TempSSIM and lower LPIPS indicate stronger long-horizon consistency.

MethodCLIP ↑ Mean (Median)LPIPS ↓ Mean (Median)TempSSIM ↑ Mean (Median)
LongLive 2.0 5B (Baseline)0.8585 (0.9018)0.3852 (0.3910)0.9681 (0.9718)
ELP on LongLive 2.0 5B (Ours)0.9282 (0.9568)0.1492 (0.0974)0.9905 (0.9940)
LongLive 1.0 1.3B (Baseline)0.8670 (0.8919)0.2609 (0.2591)0.9819 (0.9839)
ELP on LongLive 1.0 1.3B (Ours)0.9218 (0.9526)0.1480 (0.1363)0.9869 (0.9903)
Self-Forcing 1.3B (Baseline)0.6585 (0.6705)0.4874 (0.4915)0.9780 (0.9801)
ELP on Self-Forcing 1.3B (Ours)0.7617 (0.7764)0.3607 (0.3427)0.9804 (0.9827)

Wan2.1-1.3B Short-Video Diffusion (256-Video VBench)

Speed and Balanced halve compute with strong consistency sub-dimensions, while Quality achieves the highest overall VBench score.

Method#StepsQuality (%) ↑Semantic (%) ↑Overall VBench (%) ↑TFLOPs ↓Speedup vs. Base ↑
Wan2.1 (50-step Base)5085.3983.0484.9228,3001.00×
Wan2.1 (30-step Base)3085.3380.5484.3716,9801.67×
ELP (Speed)2684.8580.3283.9411,9162.37×
ELP (Balanced)2684.9082.0384.3312,7652.22×
ELP (Quality)5085.2584.6185.1230,9040.92×
05 · Search Design Analysis (RQ2)

Which search choices help?

Controlled 80-candidate ablations on Scale-RAE isolate search space expressiveness, programmable diagnostics, search LLM, target strength, and objectives.

Table 2a: Search Space & Diagnostic Access

Executable program editing + runtime diagnostics outperform config-only and scores-only search.

Search TypeDiagnosticsPriorityGenEval (%) ↑DPG-Bench (%) ↑TFLOPs ↓
Config.YesSpeed55.0579.4517.34
Config.YesQuality59.8880.2623.65
ProgramNoSpeed52.4180.0511.99
ProgramNoQuality57.6379.6822.08
ProgramYesSpeed60.5480.1919.56
ProgramYesQuality60.9880.1927.13

Table 2b: Choice of Search LLM

Compared under the same True reference target and 80-candidate budget.

Search LLMPriorityGenEval (%) ↑DPG-Bench (%) ↑TFLOPs ↓Speedup (Base / w/ LG)
Gemini-4-ArgonSpeed57.3079.6425.531.24× / 2.84×
Gemini-4-ArgonQuality58.4880.1841.850.75× / 1.73×
GPT-6-AstraSpeed60.5480.1919.561.61× / 3.71×
GPT-6-AstraQuality60.9880.1927.131.16× / 2.67×

Table 2c: Target Strength

Stronger target prompts push Quality GenEval higher (up to 61.63%).

VariantTarget StrengthPriorityStepsGenEval (%) ↑DPG-Bench (%) ↑TFLOPs ↓
ELP (True)0.00%Quality2558.4880.1841.85
ELPstrong17.86%Quality2061.0380.4944.17
ELPultra29.28%Speed958.3280.4016.09
ELPultra29.28%Quality1661.6380.2231.23

Table 2d: Search Objectives

Single-metric optimization pushes individual benchmarks further at 20 steps vs. joint Speed/Quality Pareto.

ObjectivesPriorityGenEval (%) ↑DPG-Bench (%) ↑#Steps ↓
Joint (GenEval + DPG + Speed)Speed60.5480.1910
Joint (GenEval + DPG + Speed)Quality60.9880.1914
GenEval-only—63.1580.1520
DPG-only—56.0980.6120
06 · Citation

BibTeX

@misc{chen2026elp,
  title        = {Evolving Loop Programs: Discovering How Frozen Transformers Should Loop},
  author       = {Chen, Yang and Shen, Kaitai and Zhou, Xuemei and Long, Teng and Hu, Vincent Tao},
  year         = {2026},
  howpublished = {Research preprint},
  url          = {https://vibe-hust.github.io/elp_page/}
}