arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.19446cs.LG
收藏

深度循环语言模型的架构与键值(KV)重放

Architectures and KV Replay for Depth-Recurrent Language Models

Lucia Licakova, Niklas Schmidinger, Lukas Hauzenberger, Sebastian Böck, Sepp Hochreiter

AI总结:

该研究针对深度循环语言模型自回归解码时内存随深度增长的问题,提出循环混合模型、Parcae风格架构及带循环KV重放的循环Transformer等方法,实现KV状态共享并保持接近基准的性能。

摘要:

深度循环通过重复应用固定计算块来增加有效模型深度,但共享注意力参数不会共享不同循环迭代生成的键值(KV)状态,这会导致自回归解码期间内存随循环深度增长。我们在通用深度循环框架内研究如何通过架构和缓存共享方法降低内存成本:首先研究循环混合模型,其重复Transformer层栈,用循环mLSTM或门控DeltaNet块替换大部分注意力层,保留周期性Transformer注意力锚点;然后在Parcae风格架构中将循环限制在专用循环工作空间,并测试其稳定适配器作为循环混合模型的包装器;最后训练带循环KV重放的循环Transformer,仅选定循环迭代写入后续迭代可复用的KV状态,使模型在推理时使用相同的共享KV拓扑运行。我们发现循环混合模型需要足够频繁的注意力锚点,性能强烈依赖循环混合器;对于跨迭代KV共享,循环KV重放允许多次循环迭代复用相同KV状态,同时保持性能接近每个迭代使用单独KV缓存的完整循环Transformer。

英文摘要:

Depth recurrence increases effective model depth by repeatedly applying a fixed computation block. However, sharing attention parameters does not share the key-value (KV) states generated at different recurrence iterations, which causes memory growth with recurrence depth during autoregressive decoding. We study how to reduce this memory cost through architectural and cache-sharing approaches within a common depth-recurrent framework. We first study a looped hybrid that repeats a stack of Transformer layers, with recurrent mLSTM or Gated DeltaNet blocks replacing most attention layers and periodic Transformer attention anchors retained. We then restrict recurrence to a dedicated recurrent workspace in a Parcae-style architecture and test its stabilising adapter as a wrapper for the looped hybrid. Finally, we train a looped Transformer with recurrent KV replay, where only selected recurrence iterations write KV states that later iterations reuse. This trains the model to operate with the same shared KV topology used during inference. We find that looped hybrids require sufficiently frequent attention anchors, with performance depending strongly on the recurrent mixer. For cross-iteration KV sharing, recurrent KV replay allows multiple recurrence iterations to reuse the same KV states while retaining performance close to the full looped Transformer with separate KV caches for each iteration.

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

↑