arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.12582cs.CL
收藏

一统循环:面向语言模型的弹性隐式循环(ELR)

One Model to Loop Them All: Elastic Latent Recurrence for Language Models

NVIDIA(英伟达)

Faisal Ladhak, Shantanu Acharya, Santiago Akle Serano, Simeng Sun, Boris Ginsburg, Krishna C Puvvada

AI总结:

本研究提出弹性隐式循环(ELR)方案,解决隐式循环语言模型的单循环损耗问题,在单循环时性能接近同规模非循环模型,多循环时可提升准确率,最终得到Koi-4B模型。

摘要:

隐式循环语言模型会重复应用共享的层块,因此单个检查点可通过调整循环次数,在推理计算量与准确率之间进行权衡。然而,当仅执行一次循环时,这类模型通常远不及同等规模的非循环模型,这种“单循环损耗”使得只要延迟至关重要,单独的非循环模型就是更优选择。我们提出弹性隐式循环(Elastic Latent Recurrence, ELR),一种可训练循环语言模型且避免该损耗的方案。在单循环时,ELR模型的服务成本与同等规模的非循环模型相同,且在相同数据上训练后能达到相近的准确率;每增加一次循环,即可用更多推理计算量换取更高准确率。该方案的成功依赖三个关键选择:带学习步长的门控状态更新、每次优化器更新内混合循环次数、以及每次前向传播以其循环次数和预算为条件。前两者保障了单循环准确率,后者则降低了每增加一次循环的损失。可在预训练后期引入混合深度以限制额外训练成本,且在切换时添加零初始化条件,这种后期调度方案的损失低于从头开始的混合深度训练。在MoE模型中,复用第一循环的专家路由至后续循环,可将混合深度更新时间缩短11.7%且准确率无明显变化。推理时,仅保留最后一次循环的注意力KV缓存,可将注意力KV内存维持在单循环水平,同时保留大部分额外循环带来的增益。在4B稠密模型和30B-A3B MoE混合模型上,ELR在单循环时的十任务平均得分比匹配基准低0.52个点、高1.04个点,四次循环则分别提升7.25和4.75个点。将该方案应用于后训练后,得到Koi-4B,单个检查点在单循环时的人工分析智能指数估计得分为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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑