Organizations: Institut für Theoretische Physik, Leibniz Universität Hannover, Appelstraße 2, 30167 Hannover, Germany · VTT Technical Research Centre of Finland, Tietotie 3, Espoo, Finland · National High Magnetic Field Laboratory, Tallahassee, FL 32310, USA
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.
Figures & tables
Parameter
Description
Value
V
Vocabulary size (character-level)
65
D
Embedding dimension ( dmodel )
128
H
Attention heads
4
N
Transformer layers
4
T
Context length
256
dff
FFN hidden dimension ( 4D )
512
Table 1: PicoGPT default hyperparameters.
Layer
out
in
L
(dlout)
(dlin)
Dense
MPO ( χ=8 )
WQ/K/V/O
128
128
2
[8,16]
[8,16]
16 384
2 560
W1 (up)
512
128
3
[8,8,8]
[4,4,8]
65 536
4 864
W2 (down)
128
512
3
[4,4,8]
[8,8,8]
65 536
2 816
WLM
65
128
2
[5,13]
[8,16]
8 320
1 984
Total per block (4 attn + 2 FFN)
196 608
17 920
Compression ratio per block
1×
11.0 ×
Table 2: MPO factorisation schemes for each PicoGPT linear layer. χ denotes the bond dimension.
Figure 1: Tensor network diagram of an MPO weight matrix. Horizontal lines carry virtual (bond) indices of dimension χ ; vertical lines are physical indices of size dlout (blue, upward) and dlin (red, downward). Contracting all bond indices reconstructs the full weight W∈Rout×in .
Model
Parameters
Ratio
Max rel. err.
Mean rel. err.
Dense
1 020 224
1.0 ×
—
—
MPO χ=4
78 336
13.0 ×
0.421
0.337
MPO χ=8
110 592
9.2 ×
0.283
0.216
MPO χ=16
191 872
5.3 ×
0.148
0.107
MPO χ=32
408 832
2.5 ×
0.072
0.051
Table 3: Parameter counts and compression ratios versus the dense baseline. Layer-wise reconstruction errors are relative Frobenius norms ∥W−W∥F/∥W∥F averaged over all linear layers of a randomly initialised dense model.
Figure 2: Per-layer MPO reconstruction error versus bond dimension. Three-site decompositions ( L=3 ) achieve lower error per parameter than two-site ones ( L=2 ) across the range of χ considered here.
Figure 3: Training (left) and validation (right) cross-entropy loss as a function of training step. Higher bond dimensions converge faster and to lower loss values in the train-from-scratch setting studied here.
Figure 4: Left : Validation token accuracy during training for all models. Right : Pareto frontier of final validation accuracy versus parameter count. MPO χ=16 retains 97.7% of the dense accuracy at 5.3× parameter compression.
Model
Params
Ratio
Val loss ↓
Val acc ↑
Acc. gap ↓
Per-param acc.
Dense
1 020 224
1.0 ×
1.860
52.8%
—
1.65×10−3
MPO χ=4
78 336
13.0 ×
2.220
36.8%
-16.0
4.15×10−3
MPO χ=8
110 592
9.2 ×
1.950
46.8%
-6.0
4.45×10−3
MPO χ=16
191 872
5.3 ×
1.850
51.6%
-1.2
3.72×10−3
MPO χ=32
408 832
2.5 ×
1.850
52.4%
-0.4
2.59×10−3
Table 4: Final validation metrics after 2 000 training steps. Acc. gap is the absolute reduction in token accuracy versus the dense model. Per-param acc. is the heuristic score acc/N used here as a rough proxy for parameter efficiency.