arXiv: 2604.18396 · PDF

作者: Yingtao Shen, An Zou

主分类: cs.CL · 全部: cs.CL

命中关键词: large language model, llm, reasoning, inference, kv cache, latency


TL;DR

River-LLM 提出训练无关的 token 级 Early Exit 框架,用 KV-Shared Exit River 解决 decoder-only 架构中 KV Cache 缺失问题,实现 1.71–2.16× 推理加速。

核心观点

  • 指出 decoder-only Early Exit 的核心瓶颈是 KV Cache Absence:被跳过的层无法为后续 token 提供历史状态。
  • 已有 recomputation / masking 方案要么延迟高,要么精度损失大,理论层数缩减难以转化为实际 wall-clock 加速。
  • 提出训练无关(training-free)的 River-LLM,通过共享 KV 的 “Exit River” 在退出过程中自然生成并保留缺失的 KV cache。
  • 利用 decoder block 之间的 state transition similarity 预测累计 KV 误差,指导更精确的退出决策。

方法

  • KV-Shared Exit River:一条轻量旁路,让主干缺失的 KV 在退出路径上被顺带生成并写回,避免昂贵的 recomputation 或 masking。
  • 误差感知退出策略:基于相邻 decoder block 的状态转移相似度,估计累计 KV 误差,作为是否提前退出的判据。
  • 整个框架无需重新训练或微调,可直接叠加在已有 LLM 上做 token 级动态退出。

实验

  • 任务:数学推理与代码生成。
  • 指标:实际 wall-clock 加速比与生成质量。
  • 基线:摘要未具体列出,暗示对比 recomputation / masking 类 Early Exit 方案。

结果

  • 实现 1.71×–2.16× 实测加速,同时保持较高生成质量。
  • 具体模型规模、数据集名称、精度数字在摘要中未披露。

为什么重要

对 LLM 推理基础设施:首次把 Early Exit 在 decoder-only 架构下做到"理论层数削减 ≈ 实际加速",且无需训练,部署成本低,适合高吞吐服务场景。

与已有工作的关系

  • 延续 Early Exit / 层级跳过 的加速思路(DeeBERT、CALM、SkipDecode 等)。
  • 针对 decoder-only KV cache 问题,与 recomputation、attention masking 类方案直接对比。
  • 与 KV cache 压缩 / 复用(如 H2O、StreamingLLM)思路互补,但关注点在"跳过层后的 KV 填补"。

尚未回答的问题

  • 在更大模型(70B+)和长上下文下 KV-Shared River 的额外显存 / 带宽代价。
  • 对非推理类任务(对话、摘要、RAG)的泛化性。
  • 与 speculative decoding、量化、稀疏注意力等加速技术的叠加效果。
  • state transition similarity 作为误差代理的理论保证与失败模式。

论文图表

图 1: Page 2 (rendered)

图 1

图 2: Page 3 (rendered)

图 2

图 3: Page 4 (rendered)

图 3


原始摘要

Large Language Models (LLMs) have demonstrated exceptional performance across diverse domains but are increasingly constrained by high inference latency. Early Exit has emerged as a promising solution to accelerate inference by dynamically bypassing redundant layers. However, in decoder-only architectures, the efficiency of Early Exit is severely bottlenecked by the KV Cache Absence problem, where skipped layers fail to provide the necessary historical states for subsequent tokens. Existing solutions, such as recomputation or masking, either introduce significant latency overhead or incur severe precision loss, failing to bridge the gap between theoretical layer reduction and practical wall-clock speedup. In this paper, we propose River-LLM, a training-free framework that enables seamless token-level Early Exit. River-LLM introduces a lightweight KV-Shared Exit River that allows the backbone’s missing KV cache to be naturally generated and preserved during the exit process, eliminating the need for costly recovery operations. Furthermore, we utilize state transition similarity within decoder blocks to predict cumulative KV errors and guide precise exit decisions. Extensive experiments on mathematical reasoning and code generation tasks demonstrate that River-LLM achieves 1.71 to 2.16 times of practical speedup while maintaining high generation quality.