Compressing Transformer Language Models via Matrix Product Operator Decomposition: A Case Study on PicoGPT
Institut für Theoretische Physik, Leibniz Universität Hannover(莱布尼茨汉诺威大学理论物理研究所);VTT Technical Research Centre of Finland(芬兰VTT技术研究中心);National High Magnetic Field Laboratory(国家高磁场实验室)
基于变换器的语言模型在自然语言处理任务中表现优异,但其参数规模与隐藏维度平方成正比,使在资源受限硬件上的部署成本高昂。我们研究了矩阵积算符(MPO)分解作为一种有原则的压缩方法。MPO将权重矩阵分解为低秩核心的链式结构,其近似质量由bond维度chi控制。我们用MPO模块替代PicoGPT中每个nn.Linear层,该模块参数化为MPO链。核心通过TT-SVD从预训练密集权重初始化或随机初始化,并使用标准PyTorch自动求导训练。我们为PicoGPT中的五种不同权重形状推导了平衡的分解方案,并在Tiny Shakespeare上评估bond维度chi在{4, 8, 16, 32}下的表现。MPO压缩在chi=4时每个变换器块可实现高达13倍的压缩。在chi=16时,模型使用191,872个参数而非1,020,224个参数,同时保留了97.7%的基准标记精度(51.6% vs 52.8%)。重构误差遵循预期趋势,相同bond维度下三站点分解比两站点分解更优。chi=8模型在参数效率上表现最佳,该指标上超过密集基线2.7倍。这些结果表明,MPO参数化是替代低秩方法和无结构剪枝的实用且理论基础的变换器压缩方法。
英文摘要:
Transformer-based language models achieve strong performance across NLP tasks, but their quadratic parameter scaling with hidden dimension makes deployment on resource-constrained hardware expensive. We study Matrix Product Operator (MPO) decomposition as a principled compression method for transformers. MPO factorises weight matrices into chains of low-rank cores, with approximation quality controlled by the bond dimension chi. We replace every nn.Linear layer in PicoGPT, a GPT-2-style character-level language model with about 1M parameters, with an MPOLinear module parameterised as an MPO chain. Cores are initialised either by TT-SVD from pretrained dense weights or from random initialisation, and trained using standard PyTorch autograd without a custom backward pass. We derive balanced factorisation schemes for the five distinct weight shapes in PicoGPT and evaluate bond dimensions chi in {4, 8, 16, 32} on Tiny Shakespeare. MPO compression achieves up to 13x compression per transformer block at chi = 4. At chi = 16, the model uses 191,872 parameters instead of 1,020,224 while retaining 97.7% of baseline token accuracy (51.6% vs 52.8%). Reconstruction error follows the expected trend and is lower for three-site than two-site factorisations at the same bond dimension. The chi = 8 model gives the best accuracy per parameter, exceeding the dense baseline by 2.7x on this metric. These results show that MPO parameterisation is a practical and theoretically grounded alternative to low-rank methods and unstructured pruning for transformer compression.
MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformers
Microsoft Research(微软研究院)
我们在MiniLM中推广了深度自我注意力蒸馏(Wang et al.,2020)通过仅使用自注意关系蒸馏来对预训练的Transformers进行任务不可知压缩。特别是,我们定义了多头自我注意力的关系,每个自我注意力模块内的查询,键和值向量对之间的缩放点积。然后运用上述相关知识对学生模型进行训练。除了简单和统一的原则,更有利的是,它没有限制的数量方面的学生的注意头,而大多数以前的工作必须保证相同的头数之间的教师和学生。此外,细粒度的自注意关系倾向于充分利用Transformer学习的交互知识。此外,我们彻底研究了教师模型的层选择策略,而不是像MiniLM中那样只依赖最后一层。我们对压缩单语和多语言预训练模型进行了广泛的实验。实验结果表明,我们的模型提取的基础大小和大尺寸的教师(BERT,RoBERTa和XLM-R)优于国家的最先进的。
Modular Transformers: Compressing Transformers into Modularized Layers for Flexible Efficient Inference
ETH Zurich(苏黎世联邦理工学院);Allen Institute for AI(艾伦人工智能研究所);Paul G. Allen School of Computer Science & Engineering, University of Washington(华盛顿大学保罗·G·艾伦计算机科学与工程学院)
Is Smaller Always Faster? Tradeoffs in Compressing Self-Supervised Speech Transformers
Graduate Institute of Communication Engineering, National Taiwan University, Taiwan(台湾国立台湾大学通信工程研究所);University of California, Los Angeles, United States(美国加州大学洛杉矶分校);University of Washington, United States(美国华盛顿大学);University of Edinburgh, United Kingdom(英国爱丁堡大学)
Structural Sensitivity in Compressed Transformers: Relative Error Propagation and Layer Removal
Indian Institute of Information Technology Allahabad, India(阿利哈巴德信息技术学院,印度);National Institute of Electronics(电子研究所);Indian Institute of Technology Patna, India(帕纳印度理工学院,印度);Indian Institute of Information Technology Kalyani, India(卡里尼信息技术学院,印度)
Tensorized Embedding Layers for Efficient Model Compression
Skolkovo Institute of Science and Technology(斯科尔科沃科学技术研究院);Moscow Institute of Physics and Technology(莫斯科物理技术学院);Institute of Numerical Mathematics, RAS, Moscow, Russia(俄罗斯科学院数学数值研究所)
PreQuant: A Task-agnostic Quantization Approach for Pre-trained Language Models
Wangxuan Institute of Computer Technology, Peking University(北京大学王选计算机研究所);Meituan(美团);Meta AI;National Key Laboratory of General Artificial Intelligence(通用人工智能全国重点实验室);Beijing Institute for General Artificial Intelligence(北京通用人工智能研究院);Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院)