Command Palette
Search for a command to run...
محول خليط الحلقات
محول خليط الحلقات
Lianghui Zhu Shijie Wang Xinggang Wang Jinze Bai Bo Wang Xiang Bai
الملخص
تعزز المحولات الحلقية قدرتها التعبيرية بإعادة استخدام الطبقات المشتركة عبر الحلقات، لكن ذلك يأتي على حساب الكفاءة. ويتطلب دفع حدود المقايضة بين القدرة التعبيرية والكفاءة إعادة التفكير في الآلية الجوهرية التي تربط الحلقات المتجاورة: ما الذي ينبغي تمريره عندما يكرر المحول حلقاته؟ نقدم محول خليط الحلقات (MoLT)، الذي تستخدم آليته الانتباهية المسماة انتباه خليط الحلقات (MoLA) المفاتيح والقيم (KV) بوصفها ذاكرة لإعادة الاستخدام الانتقائي عبر الأعماق والحلقات. وفي ظل البقايا الحلقية، يحتفظ MoLT-R بتيار البقايا ويقرأ المفاتيح والقيم المحلية عبر الحلقات لتعزيز القدرة التعبيرية. أما في ظل المفاتيح والقيم الحلقية، فيبدأ MoLT-KV من جديد انطلاقًا من التضمينات ويقرأ المفاتيح والقيم المحلية للحلقة الجارية مع مفاتيح وقيم ذاكرة الحلقة السابقة في المواضع الأسبق لتحقيق الكفاءة. ويلغي MoLT-KV الاعتماد عبر الحلقات في الموضع نفسه، وباقترانه مع الإجبار الحلقي للتدريب المتوازي، يتيح فك ترميز خليط الحلقات (MoL) باجتياز واحد يتجاوز أفق حلقات التدريب. ولموازنة الكفاءة والجودة، نقدم MoLT بشكل U (U-MoLT) الذي يفصل بناء الذاكرة عن قراءة التنبؤ ويتخطى اجتيازات وحدة فك الترميز غير المستخدمة دون تغيير التنبؤات. في التدريب المسبق على 400 مليار رمز، يتفوق U-MoLT على OLMo3 في النماذج الكثيفة 700 مليون و1.5 مليار معامل ونموذج خليط الخبراء 3 مليارات معامل، محققًا كفاءة رمزية في الإنتروبيا المتقاطعة للتحقق تبلغ 1.7 ضعفًا عند 700 مليون معامل، مع تحسين حيرة نموذج خليط الخبراء 3 مليارات معامل عبر 10 مجالات بمقدار 0.75 ودقة 10 مهام بمقدار 2.1 نقطة مئوية. وفي التدريب المسبق المستمر على 100 مليار رمز لنموذج Qwen3.5-0.8B-Base، يخفض تكييفنا باستخدام U-MoLT الإنتروبيا المتقاطعة في جميع المجالات الأحد عشر مقارنة بخط الأساس المطابق، محققًا كفاءة رمزية متوسطة تبلغ 1.4 ضعفًا. وعند الاستدلال، يضاهي U-MoLT مع MoL-Hybrid-2 زمن استجابة OLMo3 غير الحلقي عند 996.6 مقابل 1000.6 مللي ثانية على نماذج بحجم S (نحو 113 مليون معامل).
One-sentence Summary
Researchers from Huazhong University of Science & Technology, ByteDance Seed, and University of Toronto propose Mixture-of-Loops Transformer (MoLT), whose Mixture-of-Loops Attention uses keys and values as memory for selective reuse across depths and loops, and U-shaped MoLT (U-MoLT) separates memory construction from prediction readout while skipping unused decoder traversals without changing predictions; in 400B-token pretraining, U-MoLT outperforms OLMo3 across 700M/1.5B dense and 3B MoE models, achieving 1.7× validation cross-entropy token efficiency at 700M and improving 3B MoE 10-domain perplexity by 0.75 and 10-task accuracy by 2.1 percentage points.
Key Contributions
- Mixture-of-Loops Transformer (MoLT) with Mixture-of-Loops Attention (MoLA) uses keys and values as reusable memory across depths and loops. MoLT-R retains the residual stream and reads local KV across loops for expressivity, while MoLT-KV restarts from embeddings and reads current-loop local KV with preceding-loop memory KV at earlier positions to remove same-position cross-loop dependence.
- U-shaped MoLT (U-MoLT) separates memory construction from prediction readout and skips unused decoder traversals without changing predictions. With loop forcing and strict-prefix memory KV, it enables single-traversal Mixture-of-Loops (MoL) decoding beyond the training loop horizon and MoL-Hybrid decoding with parallel prefill.
- In 400B-token pretraining with the OLMo3 recipe, U-MoLT outperforms OLMo3 across 700M/1.5B dense and 3B MoE models, achieving 1.7× validation cross-entropy token efficiency at 700M and improving 3B MoE 10-domain perplexity by 0.75 and 10-task accuracy by 2.1 percentage points. In 100B-token continued pretraining of Qwen3.5-0.8B-Base, it lowers cross-entropy on all 11 domains with 1.4× mean token efficiency, and U-MoLT with MoL-Hybrid-2 matches non-looped OLMo3 latency at 996.6 vs. 1,000.6 ms on S-size (~113M) models.
Introduction
Foundation model architecture design must balance expressivity and efficiency. Looped Transformers improve expressivity by reusing parameters across repeated loops, but prior designs mainly pass information through a residual stream across loops. This repeated compression can dilute information, and same-position cross-loop dependence forces sequential loop execution at inference. The authors propose Mixture-of-Loops Transformer (MoLT), which treats computed keys and values as reusable memory across depths and loops. Its Mixture-of-Loops Attention lets each layer attend to KV from different depths and loops, while MoLT-KV and U-MoLT remove same-position loop dependence so a plain stack can decode in a single traversal beyond the training loop horizon.
Method
The authors introduce the Mixture-of-Loops Transformer (MoLT), a framework that leverages Key-Value (KV) pairs as memory for selective reuse across depths and loops. At the core of this architecture is the Mixture-of-Loops Attention (MoLA) module, which allows each layer to jointly attend to sequence context and same-position depth sources within a single attention distribution. Unlike standard looped Transformers that rely solely on a recurrent residual stream, MoLT provides flexible feedback interfaces to carry computation forward.
The framework defines two primary feedback forms. The first, MoLT-R, utilizes loop residual feedback. It carries the preceding loop's final state into the next loop while retaining local KV to make intermediate representations directly readable. This approach prioritizes expressivity by allowing MoLA to selectively read current-loop and preceding-loop local KV at the same token position, mitigating information dilution. The second form, MoLT-KV, prioritizes decoding efficiency. In this paradigm, each loop restarts afresh from token embeddings. It reads memory KV projected from the preceding loop's normalized output strictly at earlier positions, combined with current-loop local KV. This strict-prefix masking and embedding restart remove same-position cross-loop dependencies, enabling single-traversal decoding.
To balance efficiency and quality, the authors propose U-shaped MoLT (U-MoLT), which separates memory construction from prediction readout. U-MoLT employs a looped MoLT Encoder to build feedback memory across loops using the loop KV paradigm. A separate, causal, cross-only MoLT Decoder then reads the normalized encoder output to predict the next token. This architectural split isolates the responsibilities of preserving high-fidelity historical context and collapsing hidden states toward the next-token distribution, preventing the representational degradation often seen in deep autoregressive layers.
Training the MoLT family relies on a multi-loop objective combined with loop forcing. The authors supervise next-token predictions at successive loops of the shared network. For a given loop count N, the total loss is a weighted sum of the per-loop cross-entropy losses. In MoLT-KV and U-MoLT, applying this objective with positive weights on every loop constitutes loop forcing. Analogous to teacher forcing, each feedback loop trains in parallel across token positions from the preceding loop's strict-prefix memory KV rather than from sequentially decoded prefixes. This reduces the training complexity from sequential steps to parallel passes and allows gradients to refine earlier computations that produce the feedback sources.
During inference, the authors introduce Mixture-of-Loops (MoL) decoding to exploit the efficiency of the loop KV paradigm. Because embedding restart and strict-prefix memory reads eliminate same-position cross-loop dependencies, each feedback loop reduces to a strictly triangular recurrence across token positions. MoL decoding processes the prompt and generates tokens using a single traversal of the shared stack per token. It jointly reads completed prefix memory KV and current-loop local KV, appending new memory KV to the cache for subsequent tokens. To further optimize, MoL-Hybrid decoding combines fixed-loop parallel prefill with the MoL decoding update, initializing prompt memory KV from the final prefill loop and preserving the cross-token recursion over continuation positions while matching the inference costs of non-looped Transformers.
Experiment
The experiments evaluate MoLT variants through S-size component ablations, scaling runs for dense and MoE models, inference schedules, and continued pretraining adaptation of Qwen3.5-0.8B-Base. Ablations show that residual looping, direct depth access, and independent decoder KV projections improve prediction quality, while scaling confirms U-MoLT and MoLT-R gains at larger sizes and faster convergence. MoL-Hybrid decoding reduces latency with only small perplexity changes, and the Qwen adaptation improves all validation domains with modest parameter overhead and faster token-matched convergence.
The comparison separates non-looped memory reuse methods, which typically decode in a single traversal, from looped methods that require multiple traversals per generated token. Non-looped approaches vary in prefix memory source, including layer-mixture memory, shared top-layer KV, and layer-output KV, while MoDA uniquely adds same-token depth KV. Looped designs such as LPT, PLT, and Universal YOCO rely on residual or shifted residual loop input and pay multiple encoder or decoder traversals. Non-looped methods including Feedback Transformer, LCKV, and Recurrent Transformer all complete a single traversal per token but differ in whether sequence KV comes from layer mixtures, shared top layers, or layer outputs. MoDA is the only compared method that combines current sequence KV with same-token depth KV in one pass, while looped methods use residual or shifted residual loop inputs and require multiple traversals per token.
Ablations on S-size models show that moving from one loop to two loops improves validation loss at the same parameter count, and expanding depth access within and across loops yields further gains. The depth-source benefits persist with sparse placement, though two-loop training adds logical FLOPs and update time. Residual looping improves validation CE without changing the parameter count. Direct depth access strengthens feedback: current-loop cross-layer sources add a small gain, and preceding-loop sources add a larger gain. Adding depth KV lowers the best MoLT-R validation CE without adding parameters, and the preceding-loop gain also holds with sparse placement. The two-loop recipe doubles logical training FLOPs and increases update time relative to the single-loop baseline.
Across the tested loop-loss weight ratios, the second loop consistently achieves lower validation cross-entropy than the first loop. Shifting loss weight toward the second loop improves its validation CE while slightly worsening the first-loop validation CE. This indicates a trade-off where emphasizing the final loop yields better final-loop predictions at some cost to the earlier loop. The second loop's validation CE decreases as its relative loss weight increases. The first loop's validation CE worsens as loss weighting shifts toward the second loop.
Final-checkpoint downstream accuracy shows consistent gains for MoLT variants over OLMo3 baselines across 700M dense, 1.5B dense, and 3B MoE scales. At 700M, MoLT-R and U-MoLT both raise mean accuracy to about 59 percent, with MoLT-R leading aggregate and U-MoLT leading on OpenBookQA, COPA, and MMLU. U-MoLT also improves broad task performance at larger scales, including all ten tasks on the 3B MoE model. U-MoLT improves mean downstream accuracy over OLMo3 at every evaluated scale. At 700M dense, MoLT-R achieves the highest aggregate accuracy in its block, while U-MoLT nearly matches it and leads on OpenBookQA, COPA, and MMLU. At 1.5B dense, U-MoLT improves nine tasks and ties ARC-E, raising average accuracy above the OLMo3 baseline. On the 3B MoE model, U-MoLT improves all ten downstream tasks.
Across the ten text domains, MoLT variants lower validation perplexity relative to the OLMo3 baseline, with improvements in every domain at each reported model scale. The gains are broad rather than concentrated in a few domains, and the best perplexity in each model block belongs to a MoLT variant. The trend also holds for the reported MoE configuration, where average perplexity declines. In the 700M dense block, MoLT-R and U-MoLT both improve perplexity across all ten domains, with the lowest domain perplexities split between the two MoLT variants. At the reported MoE scale, U-MoLT improves perplexity in every domain and lowers average perplexity from 13.99 to 13.24.
The experiments compare non-looped and looped memory reuse designs, with MoDA as the only compared method that combines current sequence KV with same-token depth KV in one pass, while looped methods require multiple traversals per token. Ablations show that two loops, residual looping, direct depth access, and depth KV improve validation loss at fixed parameters, though two-loop training increases logical FLOPs and update time, and shifting loop-loss weight toward the second loop improves final-loop cross-entropy at a small cost to the first loop. Downstream and perplexity evaluations show MoLT variants, particularly U-MoLT, consistently improve over OLMo3 baselines across 700M dense, 1.5B dense, and 3B MoE scales, with lower validation perplexity in every text domain at each reported scale.