From Layers to Submodules: Rethinking Granularity in Replacement-Based LLM Compression
作者: Elia Cunegatti, Marcus Vukojevic, Erik Nielsen, Giovanni Iacca
分类: cs.CL, cs.AI
发布日期: 2026-06-01
🔗 代码/项目: GITHUB
💡 一句话要点
SubFit:提出一种子模块粒度的LLM压缩方法,提升压缩效率和精度。
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型压缩 后训练压缩 子模块级别 残差学习 模型优化
📋 核心要点
- 现有LLM压缩方法通常以全层粒度进行,且选择连续的层进行压缩,限制了压缩的灵活性和效率。
- SubFit的核心思想是在子模块级别(Attention和FeedForward)进行非连续选择和压缩,并为每个子模块配备独立的残差旁路。
- 实验表明,SubFit在多个LLM上实现了更好的困惑度-准确率权衡,尤其是在高压缩率下,并能带来推理加速和KV-cache节省。
📝 摘要(中文)
本文提出了一种名为SubFit(Submodule-level Fitted residual replacement)的LLM后训练压缩方法,该方法在子模块级别进行压缩。与现有方法的全层粒度和连续选择不同,SubFit允许非连续地选择Attention和FeedForward子模块进行压缩,并为每个子模块配备独立的轻量级拟合残差旁路。实验结果表明,在十个LLM(五个基础模型,五个指令微调模型)上,SubFit在12.5%到37.5%的五个稀疏度水平下,实现了最佳的困惑度-准确率权衡。在25%的稀疏度下,SubFit保留了84.6%的密集下游任务准确率,困惑度退化为2.42倍,而最强的基线方法则分别为81.6%和4.34倍。此外,SubFit还带来了可观的推理加速和KV-cache节省。代码已开源。
🔬 方法详解
问题定义:现有基于替换的LLM压缩方法通常以全层为粒度,并且要求选择连续的层进行压缩或替换。这种方式忽略了Transformer模型中不同子模块(如Attention和FeedForward)的冗余度分布不均的特性,以及非连续区域可能存在的冗余。因此,现有方法在压缩效率和精度上存在瓶颈。
核心思路:SubFit的核心思路是在子模块级别进行压缩,允许非连续地选择Attention和FeedForward子模块进行压缩。通过为每个被压缩的子模块添加一个轻量级的拟合残差旁路,来弥补压缩带来的性能损失。这种细粒度的压缩方式能够更精确地定位和移除模型中的冗余,从而在保证性能的同时实现更高的压缩率。
技术框架:SubFit的整体流程包括以下几个步骤:1) 选择需要压缩的LLM;2) 确定压缩的稀疏度;3) 使用校准数据集,评估每个Attention和FeedForward子模块的重要性;4) 根据重要性得分,非连续地选择需要压缩的子模块;5) 为每个选定的子模块添加一个轻量级的拟合残差旁路,并使用校准数据进行训练;6) 在下游任务上评估压缩后的模型性能。
关键创新:SubFit的关键创新在于其子模块级别的压缩粒度和非连续选择策略。与现有方法的全层粒度压缩相比,SubFit能够更精确地定位和移除模型中的冗余。非连续选择策略则打破了连续区域压缩的限制,允许更灵活地选择需要压缩的子模块。
关键设计:SubFit的关键设计包括:1) 子模块重要性评估方法:使用校准数据集,通过计算每个子模块输出的激活值的范数来评估其重要性;2) 轻量级拟合残差旁路:使用一个小的线性层或MLP来拟合被压缩子模块的残差,以弥补压缩带来的性能损失;3) 损失函数:使用交叉熵损失函数来训练拟合残差旁路,目标是最小化压缩后模型在校准数据集上的困惑度。
🖼️ 关键图片
📊 实验亮点
SubFit在多个LLM上进行了实验,结果表明其在困惑度和准确率之间取得了更好的权衡。例如,在25%的稀疏度下,SubFit保留了84.6%的密集下游任务准确率,困惑度退化为2.42倍,而最强的基线方法则分别为81.6%和4.34倍。这表明SubFit能够更有效地压缩LLM,并在保证性能的同时实现更高的压缩率。
🎯 应用场景
SubFit可应用于各种需要部署LLM的场景,尤其是在资源受限的设备上,如移动设备、边缘计算设备等。通过SubFit压缩LLM,可以显著减小模型大小,降低计算复杂度,从而实现LLM在这些设备上的高效部署和推理。此外,SubFit还可以用于加速LLM的训练和微调过程。
📄 摘要(原文)
Post-training compression of Large Language Models (LLMs) removes entire architectural components, either deleting them or replacing them with fitted modules. Existing replacement-based methods share two design constraints: full-layer granularity and contiguous selection. We argue that this is overly restrictive: in fact, redundancy in pretrained transformers is not confined to contiguous regions, nor does it evenly distribute between Attention and FeedForward outputs, implying that different strategies best approximate different submodule types and that removable components need not cluster within contiguous depth ranges. Based on this intuition, we introduce SubFit (Submodule-level Fitted residual replacement), which compresses LLMs at the submodule level: Attention and FeedForward submodules are selected non-contiguously, and each receives its own lightweight fitted residual bypass. SubFit operates post-training and requires only calibration data. Across ten LLMs (five base, five instruction-tuned), five sparsity levels from 12.5% to 37.5%, and four replacement-based baselines, SubFit achieves the best aggregate perplexity-accuracy trade-off across the evaluated sparsity levels, with larger gains under aggressive compression. At 25% sparsity, it retains 84.6% of dense downstream accuracy and incurs 2.42x perplexity degradation, against 81.6% and 4.34x for the strongest baselines, while delivering measurable inference speedup and KV-cache savings. Code is available at https://github.com/eliacunegatti/SubFit.