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

RAP: 用于大语言模型推理的运行时自适应剪枝

RAP: Runtime Adaptive Pruning for LLM Inference

Faculty of Science and Technology, University of Macau, Macau, China(澳门大学科学与技术学院);School of Information and Software Engineering, University of Electronic Science and Technology of China, Chengdu, China(电子科技大学信息与软件工程学院)

Huanrong Liu, Chunlin Tian, Xuyang Wei, Qingbiao Li, Li Li

AI总结:

本文提出RAP,一种基于强化学习的弹性剪枝框架,通过动态调整压缩策略来适应运行时内存变化和异构KV缓存需求,首次在推理过程中同时考虑模型权重和KV缓存。

摘要:

大语言模型(LLMs)在语言理解和生成方面表现出色,但其巨大的计算和内存需求限制了部署。压缩提供了一种潜在的解决方案来缓解这些约束。然而,大多数现有方法依赖于固定的启发式方法,因此无法适应运行时内存变化或来自多样化用户请求的异构KV缓存需求。为了解决这些限制,我们提出了RAP,一种由强化学习(RL)驱动的弹性剪枝框架,能够以运行时感知的方式动态调整压缩策略。具体而言,RAP动态跟踪实际执行过程中模型参数与KV缓存之间的演变比例。认识到前馈网络(FFNs)包含大部分参数,而参数轻量的注意力层主导KV缓存的形成,RL代理只保留那些在当前内存预算内最大化效用的组件,基于即时的工作负载和设备状态。广泛的实验结果表明,RAP优于最先进的基线方法,标志着首次在推理过程中同时考虑模型权重和KV缓存。

英文摘要:

Large language models (LLMs) excel at language understanding and generation, but their enormous computational and memory requirements hinder deployment. Compression offers a potential solution to mitigate these constraints. However, most existing methods rely on fixed heuristics and thus fail to adapt to runtime memory variations or heterogeneous KV-cache demands arising from diverse user requests. To address these limitations, we propose RAP, an elastic pruning framework driven by reinforcement learning (RL) that dynamically adjusts compression strategies in a runtime-aware manner. Specifically, RAP dynamically tracks the evolving ratio between model parameters and KV-cache across practical execution. Recognizing that FFNs house most parameters, whereas parameter -light attention layers dominate KV-cache formation, the RL agent retains only those components that maximize utility within the current memory budget, conditioned on instantaneous workload and device state. Extensive experiments results demonstrate that RAP outperforms state-of-the-art baselines, marking the first time to jointly consider model weights and KV-cache on the fly.

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

↑