根据输入提示动态选压缩等级,让大模型更省资源还更准
Different Prompts, Different Ranks: Prompt-aware Dynamic Rank Selection for SVD-based LLM Compression
- 用线性路由分析提示语,自动决定每条输入该用多高精度压缩
- 在LLaMA-7B上压缩到60%大小时,平均准确率提升10%
- 适合追求高效部署的开发者,尤其对不同输入场景变化大的任务
大规模语言模型(LLMs)迅速增长的规模带来了巨大的内存与计算开销,阻碍了高效部署。奇异值分解(SVD)已成为一种有效的训练后压缩技术,但现有SVD方法采用静态秩截断,对所有输入使用固定的奇异分量前缀,忽视了输入多样性。我们发现两个局限:最优秩随提示变化,且所选秩对校准集敏感,导致跨输入表现不佳。为此,提出PARSE——一种提示感知的秩选择框架,在大型语料库上通过密集模型输出监督训练线性路由器,实现离线秩选择。进一步观察到,语义相似提示具有共享的秩选择模式,且在解码过程中稳定,可在推理时直接从模式缓存中调用。结合专家记忆聚合与核融合,PARSE可与现有SVD流程并行,不依赖校准信息。集成四种代表性SVD方法后,其在压缩比0.6下使LLaMA-7B平均任务准确率提升最高达10%,预填充速度提升2.5倍,解码速度提升2.4倍。
原文摘要 · Abstract (English)
Large language models (LLMs) have rapidly grown in scale, creating substantial memory and computational costs that hinder efficient deployment. Singular value decomposition (SVD) has emerged as an effective post-training compression technique, but existing SVD-based methods rely on static rank truncation, applying a fixed prefix of singular components to all inputs regardless of their diversity. We identify two limitations of this static design: the optimal rank varies across individual prompts, and the selected rank is sensitive to the choice of calibration set, leading to suboptimal performance across diverse inputs. To address these challenges, we propose $\textbf{PARSE}$, a post-training framework for $\textbf{P}$rompt-$\textbf{A}$ware $\textbf{R}$ank $\textbf{S}$election as $\textbf{E}$xperts in SVD-compressed LLMs. PARSE trains a linear router offline to perform prompt-aware rank selection, decoupling it from calibration information by supervising the router against dense-model outputs on a large-scale corpus. We further observe that rank-selection patterns are shared across semantically similar prompts and remain stable across decoding steps, allowing appropriate rank subsets to be served directly from a pattern cache at inference. Complemented by expert memory aggregation and kernel fusion for system-level efficiency, PARSE is orthogonal to existing SVD-based pipelines and consistently improves both model quality and inference efficiency. Integrated with four representative SVD-based methods, PARSE improves average task accuracy by up to 10% at a compression ratio of 0.6 on LLaMA-7B, and achieves up to 2.5 $\times$ prefill and 2.4 $\times$ decode speedup over native SVD execution.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。