Activation Compression in LLMs: Theoretical Analysis and Efficient Algorithm

Wen-Da Wei, Han-Bin Fang, Yang-Di Liu, Jiang-Xin Shi, James Kwok, Yu-Feng LiarXiv 2026

TL;DR

Storing intermediate activations is a massive memory bottleneck when training Large Language Models (LLMs). This paper provides a new theoretical framework showing that activation compression is perfectly safe for linear layers but disastrous for nonlinear ones, and leverages this insight to introduce an efficient "co-compression" algorithm that slashes both activation and gradient memory footprints without sacrificing accuracy.

What Problem Does This Paper Address?

Training LLMs requires immense GPU memory. While popular techniques like LoRA or GaLore successfully compress weights, gradients, or optimizer states, activation memory—the intermediate states stored during the forward pass so they can be used to compute gradients during the backward pass—remains a massive bottleneck. As batch sizes and context lengths scale, activation memory quickly overwhelms GPUs.

Prior attempts at activation compression lacked rigorous theoretical guarantees tailored to LLMs, leaving practitioners in the dark about why certain layers can be compressed safely while others cause training to collapse. This paper bridges that gap by establishing a clear mathematical boundary for where activation compression can be safely applied.

Methods

The authors tackle the problem through a combination of theoretical analysis and a novel algorithm:

  1. Linear vs. Nonlinear Theoretical Analysis: The authors analyze the mathematical impact of activation compression at the operator level. They prove that for linear operators (like matrix multiplications), unbiased activation compression introduces zero gradient bias and zero upstream error propagation. Conversely, for nonlinear operators (like SiLU, Softmax, and RMSNorm), compression introduces quadratic bias terms and errors that propagate and amplify exponentially across layers.
  2. Activation–Gradient Co-Compression (Ours & Ours+): Armed with this theory, the authors propose a joint compression method. Because the weight gradient of a linear layer is mathematically bounded by the rank of its activation ($\text{rank}(G_W) \le \text{rank}(X)$), they reuse the low-rank factors ($U$ and $V^\top$) from the compressed activations to directly compute and store the weight gradients in a factorized low-rank form. This eliminates the need to reconstruct full activations or perform expensive singular value decompositions (SVD) on gradients, saving both activation and gradient memory simultaneously. Ours+ extends this by integrating GaLore-style low-rank optimizer updates to further compress optimizer states.

Datasets

The authors evaluated their approach across multiple configurations:

  • Fine-tuning: LLaMA3-3B and Qwen3-4B models evaluated on GSM8K (math word problems), MATH, and the GLUE benchmark.
  • Pre-training: A LLaMA3-1B model trained on the C4 dataset.

Key Insights and Ideas

  • The Linear/Nonlinear Divide: Why does compressing a linear layer work so well while compressing Softmax fails? For linear layers, the Taylor expansion of the gradient truncates perfectly after the first-order term, meaning any unbiased noise cancels out in expectation. Nonlinear layers retain higher-order terms, injecting persistent bias into the optimization trajectory.
  • Error Amplification: The paper empirically demonstrates that the Frobenius norm of the Jacobian product grows rapidly with layer depth. This means any gradient errors introduced in nonlinear layers get heavily amplified as they propagate backward through the network, destabilizing training.
  • Two-for-One Compression: The realization that low-rank activations inherently imply low-rank weight gradients allows for "free" gradient compression, bypassing the computational overhead that usually plagues gradient projection methods.

Key Results

  • Massive Memory Reductions: As illustrated in Figure 1, the proposed Ours+ method dramatically reduces total memory consumption compared to standard Supervised Fine-Tuning (SFT), dropping the footprint from over 55 GB down to under 30 GB for a LLaMA3-3B model.
Figure 1. Estimated GPU memory consumption during fine-tuning of a LLaMA3-3B model on GSM8K dataset (batch size = 32).
  • Preserved Accuracy: On the GSM8K benchmark with Qwen3-4B, compressing all linear layers achieved a top accuracy of 79.6% (matching or slightly exceeding the baseline SFT at 78.8%). Conversely, compressing nonlinear layers like SiLU or Softmax caused catastrophic performance drops or complete training collapse (Table 1).
  • Favorable Training Time: While the base Ours method adds a modest ~10.8% computational overhead due to activation factorization, Ours+ actually runs faster than standard SFT (47.76 mins vs 56.75 mins) because the compressed optimizer states drastically reduce the time spent on parameter updates (Table 3).

Limitations and Future Work

  • Not Strictly Low-Rank: The authors note that LLM activations are not strictly low-rank in reality, meaning low-rank compression does introduce a non-zero reconstruction error, even if it is practically safe for linear layers.
  • Factorization Overhead: The method introduces a slight computational overhead for the low-rank factorization of activations, which might be a drawback if optimizer state compression (Ours+) isn't utilized to offset the time.
  • Future Directions: Promising future work includes exploring adaptive rank allocation across different layers to optimize the trade-off between reconstruction error and memory savings.

Summary updated

BibTeX
@misc{wei2026activation,
  author = {Wen-Da Wei and Han-Bin Fang and Yang-Di Liu and Jiang-Xin Shi and James Kwok and Yu-Feng Li},
  title = {{Activation Compression in LLMs: Theoretical Analysis and Efficient Algorithm}},
  year = {2026},
  eprint = {2605.01255},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.01255},
}
Figure