arxiv.org·2026/10/23
循环架构用同一块层重复计算扩展质量,但每次迭代都生成独立KV缓存,内存随深度线性增长;复用最终迭代缓存的KV-shareability在部分模型中不稳定。方法先以stochastic depth预训练诱导收缩残差动态,再用BeNice!后训练把末轮KV缓存广播到首轮并训练兼容残差。在Parcae模型上与标准微调、MLA/KDA及量化组合评估,作者报告BeNice!使共享Core/Core-Extended最高提升8.35和4.56点,共享验证困惑度较标准微调改善9.75 PPL,吞吐最高提升23.6%,p90 TTFT最高降83.6%。结论:KV-sharing与KV压缩正交,将内存与测试时迭代解耦,但需随机深度预训练与后训练配对。
为什么重要 Looped 架构参数不随深度涨但 KV-cache 线性膨胀;本文把深度维内存归一,长上下文与边缘推理的显存预算直接受益。适合 推理基础设施与长上下文部署工程师、循环架构方向研究者
循环架构通过反复将激活传递通过同一组层,在保持参数数量固定的同时扩展质量。在推理过程中,每次循环都会生成独立的 KV-cache,导致内存线性增长。
为应对这一挑战,先前工作提出了 KV 共享(即跨深度共享 KV-cache),并发现在某些情况下,最后一次循环的 KV-cache 可以与较早循环共享而不损失质量,我们将这一特性称为 KV 可共享性。然而,KV 可共享性背后的机制仍不清楚,即使是相同训练的循环架构也不一定一致表现出这一特性。
在本文中,我们研究如何在循环模型中启用 KV 可共享性。我们提出一种两阶段方法:第一阶段,在预训练期间使用随机深度,诱导收缩性残差动态,使表示在多次循环中趋向一个共同极限。第二阶段,我们提出 BeNice!,一种后训练方法,将最后一次循环的 KV-cache 广播到第一次循环中,训练其产生兼容的残差,同时保持原始模型的质量。
因此,BeNice! 实现了 KV 可共享性,同时与标准微调的非共享验证困惑度相匹配。使用 BeNice!,我们表明 KV 共享与替代性 KV 压缩方法互补,可与内存高效的序列混合器(例如 multi-latent attention、Kimi delta attention)以及低精度 KV-cache 量化(例如 fp8、mxfp8、nvfp4)组合。
最后,在模拟的低内存、长上下文推理中,KV 共享将缓存命中率提高最多 31.4%,吞吐量提高最多 23.6%,并将 p90 time-to-first-token 减少最多 83.6%。
Looped architectures scale quality while keeping parameter count fixed by repeatedly passing activations through the same block of layers.
During inference, each recurrence generates independent KV-caches, causing memory to grow linearly.
To address this challenge, prior work has proposed KV-sharing (i.e., sharing KV-caches across depth), finding that, in some cases, the KV-cache of the final recurrence can be shared with the earlier recurrences without quality loss, a property we denote as KV-shareability.
However, the mechanisms underlying KV-shareability remain poorly understood, with even identically trained looped architectures not consistently exhibiting it.
In this paper, we study how KV-shareability can be enabled in looped models.
We propose a two-stage method: in the first stage, we use stochastic depth during pretraining, which induces contractive residual dynamics that drive representations toward a common limit across recurrences.
In the second stage, we propose BeNice!
, a post-training method that broadcasts the final recurrence's KV-cache into the first recurrence, training it to produce compatible residuals while preserving the original model's quality.
As a result, BeNice! enables KV-shareability while matching standard finetuning's unshared validation perplexity. Using BeNice!
, we show that KV-sharing is complementary to alternative KV-compression methods, composing with memory-efficient sequence mixers (e.g., multi-latent attention, Kimi delta attention) and low-precision KV-cache quantization (e.g., fp8, mxfp8, nvfp4).
Finally, in simulated low-memory, long-context inference, KV-sharing improves cache hit rates by up to 31.4%, increases throughput by up to 23.6%, and reduces p90 time-to-first-token by up to 83.6%.
缓存命中率
8.1 个百分点,2 req/s
吞吐
高负载 2 req/s 时
p90 TTFT
139.2s→23.2s
全局 HBM
63.82GB→21.60GB
token 容量
μrec=8;μrec=16 时 6×
注释 · 作者报告:Mooncake 生产请求回放,1.3B Parcae,含权重与 CUDA graph 显存出自 §5.3
注释 · fineweb-edu 验证集;1.3B 同趋势:18.52 vs 共享 10.78出自 表 5


EVIDENCE / METHODS
解读
术语解释残差流随循环迭代收敛到不动点;谱半径小于 1 防状态爆炸让 KV 收敛到公共极限,但误差残留于首循环第一层
问题:术语解释同一块层反复前传换质量、参数量固定的模型(Parcae/Huginn/Ouro)反复前传同一块层换质量,Mθ=O(P) 不随循环数 T 增长,但每个循环独立生成 KV-cache,Mkv=O(LDdkv) 随 T 线性膨胀;MLA/GQA/KDA 只压缩 Ldkv,不动深度维 D。
机理:术语解释逐序列随机采样循环深度(Poisson),迫使各深度下表征收敛一致逼一套共享权重在多个深度下都产出低损失表征,残差流被压向公共不动点,KV 随之收敛——替换中间 cache 的注意力输出扰动被输入残差差值上界约束。但收缩不保证共享/不共享收敛到同一不动点:误差集中在首个循环的第一层(770M 只补这层 KV,PPL 即从全共享的 34.24 恢复到 11.86),且误差子空间内 token 两两余弦相似度 0.99,即 token 无关的基偏移。BeNice! 把这个修正直接训进权重。
注释 · 读懂这段才能判断自己的 looped 模型该不该上 KV-sharing出自 §1、§3.1–3.2
原版排版与图表 · 手机无法内嵌时可在浏览器打开。PDF 插件内选文不能传给网页助手。