TL;DR
Looped Transformers pack the reasoning power of a deep neural network into a compact memory footprint by running a small stack of layers repeatedly—but that looping makes text generation painfully slow. LoopD fixes this by turning the model’s own first loop into a parallel "diffusion drafter" that guesses multiple future tokens at once, hiding the drafting work inside the same forward pass that verifies earlier tokens. On Ouro-1.4B, LoopD speeds up decoding by up to 5.76× while producing bitwise-identical outputs to standard autoregressive generation.
What Problem Does This Paper Address?
Looped Transformers decouple a model's effective depth from its parameter count: a model with $L$ layers applied $R$ times behaves like a $L \cdot R$-layer network while only storing $L$ layers in memory. That is great for memory-constrained devices, but terrible for latency.
In standard autoregressive decoding, every token must march sequentially through all $R$ loops before the next token can even begin. Because small-batch decoding is bottlenecked by memory bandwidth—streaming the same shared weights from memory over and over—a looped model generates text roughly $R$ times slower than a non-looped model of the same size.
Speculative decoding can help by drafting future tokens cheaply and verifying them in parallel. However, existing methods for looped models hit one of three walls:
- They draft only one token per step (e.g., LoopSpec).
- They rely on a separate auxiliary draft model (e.g., LoopAhead).
- They draft a block of tokens at once, but pause to alternate between drafting and verification (e.g., DFlash, Floodgates).
LoopD asks: Can we draft a whole block of tokens in parallel using the target model itself, without spending an extra sequential step?
Methods
LoopD combines two ideas: diffusion-based block drafting and cross-depth pipelining.
- Turning a shallow loop into a diffusion drafter: Keeping the original autoregressive weights frozen, the authors add lightweight "diffusion weights"—a learned mask embedding and rank-64 LoRA adapters on the attention and MLP projections—that activate only on mask tokens. To draft, LoopD appends $k$ mask tokens after the latest token and runs them through just the first loop. The mask tokens attend causally to the prefix and bidirectionally to each other, denoising all $k$ draft tokens in parallel in a single step.
- Diffusion distillation: The diffusion weights are trained by distilling from the frozen full-depth model (the teacher) on clean sequences into the shallow loop (the student) on masked blocks, using a loss that combines total-variation distance, KL divergence, and cross-entropy.
- Hiding drafting in the pipeline: Because the drafter only needs the key–value cache from the first loop, it doesn't have to wait for earlier tokens to finish all $R$ loops. LoopD issues the mask tokens in the exact same forward step that advances earlier tokens through deeper loops.
- Token-tree scheduling: Building on LoopAhead's Triton and CUDA-graph engine, LoopD keeps early-exit predictions from shallow loops as fallback branches. If a drafted token is rejected during full-depth verification, the pipeline doesn't stall—it simply switches to a partially computed fallback branch.
Datasets
- Training: 24,080 sequences generated by running Ouro-1.4B (with greedy decoding, up to 4,096 new tokens) on prompts from UltraChat, GSM8K (train), MATH (train), Magicoder OSS-Instruct, and CodeAlpaca.
- Evaluation: Five reasoning and coding benchmarks—GSM8K, MATH500, HumanEval, MBPP, and BBH—evaluated under greedy decoding at batch size 1 on an A100-SXM4-80GB GPU with block size $k=3$.
Key Insights and Ideas
- Memory-bandwidth-bound decoding makes extra tokens "free": Adding a few mask tokens to a forward pass that is already streaming the shared weights from memory costs almost nothing in wall-clock time.
- Self-contained drafting beats auxiliary models: By conditioning only on the first-loop cache, LoopD eliminates the need for a separate draft model and avoids sequential drafting steps.
- Tree scheduling is crucial for block drafts: Fixing the drafter and varying only the schedule reveals why the tree matters. Alternating drafting and verification yields 2.3–2.8× speedup; a plain 4-depth pipeline reaches 2.8–4.8×; adding the token-tree scheduler with early-exit fallbacks pushes it to 3.5–5.8×.
Key Results
On Ouro-1.4B ($R=4$), LoopD outperforms DFlash, LoopSpec, and LoopAhead on every benchmark while guaranteeing bitwise-identical outputs to greedy autoregressive decoding:
| Benchmark | DFlash | LoopSpec | LoopAhead | LoopD |
|---|---|---|---|---|
| GSM8K | 2.19× | 2.93× | 3.95× | 4.22× |
| MATH500 | 2.35× | 2.74× | 3.19× | 3.54× |
| HumanEval | 1.29× | 3.28× | 3.75× | 5.76× |
| MBPP | 1.64× | 2.98× | 3.74× | 4.36× |
| BBH | 3.21× | 2.73× | 3.64× | 3.88× |
- Step reduction: LoopD cuts the number of sequential recurrence steps per token by 6.2–8.7× (more than half of the $R \cdot k = 12\times$ theoretical maximum).
- Code shines brightest: The largest margin over LoopAhead appears on HumanEval (5.76× vs. 3.75×), where long, predictable code spans play to block drafting's strengths.
Limitations and Future Work
The paper does not include a dedicated limitations section. However, its experiments are scoped to greedy decoding at batch size 1 on a single 1.4B-parameter model (Ouro-1.4B). Extending LoopD to non-greedy sampling, larger batch sizes, or combining it with complementary per-loop optimizations like FlashLoop (which reduces per-loop compute and KV-cache memory) are natural next steps.
Summary updated