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.


翻译:基于Transformer的语言模型在各类自然语言处理任务中展现出强劲性能,但其参数量随隐藏维度呈二次方增长,导致在资源受限硬件上的部署成本高昂。本文研究将矩阵乘积算子(MPO)分解作为一种有理论依据的Transformer压缩方法。MPO将权重矩阵分解为低秩核心序列,通过键维度(bond dimension)χ控制逼近精度。我们以参数量约1M的GPT-2风格字符级语言模型PicoGPT为例,将其所有nn.Linear层替换为以MPO链参数化的MPOLinear模块。核心初始化可采用预训练稠密权重的TT-SVD分解或随机初始化法,并使用标准PyTorch自动求导机制进行训练,无需自定义反向传播。针对PicoGPT中五种不同权重形状推导出平衡分解方案,并在Tiny Shakespeare数据集上评估了χ∈{4,8,16,32}的键维度。当χ=4时,MPO压缩可使每个Transformer块获得13倍压缩比。当χ=16时,模型使用191,872个参数(基准模型为1,020,224个)仍保持基准模型97.7%的字符精度(51.6% vs 52.8%)。重构误差遵循预期趋势,在相同键维度下三位置分解优于两位置分解。χ=8模型取得了最佳单位参数精度,该指标比稠密基准模型提升2.7倍。实验表明,MPO参数化是Transformer压缩领域低秩方法与无结构剪枝的一种兼具实用性与理论基础的替代方案。

0
下载
关闭预览

相关内容

大模型的模型压缩与有效推理综述
专知会员服务
43+阅读 · 2024年7月8日
【CMU博士论文】长度可外推的Transformer,149页pdf
专知会员服务
27+阅读 · 2024年6月30日
大型语言模型的模型压缩与高效推理:综述
专知会员服务
94+阅读 · 2024年2月17日
《Transformer压缩》综述
专知会员服务
49+阅读 · 2024年2月14日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
【Tutorial】计算机视觉中的Transformer,98页ppt
专知
21+阅读 · 2021年10月25日
百闻不如一码!手把手教你用Python搭一个Transformer
大数据文摘
18+阅读 · 2019年4月22日
一文读懂图像压缩算法
七月在线实验室
17+阅读 · 2018年5月2日
如何设计基于深度学习的图像压缩算法
论智
41+阅读 · 2018年4月26日
国家自然科学基金
8+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
重新思考无人机时代的生存能力
专知会员服务
3+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
3+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
4+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
4+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
5+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关基金
国家自然科学基金
8+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员