通过选择关键切片,无训练地降低大模型推理时的矩阵运算量。
Reduced Matrix Multiplication: Input-Adaptive Matrix-Product Reduction for LLM Inference

- 基于输入自适应选择矩阵乘法的有用切片,不改动模型参数。
- 在10亿到700亿参数模型上,中等压缩率下仍保持稳定精度。
- 特别适合长序列和多模态推理,可显著缩短实际运行时间。
基于Transformer的语言模型虽表现优异,但因反复进行高维矩阵乘法导致推理成本高昂。我们提出无需训练、输入自适应的简化矩阵乘法(RMM),通过在其收缩维度上选择信息量高的切片来减少Transformer中的矩阵乘积,且不修改模型权重。在简单的保留率控制下,RMM实现了平滑可预测的准确率-效率权衡。在10亿至700亿参数的多种语言模型中,发现缩减容忍度受模型族、任务、组件及保留率影响,通常随模型规模提升而增强。在适度缩减下,RMM在判别、自回归生成与长上下文场景中均表现稳健。进一步证明该原理可扩展至多模态视觉-语言推理。机制分析揭示了Transformer内部结构的不对称性:注意力部分的计算远比MLP模块更易压缩。在NVIDIA A100上使用定制内核的实测显示,这些计算节省可转化为实际运行时间优势,尤其在长序列情况下更为明显。综上,RMM为推理阶段的输入自适应优化提供了一条可扩展的新路径。
原文摘要 · Abstract (English)
Transformer-based language models achieve strong performance but incur substantial inference cost due to repeated high-dimensional matrix multiplications. We propose Reduced Matrix Multiplication (RMM), a training-free, input-adaptive inference method that reduces Transformer matrix products by selecting informative slices along their contraction dimensions, without modifying model weights. Under a simple retention-ratio control, RMM provides a smooth and predictable accuracy-efficiency trade-off. Across language models ranging from 1B to 70B parameters, we find that reduction tolerance depends on the model family, task, component, and retention ratio, although it often improves with model scale. Under moderate reduction, RMM remains robust across the evaluated discriminative, autoregressive generation, and long-context settings. We further show that the same principle extends to multimodal vision-language inference. Mechanistic ablations reveal a structural asymmetry within Transformers: attention-side computations are substantially more reducible than MLP components. Finally, wall-clock benchmarks with custom kernels on an NVIDIA A100 show that these computational savings can translate into practical runtime gains, especially at longer sequence lengths. Together, these results position RMM as a scalable direction for input-adaptive inference-time optimization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。