一个模型循环所有:语言模型的弹性潜在递归

·

研究论文 · 2026/10/12

潜在循环语言模型通过重复使用共享层块,使单一检查点能通过改变循环次数来权衡推理计算与准确率。但在单次循环时,这类模型通常远不及同等规模的非循环模型,这种“单循环税”使得在延迟敏感场景下,单独的非循环模型是更优选择。我们提出弹性潜在循环(ELR),一种训练无此税负的循环语言模型的方法。在单次循环时,ELR模型的 serving 成本与同等规模的非循环模型相同,且在相同数据上训练能达到相近准确率。此后每次额外循环通过增加推理计算来换取更高准确率。三个设计选择实现了这一点:带学习步长的门控状态更新、每次优化器更新中混合循环次数、以及每次传递以其循环索引和预算为条件。前两者保持单循环准确率,第三者降低每次额外循环的损失。混合深度可在预训练后期引入以限制额外训练成本,配合切换时添加的零初始化条件,这种后期安排比从头混合深度训练达到更低损失。在MoE模型中,后续循环复用首循环专家路由,将混合深度更新耗时减少11.7%,且准确率无可测量变化。推理时,仅保留最后循环的注意力KV缓存,使注意力KV内存保持单循环水平,同时保留额外循环的大部分增益。在4B密集和30B-A3B MoE混合模型上,单循环ELR在十任务平均上分别低于和高于匹配基线0.52和1.04分,四循环分别增加7.25和4.75分。经过后训练,该方法产出Koi-4B,单一检查点在单循环时估计在Artificial Analysis Intelligence Index上得分18,与Qwen3.5-4B相当,四循环时得分29。

该研究提出了一种消除循环语言模型单循环性能税的训练方法,使单一模型能灵活权衡推理计算与准确率,在延迟敏感场景下更具实用性,并在大规模模型上验证了有效性。

A latent recurrent language model applies a shared block of layers repeatedly, so one checkpoint can trade inference compute for accuracy by changing the loop count. At one loop, however, such models typically fall well short of a non-recurrent model of the same size, a one-loop tax that makes a separate non-recurrent model the better choice whenever latency matters. We present Elastic Latent Recurrence (ELR), a recipe for training looped language models without this tax. At one loop, an ELR model costs the same to serve as a non-recurrent model of the same size and, trained on the same data, reaches similar accuracy. Each additional loop then buys more accuracy for more inference compute. Three choices make this work: a gated state update with a learned step size, loop counts mixed within each optimizer update, and conditioning each pass on its loop index and budget. The first two preserve one-loop accuracy, and the third lowers loss at every additional loop. Mixed depths can be introduced late in pretraining to limit the added training cost, and with zero-initialized conditioning added at the switch, this late schedule reaches lower loss than mixed-depth training from scratch. In MoE models, reusing first-loop expert routes on later loops cuts mixed-depth update time by 11.7% with no measurable change in accuracy. At inference, keeping only the last loop's attention KV cache holds attention KV memory at its one-loop level while retaining most of the gain from additional loops. On 4B dense and 30B-A3B MoE hybrid models, ELR at one loop is 0.52 points below and 1.04 points above its matched baseline on a ten-task average, and four loops add 7.25 and 4.75 points. Carried through post-training, the recipe yields Koi-4B, a single checkpoint that scores an estimated 18 on the Artificial Analysis Intelligence Index at one loop, matching Qwen3.5-4B, and 29 at four loops.

阅读原文

参与讨论