arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.28534cs.CLphysics.data-an
收藏

通过矩阵积算符分解压缩变换器语言模型:以PicoGPT为例

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(国家高磁场实验室)

Younes Javanmard, Tanmoy Pandit, Masoud Mardani

AI总结:

本文研究了通过矩阵积算符分解压缩变换器语言模型的方法,以PicoGPT为例,展示了在不同bond维度下参数压缩效果及模型精度。

摘要:

基于变换器的语言模型在自然语言处理任务中表现优异,但其参数规模与隐藏维度平方成正比,使在资源受限硬件上的部署成本高昂。我们研究了矩阵积算符(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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑