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

River-LLM:基于KV共享的大型语言模型无缝退出

River-LLM: Large Language Model Seamless Exit Based on KV Share

Shanghai Jiao Tong University(上海交通大学)

Yingtao Shen, An Zou

AI总结:

针对解码器-only架构中早期退出因KV缓存缺失导致的延迟和精度问题,提出无需训练的River-LLM框架,通过轻量级KV共享退出流实现令牌级无缝退出,并利用状态转移相似性预测KV误差指导退出决策,在数学推理和代码生成任务上获得1.53-2.16倍实际加速且保持高质量。

摘要:

大型语言模型(LLM)在多个领域展现出卓越性能,但日益受到高推理延迟的制约。早期退出通过动态跳过冗余层加速推理,成为一种有前景的解决方案。然而,在仅解码器架构中,早期退出的效率受到KV缓存缺失问题的严重瓶颈,即跳过的层无法为后续令牌提供必要的历史状态。现有解决方案(如重新计算或掩码)要么引入显著延迟开销,要么导致严重精度损失,未能弥合理论层减少与实际墙钟加速之间的差距。本文提出River-LLM,一个无需训练的框架,能够实现无缝的令牌级早期退出。River-LLM引入轻量级KV共享退出流,使得骨干网络的缺失KV缓存能够在退出过程中自然生成并保留,无需昂贵的恢复操作。此外,我们利用解码器块内的状态转移相似性来预测累积KV误差,并指导精确的退出决策。在数学推理和代码生成任务上的大量实验表明,River-LLM在保持高生成质量的同时,实现了1.53至2.16倍的实际加速。

英文摘要:

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.53 to 2.16 times of practical speedup while maintaining high generation quality.

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

↑