PRAC: Principal-Random Subspace for LLM Activation Compression and Memory-Efficient Training
Organizations: School of Intelligence Science and Technology, Peking University, China · Institute for Artificial Intelligence, Peking University, China
Abstract
Activations have become the primary memory bottleneck in large-batch LLM training. However, existing compression methods fail to exploit the spectral structure of activations, resulting in slow convergence or limited compression. To address this, we bridge the relationship between the algorithm's fast convergence and the requirements for subspace projection, and show that an effective compression should yield an unbiased estimate of the original activation with low variance. We propose Principal-Random Subspace for LLM Activation Compression (PRAC), which novelly decomposes activations into two components: a principal subspace captured via SVD to retain dominant information, and a random subspace sampled from the orthogonal complement to approximate the tail. By introducing a precise scaling factor, we prove that PRAC yields an unbiased gradient estimator with minimum variance under certain conditions. Extensive experiments on pre-training and fine-tuning tasks demonstrate that PRAC achieves up to 36% total memory reduction with negligible performance degradation and minimal computational cost.
Figures & tables
| Algorithm | Form | Scaling | Unbiasedness | Variance |
| PAC | - | - | ||
| RAC | High | |||
| PRAC | Minimum |
| LLaMA-130M | LLaMA-350M | LLaMA-1B | GPT-2-124M | GPT-2-355M | |||||||||||
| Method | PPL | MEM | PPL | MEM | PPL | MEM | PPL | MEM | PPL | MEM | |||||
| Baseline | 24.41 | 21.26 | - | 18.77 | 46.10 | - | 15.33 | OOM | 19.83 | 62.27 | - | 16.26 | 55.94 | - | |
| GaLore | 25.12 | 21.08 | -1% | 19.65 | 45.37 | -2% | 15.64 | OOM | 21.01 | 62.15 | -0% | 17.88 | 55.64 | -1% | |
| RSO | 25.41 | 19.57 | -8% | 19.57 | 40.36 | -13% | 15.72 | 79.32 | -16% | 22.31 | 54.79 | -12% | 18.29 | 46.90 | -16% |
| PRAC | 24.66 | 15.65 | -27% | 18.92 | 32.21 | -30% | 15.41 | 60.48 | -36% | 19.95 | 49.68 | -20% | 16.35 | 44.21 | -21% |
| B / S | 128/256 | 128/256 | 128/256 | 64/1024 | 32/1024 | ||||||||||
| Baseline | PRAC | |
| GeLU Input | ||
| Total |
| Method | Batch Size | Memory (GB) | Training Time (h) |
| Baseline | 64 | 50.35 | 156 |
| PRAC | 64 | 36.90 | 179 |
| 96 ( ) | 48.70 | 117 ( ) |
| Method | Memory (GB) | COLA | STSB | MRPC | RTE | SST2 | MNLI | QNLI | QQP | AVG |
| Full Fine-Tuning | 0.42 | 62.24 | 90.92 | 91.30 | 79.42 | 94.57 | 87.18 | 92.33 | 92.28 | 86.28 |
| RSO (rank=4) | 0.29 | 62.47 | 90.62 | 92.25 | 78.70 | 94.84 | 86.67 | 92.29 | 90.94 | 86.10 |
| PRAC (rank=4) | 0.26 ( ) | 63.56 | 90.83 | 93.28 | 78.71 | 94.72 | 86.60 | 92.35 | 90.95 | 86.38 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Operation | Activation Saved | |
| Baseline | PRAC | |
| {\color[rgb]{1,0,0}\tilde{X}P_{x}\in\mathbb{R}^{b\times s\times(nr_{1})},\tilde{X}Q_{x}\in\mathbb{R}^{b\times s\times(nr_{2})}} | ||
| q=XW_{q}\ | {\color[rgb]{1,0,0}XP_{q}\in\mathbb{R}^{b\times s\times(nr_{1})}} {\color[rgb]{1,0,0}XQ_{q}\in\mathbb{R}^{b\times s\times(nr_{2})}} | |
| reshape to | None | None |
| two buffers | two buffers | |
| reshape to | None | None |
| Params | Hidden | Intermediate | Heads | Layers | Steps | |
| LLaMA | 35M | 384 | 1024 | 8 | 6 | 5K |
| 60M | 512 | 1376 | 8 | 8 | 10K | |
| 130M | 768 | 2048 | 12 | 12 | 20K | |
| 350M | 1024 | 2736 | 16 | 24 | 60K | |
| 1B | 2048 | 5461 | 24 | 32 | 150K | |
| GPT-2 | 124M | 768 | 3072 | 12 | 12 | 50K |
| COLA | STSB | MRPC | RTE | SST2 | MNLI | QNLI | QQP | |
| Batch Size | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 16 |
| Epochs | 30 | 30 | 30 | 30 | 30 | 30 | 30 | 30 |
| Learing Rate | 3E-05 | 3E-05 | 3E-05 | 3E-05 | 1E-05 | 1E-05 | 1E-05 | 1E-05 |
| Rank ( ) | 4 | |||||||
| PRAC Interval | 200 | |||||||
| Max Seq Length | 512 | |||||||
| Method | PRAC | LLaMA-130M | LLaMA-350M | ||
| Ppl | Mem | Ppl | Mem | ||
| Muon | 23.90 | 21.04 | 17.98 | 45.26 | |
| 24.16 | 15.37 ( ) | 18.04 | 30.82 ( ) | ||
| Adam- mini | 24.22 | 21.01 | 18.60 | 45.42 | |
| 24.48 | 15.36 ( ) | 18.92 | 31.09 ( ) | ||
LLM Compression
Large language model compression reduces the memory, compute, and context costs of LLMs while aiming to preserve their capabilities.
See all 273 papers