Skip to content

About

LoopBridge: Should Prefill and Decode Loop Equally? A cache-foldable adapter untying prefill and decode loop counts across Ouro, Ouro-Thinking, Lev, and 26.4B sparse-MoE models (TML-d24-varloop, Inkling-2-Mini) in Day-0 vLLM.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

569 Commits

Folders and files

Repository files navigation


Looped language models run the same loop count for prompt prefill and token decode—even though at batch 1 prefill takes <3% of chain-of-thought wall time and decode takes >97%. LoopBridge unties prefill depth (m) from decode depth (n < m) using a tiny adapter (0.017–0.25% of parameters on 26.4B sparse-MoE; 2.4% on Ouro-2.6B) that folds into the prompt KV cache once after prefill, preserving Original n/n's native decode speed (<1% overhead) in both PyTorch and vLLM.

Fully Open-Source in this Repo (MIT): Every piece of LoopBridge is publicly released—full training & evaluation code (ouro/, inkling/), live Day-0 vLLM Policy I-exact multi-turn serving (inkling/vllm_loopbridge.py), all raw per-item evaluation & timing logs, a one-command 0-diff paper verifier (1,424 assertions), plus all 24 SHA256-verified checkpoints and 9 datasets on Hugging Face and ModelScope.

LoopBridge shifts the accuracy-speed Pareto frontier across 26.4B sparse-MoE single-turn, 26.4B multi-turn agents, and 2.6B dense Ouro
Asymmetric looping (m/n, m > n) shifts the accuracy–speed Pareto frontier across benchmark averages (single GPU; up & right = better). (a) 26.4B Single-Turn (GPQA, GraphWalks 256K, MRCR 512K): 4/2 +5.3* at 1.73×, 4/1 +16.1* at 2.72×. (b) 26.4B Agents (BrowseComp-Plus & τ²-bench, 29,944 eps): r=0 4/3 matches 4/4 at 1.32×, 4/2 +3.2 at 1.82×, 4/1 +11.3 at 2.09×. (c) 2.6B Ouro (11-Bench Avg): 4/2 +5.4 at 2.12×, 4/1 +14.0 at 4.11×.


Core Results

26.4B Sparse-MoE Looped Models (TML-d24-varloop, Day-0 vLLM)

Unified official uncapped T=1.0, top_p=1.0, avg@4 single-turn benchmarks, full BrowseComp-Plus avg@2 (16,600 episodes, Qwen3-32B-FP8 judge), and external Qwen3-235B τ²-bench avg@4 (13,344 episodes) under live Policy I-exact APC serving:

Model (TML-d24-varloop) m/n GPQA GW 256K MRCR 512K 3-Bench Avg [128K Dec.] BrowseComp-Plus avg@2 τ²-bench avg@4
Original (native) 4/4 82.6 65.2 95.5 81.1 [1.00×] 49.4% (1.00×) 74.7% (1.00×)
Original (native) 3/3 83.5 62.2 90.1 78.6 [1.27×] 48.4% (1.37×) 73.7% (1.29×)
LoopBridge KV-Only (r=0, 0.025%) 4/3 82.6 62.4 84.6 76.5 [1.27×] 48.7% (1.35×) 75.4% (1.30×)
Original (native) 2/2 78.3 55.5 68.2 67.3 [1.72×] 40.5% (1.95×) 70.0% (1.65×)
LoopBridge KV-Only (r=0, 0.017%) 4/2 80.7* 57.2 70.6 69.5 [1.73×] 43.9%* (2.02×) 73.0% (1.63×)
LoopBridge (+merged LoRA, 0.25%) 4/2 80.2 60.7* 76.9* 72.6* [1.73×] 44.0%* (2.00×) 71.9% (1.68×)
Original (native) 1/1 69.6 20.2 21.5 37.1 [2.68×] 27.1% (2.49×) 50.5% (1.76×)
LoopBridge (+merged LoRA, 0.23%) 4/1 72.7 50.0* 36.8* 53.2* [2.72×] 39.5%* (2.66×) 60.6%* (1.64×)
LoopBridge (+merged LoRA, 0.13%) 3/1 71.1 42.8* 33.4* 49.1* [2.71×] 38.7%* (2.58×) 60.4%* (1.68×)

*95% task-clustered paired bootstrap CI excludes zero vs. equal-n Original. On multi-turn agents at n ≥ 2, the tiny frozen-decoder r=0 KV bridge (4.5–6.6M params, zero base-weight edits) suffices; on n ≤ 2 single-turn long-context and fixed-depth models, statically merged LoRA boosts accuracy with <0.3% latency overhead.

Multi-turn agentic Pareto frontier on BrowseComp-Plus, tau2-bench, and 64K hardware serving
Agentic & 64K live vLLM serving Pareto (single GPU, 94–96% APC). LoopBridge dominates equal-n baselines on BrowseComp-Plus (+12.4* at 4/1, +3.3* at 4/2) and τ²-bench (r=0 4/3 hits 75.4%, matching 4/4 at 1.30×), while cutting compute per solved task by up to 53% and shifting 64K serving throughput by 1.72–2.69×.

Dense Looped Models (Ouro-2.6B, Ouro-Thinking, Ouro-1.4B & Lev)

Method (Ouro-2.6B) m/n 11-Bench Avg 3-Seed Mean 800 CoT Acc Throughput (B=1)
Original 1/1 / Distilled 1/1 (KD) 1/1 44.2 / 49.5 — / 49.6 27.8% / 34.2% 28.3 (4.2×) / 26.6 (3.9×) tok/s
LoopBridge (ours) 4/1 58.2 58.3 ± 0.1 45.0% 27.7 tok/s (4.1×)
Original 2/2 / Distilled 2/2 (KD) 2/2 63.7 / 66.2 — / 66.1 57.1% / 59.2% 13.6 / 13.6 tok/s (2.0×)
LoopBridge (ours) 4/2 69.1 68.6 ± 0.4 62.5% 14.3 tok/s (2.1×)
Original 4/4 (ceiling) 4/4 71.9 — 69.1% 6.7 tok/s (1.0×)
  • Broad transfer: Ouro-2.6B-Thinking 4/2 matches 4/4 on batched GSM8K (94.6% vs. 94.3%) at 2.0× throughput (247 vs. 122 tok/s at B=16); Ouro-1.4B 4/1 jumps 34.7 → 44.5; Inkling-2-Mini 3/2 rescues fixed-depth collapse (2.2% → 57.7%, +5.7* vs. Distilled 2/2); and Lev gains across all 13/13 m > n pairs (+0.5 to +7.5, peaking at +4.4 to +7.5* at 1 decision loop).
More Visual Highlights (Per-Benchmark Breakdown, 512K Context Decay, Test-Time Scaling & Cost/Solved)
26.4B per-benchmark breakdown
26.4B Single-Turn Breakdown (GPQA, GW 256K, MRCR 512K)
MRCR 16K-512K capacity decay
512K Capacity Decay (4/2 extends ≥90% context 2× to 256K)
Parallel test-time scaling x LoopBridge
Parallel Test-Time Scaling (GPQA Maj@8 83.8%; BC+ Conf@4 61.2%)
Compute per solved task
Compute per Solved Task (up to −53% LLM-s/solved vs. 4/4)

All 17 figures, 25 tables, and 31 controlled appendix arms are documented in paper/loopbridge.pdf and mapped 1-to-1 in REPRODUCE.md.


How It Works

LoopBridge architecture diagram

  1. Foldable Prompt KV Bridge (r=0). The frozen backbone runs m prefill loops; lightweight cross-loop KV projections map deep prompt caches into the n-loop decode space and fold once after prefill—zero decode compute overhead (ouro/adapter_model.py, inkling/model.py).
  2. Optional Merged Decode LoRA. When decode weights also need adaptation (n ≤ 2 single-turn or fixed-depth backbones), decode-only LoRA is statically merged before serving (<0.3% latency delta).
  3. Policy I-exact Multi-Turn APC. In Day-0 vLLM (inkling/vllm_loopbridge.py), raw m-loop prompt blocks stay cleanly cached in Automatic Prefix Caching (94–96% hit rate) while decode reads a parallel folded shadow view.

Quick Start

# 1. Clone (full repo with per-item scores & logs; or sparse code-only clone < 6 MB below)
git clone https://github.com/yanghu819/loopbridge && cd loopbridge

# 2. Verify EVERY paper number & provenance hash on a CPU (~30s -> 0 discrepancies)
uv run --with numpy --with math-verify python inkling/verify_paper_numbers.py --with-ouro

# 3. Download all 24 SHA256-verified checkpoints & 9 datasets (Hugging Face)
pip install -U huggingface_hub
hf download yanghu819/LoopBridge --local-dir ./checkpoints
hf download --repo-type dataset yanghu819/LoopBridge-Data --local-dir ./loopbridge-data
for f in ./loopbridge-data/*.tar.gz; do tar -xzf "$f" -C ./loopbridge-data; done

# ModelScope mirror (Mainland China):
#   modelscope download --model torushy/LoopBridge --local_dir ./checkpoints
#   modelscope download --dataset torushy/LoopBridge-Data --local_dir ./loopbridge-data
Code-only lightweight clone (< 6 MB) & reproduction pointers
git clone --filter=blob:none --no-checkout https://github.com/yanghu819/loopbridge
cd loopbridge && git sparse-checkout set --no-cone '/*' '!ouro/results' '!inkling/results' && git checkout main
  • REPRODUCE.md — Exact script-to-table/figure map, GPU training launchers, and Day-0 vLLM evaluation commands.
  • docs/ARCHIVE.md — Full manifest of all 24 checkpoints, 9 datasets, and SHA256 provenance records.

Citation & License

@misc{hu2026loopbridge,
  title  = {LoopBridge: Should Prefill and Decode Loop Equally?},
  author = {Hu, Yang},
  year   = {2026},
  url    = {https://github.com/yanghu819/loopbridge}
}

Released under the MIT License. Third-party components under third_party/ouro/, ouro/licenses/, and inkling/licenses/ retain their upstream licenses.

About

LoopBridge: Should Prefill and Decode Loop Equally? A cache-foldable adapter untying prefill and decode loop counts across Ouro, Ouro-Thinking, Lev, and 26.4B sparse-MoE models (TML-d24-varloop, Inkling-2-Mini) in Day-0 vLLM.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages