循环语言模型中的延迟进入
研究论文 · 2026/11/19
循环语言模型通过每个token迭代共享层堆栈T次来加深推理,但增加了顺序解码延迟。传统早退解码在初始传递后停止,未完成缓存,截断了过去token的键值状态。本文研究相反策略——晚进入:新token跳过初始传递,直接进入最后K<T次传递,利用深度上下文缓存。轻量微调解决入口边界处的隐藏状态范数不匹配后,深度缓存上下文可替代跳过的token局部传递,使晚进入在多种模型和传递预算下优于匹配的早退。为在不等待构建深度缓存的情况下实现实际加速,候选块仅在关键路径上验证最后K次传递,而已提交的token在后续步骤中完成1->T次传递,无额外串行调用。在现有输出GEMM中投影这些完成的T次传递唤醒状态(唤醒验证,由logit边际容差tau控制),将贪心精确T次传递解码(tau=0)、边际门控验证(tau>0)和无回滚有损晚进入(tau=inf)统一在单个静态CUDA图中。在Ouro-2.6B(T=4)上,K=2 Wake在tau=0时达到5.2倍贪心精确加速(GSM8K上比K=4块解码快26%),tau=inf时达到6.8倍(匹配速度下比训练早退高16.9分)。在Huginn-3.5B上扩展测试时循环T∈{8,16,32,64},K=T/4回滚随深度减少21.5倍,贪心精确(tau=0)加速达6.1倍(T=32)和8.4倍(T=64,比K=64块快153%),tau=inf加速达10.6至12.5倍。
该论文提出了一种新颖的晚进入解码策略,通过利用深度缓存上下文和Wake验证机制,在循环语言模型中实现了显著的推理加速,同时保持或提升了准确性,为高效推理提供了新思路。
Looped language models deepen reasoning at a compact parameter count by iterating a shared layer stack T times per token, turning recurrence depth directly into sequential decoding latency. Conventional early-exit decoding halts after initial passes without cache completion, truncating cached key-value states of past tokens to shallow depth. We study the opposite strategy, late entry, where new tokens skip initial passes and enter directly into the final K < T passes over a deep context cache. Once lightweight fine-tuning resolves hidden-state norm mismatch at the entry boundary, deep cached context substitutes for skipped token-local passes, allowing late entry to outperform matched early exit across model families and pass budgets. To turn this asymmetry into wall-clock speedups without stalling to build deep caches, candidate blocks verify through only the final K passes on the critical path while previously committed tokens complete passes 1 -> T alongside subsequent steps at zero extra serial calls. Projecting these finished T-pass wake states inside the existing output GEMM (Wake verification, governed by logit-margin tolerance tau in [0, inf]) unifies greedy-exact T-pass decoding (tau = 0, matching K = T block decoding within bf16 reduction order), margin-gated verification (tau > 0), and non-rollback lossy late entry (tau = inf) inside a single static CUDA graph. On Ouro-2.6B (T = 4), K = 2 Wake reaches 5.2x greedy-exact speedup at tau = 0 (+26% over K = 4 block decoding on GSM8K) and 6.8x at tau = inf (+16.9 points over trained early exit at matched speed). Scaling test-time recurrence across T in {8, 16, 32, 64} on Huginn-3.5B cuts K = T/4 rollbacks 21.5x with depth, driving greedy-exact (tau = 0) speedups to 6.1x (T = 32) and 8.4x (T = 64, +153% over K = 64 block) and tau = inf speedups to 10.6 to 12.5x.