Abstract
MoDeGPT is a training-free framework designed to compress Large Language Models (LLMs) by jointly decomposing pairs of weight matrices within functional modules. By repurposing classical algorithms like Nyström approximation and CR decomposition, MoDeGPT achieves a 98% reduction in compute costs compared to gradient-based methods while boosting inference throughput by up to 46% with minimal accuracy loss.
Introduction: The Compression Bottleneck
As LLMs grow in capability, their hardware requirements scale proportionally, restricting their deployment on resource-constrained devices. Standard compression techniques often fall into two problematic categories:
- Pruning and Distillation: These methods typically require expensive "recovery fine-tuning" (backpropagation) to regain the accuracy lost during the compression phase.
- Matrix Decomposition (e.g., SVD): Traditional low-rank methods decompose matrices individually. To achieve meaningful memory savings, the rank must be slashed aggressively, which causes accuracy to plummet. Newer methods like SliceGPT attempt to reduce dimensions but introduce "adapters"—extra parameters that eat into the very memory and compute savings they aim to provide.
The authors identify a critical "structural scale" gap: compressing individual matrices is too granular and error-prone, while compressing entire transformer blocks is overly complex. MoDeGPT targets the modular level, compressing pairs of consecutive subcomponents (like the Up and Down matrices in an MLP) jointly to avoid extra overhead and eliminate the need for residual adapters.
Methodology: Modular Decomposition
The core innovation of this paper is Modular Decomposition. Instead of evaluating one weight matrix at a time, MoDeGPT groups them into three functional "Types" based on their role and the presence of nonlinearities between them.
- Type I (MLP Module): Compresses the Up and Down matrices. It uses the Nyström approximation on the activation correlation matrix to select the most important "landmark" columns, ensuring the reconstruction error remains bounded despite the nonlinearity.
- Type II (Key-Query Module): Compresses the Query and Key matrices in the attention head. It employs CR (Column-Row) decomposition, which naturally fits the inner-product structure of attention mechanisms.
- Type III (Value-Output Module): Compresses the Value and Output matrices. Because there is no nonlinearity between these two components, the authors use a specialized version of Singular Value Decomposition (SVD).
Crucially, MoDeGPT is training-free. It uses a small calibration dataset to calculate correlations and then applies closed-form mathematical solutions to compress the weights. By mapping specific transformer components to specific matrix approximation theories, the authors provide theoretical error guarantees that gradient-free methods usually lack.
To optimize performance, MoDeGPT includes a Global Sparsity Allocation strategy. Using "Block Influence" scores, the framework decides which layers can afford aggressive compression (typically the middle layers) and which should remain dense (usually the first and last layers). The authors noted that the Type II (Key-Query) module is the most sensitive to compression, while the MLP module contains the bulk of the parameters, making this balancing act essential.
Experimental Setup and Key Results
The authors evaluated MoDeGPT on the OPT and LLaMA (1, 2, and 3) model families, ranging from 125M to 70B parameters. Calibration utilized 128 samples from WikiText-2 and Alpaca, while evaluation relied on perplexity (WikiText-2) and zero-shot accuracy across benchmarks like ARC, PIQA, WinoGrande, and HellaSwag via the LM Evaluation Harness.
- Unmatched Efficiency: Compressing a LLaMA-2 13B model takes only a few hours on a single A100 GPU. This represents a 98% reduction in compute cost compared to leading gradient-based methods like LLM Surgeon.
- Strong Performance Retention: On LLaMA-2 and LLaMA-3, MoDeGPT retains 90-95% of zero-shot performance at 25-30% compression rates.
- Inference Speedup: In real-world testing, MoDeGPT increased inference throughput by up to 46% (and up to 58% at higher compression levels) because it physically reduces the intermediate dimensions the GPU must process.
- Favorable Scaling: The method performs better as models get larger. On the massive LLaMA-2 70B, MoDeGPT showed significantly less accuracy degradation than competing decomposition methods.
Limitations and Future Directions
While highly effective, MoDeGPT has a few limitations. The authors note an "intrinsic bias" where the local reconstruction objective doesn't perfectly align with every downstream task, occasionally leading to underperformance on specific zero-shot benchmarks like HellaSwag at high compression rates. Additionally, while 128 samples are generally sufficient, the choice of calibration data (e.g., WikiText vs. Alpaca) can influence the final model's performance on specific tasks.
Finally, to reach the theoretical maximum speedup at very low compression rates (<10%), the authors suggest that custom CUDA kernels may be required to better handle the specific, non-standard shapes of the pruned attention heads.
Summary updated