MoDeGPT: Modular Decomposition for Large Language Model Compression

## Abstract

Abstract Large Language Models (LLMs) have reshaped the landscape of artificial intelligence by demonstrating exceptional performance across various tasks. However, substantial computational requirements make their deployment challenging on devices with limited resources. Recently, compression methods using low-rank matrix techniques have shown promise, yet these often lead to degraded accuracy or introduce significant overhead in parameters and inference latency. This paper introduces Mo dular De composition ( MoDeGPT ), a novel structured compression framework that does not need recovery fine-tuning while resolving the above drawbacks. MoDeGPT partitions the Transformer block into modules comprised of matrix pairs and reduces the hidden dimensions via reconstructing the module-level outputs. MoDeGPT is developed based on a theoretical framework that utilizes three well-established matrix decomposition algorithms—Nyström approximation, CR decomposition, and SVD—and applies them to our redefined transformer modules.
Our comprehensive experiments show MoDeGPT , without backward propagation, matches or surpasses previous structured compression methods that rely on gradient information, and saves 98% of compute costs on compressing a 13B model.
On Llama -2/3 and OPT models, MoDeGPT maintains 90-95% zero-shot performance with 25-30% compression rates. Moreover, the compression can be done on a single GPU within a few hours and increases the inference throughput by up to 46%.

## 1 Introduction

Recent advancements in Large Language Models (LLMs) [, , , , ] have led to remarkable breakthroughs in the understanding and generation of natural language. Despite their significant capabilities, these models are computationally and memory-intensive, posing deployment challenges on resource-limited devices. To mitigate these challenges, model compression [, ] has emerged as a popular post-training solution, reducing model size and complexity.

Predominant compression techniques encompass model distillation [, , ], pruning [, , , , , , , , ], matrix decomposition [, , ], and quantization [, , , ]. This study focuses on matrix decomposition techniques that require minimal computing resources and do not involve backward propagation as seen in recovery fine-tuning (RFT) or Fisher matrix calculations from Taylor expansion [, ]. Conventional matrix decomposition such as SVD typically splits each matrix
${\bm{W}}\in\mathbb{R}^{d\times d}$ into two low-rank matrices ${\bm{W}}={\bm{A}}{\bm{B}}$, requiring the rank less than
$d/2$ to achieve true compression (see Figure 1(b)).
This stringent requirement often results in a significant drop in accuracy, necessitating the use of RFT []. A novel decomposition approach, SliceGPT [], multiplies the original matrix by an orthogonal matrix, effectively projecting inputs into a lower-dimensional subspace and reducing the matrix’s overall dimensionality. However, this approach requires additional adapters to manage the reduced dimensions; as illustrated in Figure 1(c), adapters ${\bm{Q}}_{i}^{\top}{\bm{Q}}_{j}$ are added to the residual paths to facilitate this reduction. For a target sparsity $s$, this introduces additional $2(1-s)^{2}d^{2}$ parameters per layer, which can add up to 10% of additional parameters, significantly offsetting the parameter savings. In summary, traditional matrix decomposition discards a large portion of ranks, and strategies like SliceGPT introduce substantial parameter overheads. These challenges greatly hinder the effective reduction of parameters without compromising accuracy.

In response to these challenges, we introduce MoDeGPT, which applies matrix decomposition to multiple matrices jointly, avoiding the dual-matrix structure and extra adapters used in prior methods. As depicted in Figure 1(d), MoDeGPT elevates the matrix decomposition approach to a modular level by grouping weight matrices into modules and then applying matrix decomposition jointly within each module. Unlike SliceGPT, MoDeGPT reduces the intermediate dimensions within each module rather than between blocks, as illustrated by the matrix shapes in Figure 1(c) and (d). This crucial difference eliminates the need for adapters while still enabling dimension reduction in the compressed matrix.
MoDeGPT establishes a comprehensive mathematical framework that maps each module’s compression task to one of the three matrix approximation techniques: CR decomposition [], singular value decomposition (SVD) [], and Nyström approximation [, ]. These methods enable MoDeGPT to efficiently compress matrices.
In summary, we make the following contributions:

- •
We introduce MoDeGPT, a training-free compression method that jointly decomposes multiple matrices within a module. Our method is mathematically grounded and provides a systematic categorization of approximation problems in compressing Transformers. To the best of our knowledge, this is the first structured pruning method that offers a provable reconstruction error bound at the module level, even when nonlinear functions are involved.
- •
For the first time with large language models (LLMs), we demonstrate that a matrix decomposition approach can achieve state-of-the-art structured compression efficiency and approach the compression rate of semi-structured pruning without requiring recovery fine-tuning.
- •
We conducted a comprehensive empirical evaluation comparing our method to the previous best methods. Our evaluation considers not only simple metrics like perplexity but also downstream task accuracy and real-world speed gains in both compression time and inference time. Our method excels in all these aspects. Specifically, with Llama 2 and 3, MoDeGPT preserves 90% of zero-shot performance at up to 30% compression rates, whereas previous structured pruning methods suffer significant accuracy drops. Additionally, these performance gains come with a 46% improvement in inference throughput.

Figure: Figure 1: Comparison of Matrix Decomposition-Based Methods for Transformer Compression. (a) Original transformer layer. (b) SVD applied to each weight matrix separately, resulting in dual matrices. (c) SliceGPT multiplies each weight matrix by an orthogonal matrix ${\bm{Q}}$, reducing dimensions and introducing additional adapters. (d) MoDeGPT organizes matrices into modules (highlighted by green boxes) and jointly decomposes them, producing reduced-size matrices without extra adapters.
Refer to caption: x2.png

## 2 Background and Related Work

In this section, we begin by reviewing the existing body of literature related to LLM compression, highlighting key contributions and methodologies in the field. Subsequently, we examine the standard components of a transformer decoder layer. Lastly, we delve into the three matrix approximations employed for our proposed compression across various components in a transformer layer.

### 2.1 Related Works

#### Pruning

In early pruning methods like magnitude-based tuning, scalability is achieved but often at the cost of reduced effectiveness in large language models (LLMs) [, , , , ]. To address this, the Optimal Brain Damage [] and Surgeon frameworks [, , ] incorporate second-order loss information, improving performance but requiring substantial computational resources due to Hessian calculations.
Recent adaptations, such as WoodFisher [], Kronecker factorization [, ], and layer-wise compression [, ], aim to streamline these computationally intense methods. Concurrently, several studies have investigated learnable parameters for pruning in vision and language models [, , ].
However, these techniques generally demand high computational
resources due to intensive backward propagation. Some other approaches have explored feature-mimic-based methods [, ], but their results do not match the performance of gradient-based methods like LLM Surgeon [].
Alternatives like SparseGPT [], Wanda [] and ZeroPruner [], which explore unstructured and semi-structured pruning, offer scalability but require significant engineering efforts and often compromise
runtime speed.
Other research has focused on utilizing layer importance scores for layer pruning and sparsity distribution, as demonstrated by methods like ShortGPT [], OWL [], LaCo [] and other [].
MoDeGPT proposes a general method to transform any importance score into a sparsity allocation across layers.
In the realm of modern LLM applications,
recent advances in compression have introduced innovative methods such as LLM-Pruner [], LLM Surgeon [], and SliceGPT [], marking significant progress in the field by providing effective compression techniques for large language models.

**Table 1: Comparisons with other LLM compressors.**
| Method | No Backward<br>Propagation | No Additional<br>Parameters | Maintain Acc.<br>w/o RFT | Structured<br>Compression |
| --- | --- | --- | --- | --- |
| LLM Pruner [] | ✗ | ✓ | ✗ | ✓ |
| LLM Surgeon [] | ✗ | ✓ | ✓ | ✓ |
| SliceGPT [] | ✓ | ✗ | ✓ | ✓ |
| SparseGPT [] | ✓ | ✓ | ✓ | ✗ |
| MoDeGPT (ours) | ✓ | ✓ | ✓ | ✓ |

#### Low-Rank Matrix Approximation

In related low-rank matrix techniques for compression, the traditional decomposition approach substitutes matrices with two low-rank matrices but retains the original dimensions, which can limit effectiveness [, , , , , , , , ]. MoDeGPT improves upon this by applying low-rank approximation to matrix pairs, reducing the size of individual matrices and merging the additional matrices from the decompositions. SliceGPT introduces a technique involving matrix multiplication with orthogonal matrices derived from PCA to compress weights, which reduces matrix sizes but adds additional parameters []. In contrast, MoDeGPT compresses without adding parameters by folding the decomposed matrices back to the original weights. A summary of MoDeGPT’s comparison to other leading LLM compression methods is provided in Table 1.

### 2.2 Transformer architecture

The transformer architecture[] consists of multiple decoder layers.
A typical layer such as in Llama [, ] includes two blocks: the Multi-Head Attention (MHA) and Multi-Layer Perceptron (MLP). Let $T$, $d_{h}$, $d_{\text{int}}$, and $H$ denote the sequence length, hidden dimension, intermediate dimension, and the number of attention heads, respectively, the formulation of these blocks is as follows:

$$ (MLP block) $\displaystyle f_{\text{MLP}}({\bm{X}})=\overbrace{\sigma_{s}({\bm{X}}{\bm{W}}_ {U}){\bm{W}}_{D}}^{\hyperref@@ii[sec:type1]{\text{{\color[rgb]{0,1,0} \definecolor[named]{pgfstrokecolor}{rgb}{0,1,0}\pgfsys@color@cmyk@stroke{1}{0} {1}{0}\pgfsys@color@cmyk@fill{1}{0}{1}{0}Type-I}}}},$ (1) (MHA block) $\displaystyle f_{\text{MHA}}({\bm{X}})=\sum_{i=1}^{H}\text{Softmax}( \underbrace{\sigma_{r}({\bm{X}}{\bm{W}}_{Q,i})\sigma_{r}^{\top}({\bm{X}}{\bm{W }}_{K,i})}_{\hyperref@@ii[sec:type2]{\text{{\color[rgb]{1,0,0.87}\definecolor[ named]{pgfstrokecolor}{rgb}{1,0,0.87}\pgfsys@color@cmyk@stroke{0}{1}{0.13}{0} \pgfsys@color@cmyk@fill{0}{1}{0.13}{0}Type-II}}}})\underbrace{{\bm{X}}{\bm{W}} _{V,i}{{\bm{W}}_{O,i}}}_{\hyperref@@ii[sec:type3]{\text{{\color[rgb]{ 0.35,0.87,1}\definecolor[named]{pgfstrokecolor}{rgb}{0.35,0.87,1} \pgfsys@color@cmyk@stroke{0.65}{0.13}{0}{0}\pgfsys@color@cmyk@fill{0.65}{0.13} {0}{0}Type-III}}}},$ (2) $$

where ${\bm{X}}\in\mathbb{R}^{T\times d_{h}}$ is the input matrix, ${\bm{W}}_{Q,i},{\bm{W}}_{K,i},{\bm{W}}_{V,i}\in\mathbb{R}^{d_{h}\times\frac{d_
{h}}{H}},{\bm{W}}_{O,i}\in\mathbb{R}^{\frac{d_{h}}{H}\times d_{h}}$ are the head-specific query, key, value, and output matrices. The matrices ${\bm{W}}_{U}\in\mathbb{R}^{d_{h}\times d_{\text{int}}}$ and ${\bm{W}}_{D}\in\mathbb{R}^{d_{\text{int}}\times d_{h}}$ denote up and down matrices, respectively, with $\sigma_{r}$ and $\sigma_{s}$ denoting positional embedding and nonlinear activation functions.
Note that our MLP formulation encompasses the gated MLP: the up matrix is defined by the concatenations of the gated and up matrix ${{\bm{W}}_{U}}=[{\bm{W}}_{u}^{\top},{\bm{W}}_{g}^{\top}]^{\top}$, and the nonlinear function is defined by $\sigma_{s}({\bm{X}}{{\bm{W}}_{U}}):={\bm{X}}{\bm{W}}_{u}\odot\sigma_{g}({\bm{X
}}{\bm{W}}_{g})$, where $\sigma_{g}$ is the gate function.

In the expressions of equation 1 and equation 2, the blocks can be divided into three types of functional modules, each associated with a pair of matrices:

$$ Type-I: $\displaystyle f({\bm{X}};{{\bm{W}}}_{U},{\bm{W}}_{D})=\sigma_{s}({\bm{X}}{{\bm {W}}}_{U}){\bm{W}}_{D}$ Type-II: $\displaystyle f({\bm{X}};{\bm{W}}_{K}^{i},{\bm{W}}_{Q}^{i})=\sigma_{r}({\bm{X} }{\bm{W}}_{Q}^{i})\sigma_{r}({\bm{X}}{\bm{W}}_{K}^{i})^{\top},\text{ \hyperref@@ii[sec:type3]{\color[rgb]{0.35,0.87,1}\definecolor[named]{ pgfstrokecolor}{rgb}{0.35,0.87,1}\pgfsys@color@cmyk@stroke{0.65}{0.13}{0}{0} \pgfsys@color@cmyk@fill{0.65}{0.13}{0}{0}{Type-III}:}\leavevmode\nobreak\ \leavevmode\nobreak\ }f({\bm{X}};{\bm{W}}_{V}^{i},{\bm{W}}_{O}^{i})={\bm{X}}{ \bm{W}}_{V}^{i}{\bm{W}}_{O}^{i},$ $$

where ${\bm{X}}$ denotes the input and the variables after “;” denote the associated matrices.
Based on their levels of nonlinearity, we categorize these modules into Type-I, Type-II, and Type-III, applying different matrix decomposition methods for compression according to the optimization tractability of each type.

### 2.3 Low-rank matrix approximation

The goal of a low-rank approximation method is to approximate a matrix ${\bm{W}}\in\mathbb{R}^{d_{1}\times d_{2}}$ with two low-rank matrices ${\bm{A}}\in\mathbb{R}^{d_{1}\times k}$ and ${\bm{B}}\in\mathbb{R}^{k\times d_{2}}$.
For formalism, we make the following definition:

###### Definition 1 .

For a low-rank approximation method $\mathcal{M}$ that decomposes a matrix ${\bm{W}}$ into ${\bm{A}}$ and ${\bm{B}}$, the approximation matrix is ${\bm{W}}_{\mathcal{M}}={\bm{A}}{\bm{B}}$ and the error relative to ${\bm{W}}$ is $\mathcal{E}_{\mathcal{M}}({\bm{W}})=\|{\bm{W}}-{\bm{W}}_{\mathcal{M}}\|_{F}$.

We review three approximation methods that facilitate our compression algorithms in the next section.

###### Definition 1 .

#### I. Nyström approximation [ 21 ]

If ${\bm{W}}$ is a positive semidefinite matrix, let ${\bm{S}}_{k}$ be a $k$-column selection matrix where each column has a single non-zero element indicating the selected index, then the corresponding Nyström approximation of ${\bm{W}}$ is,

$$ $\displaystyle{\bm{W}}_{\text{Nys}}={\bm{A}}{\bm{B}},\leavevmode\nobreak\ \leavevmode\nobreak\ \text{where}\leavevmode\nobreak\ \leavevmode\nobreak\ { \bm{A}}={\bm{W}}{\bm{S}}_{k}\text{\leavevmode\nobreak\ \leavevmode\nobreak\ and}\leavevmode\nobreak\ \leavevmode\nobreak\ {\bm{B}}=({\bm{S}}^{\top}_{k}{ \bm{W}}{\bm{S}}_{k})^{\dagger}{\bm{S}}_{k}^{\top}{\bm{W}}.$ (3) $$

#### II. CR decomposition [ 15 ]

Assuming ${\bm{W}}$ can be factored as ${\bm{W}}_{1}{\bm{W}}_{2}$, let ${\bm{S}}_{k}$ be a $k$-column selection matrix, the corresponding CR approximation of ${\bm{W}}$ is

$$ $\displaystyle{\bm{W}}_{\text{CR}}={\bm{A}}{\bm{B}},\leavevmode\nobreak\ \leavevmode\nobreak\ \text{where}\leavevmode\nobreak\ \leavevmode\nobreak\ { \bm{A}}={\bm{W}}_{1}{\bm{S}}_{k}\text{\leavevmode\nobreak\ \leavevmode\nobreak \ and}\leavevmode\nobreak\ \leavevmode\nobreak\ {\bm{B}}={\bm{S}}_{k}^{\top}{ \bm{W}}_{2}.$ (4) $$

#### III. Singular value decomposition [ 22 ]

SVD is renowned for yielding the minimum approximation error when measured in the Frobenius norm. It decomposes ${\bm{W}}$ into:

$$ $\displaystyle{\bm{W}}_{\text{SVD}}={\bm{A}}{\bm{B}},\leavevmode\nobreak\ \leavevmode\nobreak\ \text{where}\leavevmode\nobreak\ \leavevmode\nobreak\ { \bm{A}}={\bm{U}}_{k}\text{\leavevmode\nobreak\ \leavevmode\nobreak\ and} \leavevmode\nobreak\ \leavevmode\nobreak\ {\bm{B}}=\bm{\Sigma}_{k}{\bm{V}}_{k} ^{\top}.$ (5) $$

Here, ${\bm{U}}_{k}$ and ${\bm{V}}_{k}$ are matrices containing the top-$k$ left and right singular vectors, respectively, and $\bm{\Sigma}_{k}$ is the diagonal matrix consisting of the top-$k$ singular values of ${\bm{W}}$.

## 3 MoDeGPT

Figure: Figure 2: The MoDeGPT Framework. MoDeGPT divides a transformer layer into three distinct colored modules, each optimizing two matrices using a specific low-rank approximation method. A twill hatch pattern represents the dimension reduction.
Refer to caption: x3.png

MoDeGPT introduces a module-level optimization that jointly compresses two matrices within each of our three defined functional modules, rather than compressing each matrix independently as in traditional low-rank approximation methods. An illustration of MoDeGPT is presented in Figure 2, where different colors distinguish the various modules. For each module, we apply a tailored low-rank approximation to compress the matrix pair within it. The twill hatch pattern represents dimension reductions.

In the rest of this section, we first present the mathematical objective for our approach.
Then, we detail our application of low-rank approximations for effective compression within each module. Finally, we introduce a method for assigning sparsity levels across different layers that requires only one forward pass of the model on the calibration data.

### 3.1 Modular Reconstruction Objective

The objective of MoDeGPT is to jointly optimize two matrices within the module types described in Sec. 2.2, a process we term modular decomposition, to minimize the modular reconstruction error $V$:

$$ $\displaystyle{V}^{*}\triangleq\min_{\hat{{\bm{W}}}_{1},\hat{{\bm{W}}}_{2}}\sum _{i=1}^{N}\|f({\bm{X}}_{i};{\bm{W}}_{1},{\bm{W}}_{2})-{f}({\bm{X}}_{i};\hat{{ \bm{W}}}_{1},\hat{{\bm{W}}}_{2})\|_{F}^{2}\leavevmode\nobreak\ \leavevmode \nobreak\ \text{such that }(\hat{{\bm{W}}}_{1},\hat{{\bm{W}}}_{2})\in\mathcal{ C},$ (6) $$

where ${\bm{X}}_{i}\in\mathbb{R}^{T\times d}$ are samples in the calibration set, and $\mathcal{C}$ represents the constrained search space for compressed matrices that mandates specific structures or dimensions.
A key motivation of our proposed objective is that it expands the search space to include dimension-reduced matrices, thereby increasing optimization flexibility and enhancing inference speedup in the compressed model. This contrasts with independent optimization, where each matrix must adhere to the original dimensions.

### 3.2 Algorithms

In this section, we describe the compression algorithm for each module, linking it to the matrix approximation discussed in Section 2.3. The proofs are provided in Appendix A.

#### Type-I compression

First, we focus on the MLP module. As detailed in Section 2.2, the ${\bm{W}}_{1}$ and ${\bm{W}}_{2}$ matrices we need to compress are ${{\bm{W}}}_{U}$, ${\bm{W}}_{D}$. Since ${{\bm{W}}}_{U}$ is inside a nonlinear function $\sigma_{s}$, we constrain the search space for its approximation to a matrix multiplication ${{\bm{W}}}_{U}{\bm{S}}_{k}$ for tractability, where ${\bm{S}}_{k}$ is the $k$-column selection matrix. For ${\bm{W}}_{D}$, we simply ensure that its dimensions are compatible with ${{\bm{W}}}_{U}{\bm{S}}_{k}$.
Our first theorem suggests that under the search spaces, the optimization in equation 6 is closely related to the Nyström approximation of the activation correlation matrix.

###### Theorem 1 ( MLP compression can be solved by Nyström approximation ) .

Let $\hat{{{\bm{W}}}}_{U}$ be searched over the matrix multiplication form ${{\bm{W}}}_{U}{\bm{S}}_{k}$, where ${\bm{S}}_{k}$ is a $k$-column selection matrix, and let $\hat{{\bm{W}}}_{D}$ be searched over $\mathbb{R}^{k\times d_{h}}$. The optimal $\hat{{\bm{W}}}^{*}_{D}$ is then given by: $({\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}{\bm{S}}_{k})^{\dagger}{\bm{S}}_{k}^{\top
}{\bm{C}}_{\sigma}{\bm{W}}_{D}$. Using ${{\bm{W}}}_{U}{\bm{S}}_{k}$ and $\hat{{\bm{W}}}^{*}_{D}$ as the compressed matrices, the Type-I reconstruction error in equation 6 satisfies:

$$ $\displaystyle V_{\text{I}}\leq\left\|{\bm{W}}_{D}\right\|_{2}^{2}\|{\bm{C}}^{- 1}_{\sigma}\|_{2}\mathcal{E}^{2}_{\text{Nys}}({\bm{C}}_{\sigma}),$ (7) $$

where $\mathcal{E}_{\text{Nys}}({\bm{C}}_{\sigma})$ denotes the Nyström approximation error, defined in Def. 1, relative to the activation correlation ${\bm{C}}_{\sigma}\triangleq\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{{\bm{W}}_{U}})^{
\top}\sigma({\bm{X}}_{i}{{\bm{W}}_{U}})$,
using the same ${\bm{S}}_{k}$ in the compression of ${{{\bm{W}}}}_{U}$.

Theorem 1 demonstrates that an effective Type-I compression can be achieved by designing a good Nyström approximation of ${\bm{C}}_{\sigma}$. Consequently, we propose Algorithm 1. Proposition 1 shows that the module reconstruction error can be controlled by Algorithm 1:

###### Proposition 1 .

Suppose that the rank $k$ and the scores $s_{i}$ in Algorithm 1 are chosen such that there exists an error $\varepsilon>0$ satisfying $\varepsilon\geq\sum_{i=k+1}^{d_{int}}s_{i}$, then the Type-I modular reconstruction error in equation 6 is bounded by $V_{I}\leq\|{\bm{W}}_{D}\|_{2}^{2}\|{\bm{C}}^{-1}_{\sigma}\|_{2}\frac{
\varepsilon^{2}{d^{2}_{int}}}{k^{2}(1-\varepsilon)^{2}}\sum_{i=k+1}^{d_{int}}
\sigma_{i}^{2}({\bm{C}}_{\sigma})$, where $d_{\text{int}}$ and $\sigma_{i}$ denote the intermediate dimension (i.e., the input dimension of $W_{D}$) and singular values, respectively.

Figure: Algorithm 1 Type-I compression for MLP by Nyström approximation.

###### Theorem 1 ( MLP compression can be solved by Nyström approximation ) .

###### Proposition 1 .

#### Type-II compression

Next, we turn our attention to the Type-II module, which includes the key-query interactions within the multi-head attention mechanisms. We will apply compression to each head independently (^1^11Dependency on the head is omitted in the equations for ease of notation.). Given that both ${\bm{W}}_{Q}$ and ${\bm{W}}_{K}$ are embeded with nonlinear functions, we opt for a simple optimization. Both matrices are compressed using the same matrix multiplication: $\hat{{\bm{W}}}_{Q}={\bm{W}}_{Q}{\bm{S}}_{k}$ and $\hat{{\bm{W}}}_{K}={\bm{W}}_{K}{\bm{S}}_{k}$, where ${\bm{S}}_{k}$ is a shared $k$-column selection matrix.
Within this constrained search space, we connect the modular reconstruction problem with the CR decomposition of the product of key and query correlations, as elaborated in the following theorem.

###### Theorem 2 ( Key-Query compression can be solved by CR approximation ) .

Let the compressed $\hat{{\bm{W}}}_{Q}$, $\hat{{\bm{W}}}_{K}$ to be the form of ${\bm{W}}_{Q}{\bm{S}}_{k},{\bm{W}}_{K}{\bm{S}}_{k}$, then Type-II reconstruction error in equation 6 has

$$ $\displaystyle V_{\text{II}}\leq\mathcal{E}_{\text{CR}}^{2}({\bm{C}}^{\frac{1}{ 2}}_{K}{\bm{C}}^{\frac{1}{2}}_{Q}),$ (8) $$

where $\mathcal{E}_{\text{CR}}$ denotes the CR approximation error, defined in Def. 1, relative to ${\bm{C}}_{Q}^{1/2}{\bm{C}}_{K}^{1/2}$, utilizing the same ${\bm{S}}_{k}$ in the compression. Here, the matrices ${\bm{C}}_{Q}\triangleq\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{Q})^{\top}
\sigma({\bm{X}}_{i}{\bm{W}}_{Q})$ and ${\bm{C}}_{K}\triangleq\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{K})^{\top}
\sigma({\bm{X}}_{i}{\bm{W}}_{K})$ denote the correlations of query and key states, respectively.

The theorem above demonstrates that effective compression for Type-II module can be achieved through a carefully designed CR approximation. Consequently, we introduce Algorithm 2, which comes with the following reconstruction guarantees:

Figure: Algorithm 2 Type-II compression for key-query matrices by CR decomposition.

###### Proposition 2 .

If we adopt Algorithm 2 then Type-II modular reconstruction error is bounded by $V_{\text{II}}\leq\left(\frac{d_{h}-k}{d_{h}}\right)^{2}\left(\sum_{i=1}^{d_{h}
}\sigma_{i}({\bm{C}}_{K})\right)\left(\sum_{i=1}^{d_{h}}\sigma_{i}({\bm{C}}_{Q
})\right)$, where $\sigma_{i}$ denotes the singular values.

###### Theorem 2 ( Key-Query compression can be solved by CR approximation ) .

###### Proposition 2 .

#### Type-III compression

Finally, we focus on the Type-III module, which involves the value-output matrices. For clarity and simplicity, we omit the head dependency. The module operates through linear transformations defined as $f({\bm{X}})={\bm{X}}\hat{{\bm{W}}}_{V}\hat{{\bm{W}}}_{O}$, where our goal is to find compressions $\hat{{\bm{W}}}_{V}\in\mathbb{R}^{d_{h}\times k}$, $\hat{{\bm{W}}}_{O}\in\mathbb{R}^{k\times d_{h}}$ such that $\hat{{\bm{W}}}_{V}\hat{{\bm{W}}}_{O}\approx{{\bm{W}}}_{V}{{\bm{W}}}_{O}$.
The subsequent theorem reveals that the reconstruction can be solved optimally by applying the well-known Singular Value Decomposition.

###### Theorem 3 ( Value-Output compression can be solved by SVD ) .

If we search $\hat{{\bm{W}}}_{V}$ and $\hat{{\bm{W}}}_{O}$ over $\mathbb{R}^{d_{h}\times k}$ and $\mathbb{R}^{k\times d_{h}}$, respectively, the optimum in equation 6 is $\hat{{\bm{W}}}_{V}={\bm{C}}^{-1/2}{\bm{U}}_{k}$ and $\hat{{\bm{W}}}_{O}=\bm{\Sigma}{\bm{V}}^{\top}$. Here, ${\bm{U}}\bm{\Sigma}{\bm{V}}^{\top}$ and ${\bm{C}}\triangleq\sum_{i=1}^{N}{\bm{X}}_{i}^{\top}{\bm{X}}_{i}$ are the SVD of ${\bm{C}}^{1/2}{\bm{W}}_{V}{\bm{W}}_{O}$ and input correlation, respectively. The corresponding Type-III reconstruction error in equation 6 is exactly the SVD approximation error, defined in Def. 1, relative to ${\bm{C}}^{\frac{1}{2}}{\bm{W}}_{V}{\bm{W}}_{O}$:

$$ $\displaystyle V_{\text{III}}=\mathcal{E}^{2}_{\text{SVD}}({\bm{C}}^{\frac{1}{2 }}{\bm{W}}_{V}{\bm{W}}_{O}).$ (9) $$

Building on the established equivalence to SVD via Theorem 3, we introduce Algorithm 3. This algorithm guarantees the following:

###### Proposition 3 .

Denote $\sigma_{i}$ as the singular values, Algorithm 3 yields the optimal Type-III modular reconstruction error $V_{\text{III}}=\sum_{i=k+1}^{d}\sigma_{i}^{2}({\bm{C}}^{\frac{1}{2}}{{\bm{W}}_
{V}}{{\bm{W}}_{O}})$.

Figure: Algorithm 3 Type-III compression for value-output matrices by SVD.

###### Theorem 3 ( Value-Output compression can be solved by SVD ) .

###### Proposition 3 .

### 3.3 Global Sparsity Allocation

While MoDeGPT modules are optimized locally, we propose a global optimization strategy that translates layer importance scores into sparsity allocations across layers. This strategy seeks to maximize the sum of importance scores, weighted by the parameters retained in each layer. To avoid the negative effects of excessive sparsity [], we incorporate entropic regularization for smoothing. The formulation of this constrained optimization problem is as follows:

$$ $\displaystyle\max_{\phi_{1:L}}\sum_{i=1}^{L}s_{i}(1-\phi_{i})+\varepsilon H( \phi_{i})\quad\text{such that }\frac{1}{L}\sum_{i=1}^{L}\phi_{i}=\phi_{\text{ avg}},\quad 0\leq\phi_{i}\leq 1,$ (10) $$

where $\phi_{i}$ and $s_{i}$ represent the sparsity and importance score of layer $i$, respectively, and $\phi_{\text{avg}}$ denotes the overall target sparsity.
For sufficiently large
$\varepsilon$, the following theorem demonstrates that the optimal layer sparsity distribution can be easily computed as:

$$ $\displaystyle\bm{\phi}=L\phi_{\text{avg}}\times\text{Softmax}(-{\mathbf{s}}/ \varepsilon).$ (11) $$

###### Theorem 4 .

For sufficient large $\varepsilon$, (11) is the optimal sparsity allocation in the equation 10.

In our implementations, we adopt the Block Influence (BI) score in [], which is the negative correlation between a layer’s input and output defined by: $s=1-\mathbb{E}{\mathbf{x}}^{\top}_{\text{in}}{\mathbf{x}}_{\text{out}}/\|{
\mathbf{x}}_{\text{in}}\|_{2}\|{\mathbf{x}}_{\text{out}}\|_{2}$.

###### Theorem 4 .

## 4 Experiments

### 4.1 Setups

#### Models

We evaluated our MoDeGPT method using several models that employ a sequential transformer block structure: OPT [] across multiple scales (125M, 1.3B, 2.7B, 6.7B), LLaMA-1 at 7B, LLaMA-2 [] at 7B and 13B, and LLaMA-3 [] at 8B.

#### Implementations and environments

We implemented our models using Hugging Face Transformers [], with correlation computations in FP64. Model compression and performance testing were carried out on a single NVIDIA A100 80 GB GPU. Additional details can be found in Appendix B.2.

#### Datasets

Following calibration setups similar to those in previous works [, , ], we used WikiText-2 [] and Alpaca datasets [], each with 128 samples of length 2048. Zero-shot performance was assessed using LM Evaluation Harness [] across ARC-e, ARC-c [], PIQA [], WinoGrande [], and HellaSwag [], OpenBookQA [], MathQA [], BoolQ [] datasets.

#### Baseline comparisons

We benchmarked our approach against several baselines. For non-gradient-based large language model pruning, we compared it with Uniform Pruning, Magnitude Pruning, SVD, SliceGPT [], ShortGPT [], and Optimal Brain Damage []. For methods involving backward propagation, our comparisons included LLM-Pruner [] and LLM Surgeon []. Additionally, we tested our methods against recent related works based on reconstruction and decomposition, including feature-mimic compression methods FLAP [], Bolaco [], where compressed models replicate the original models’ outputs, as well as SVD-based methods FWSVD [], ASVD [], SVD-LLM [] that employ variants of singular value decomposition to reduce model size. Finally, we compared with semi-structured compression methods such as SparseGPT [], Wanda [], and PrunerZero [], which require special GPU support for efficient inference with its sparsity patterns (2:4).

### 4.2 Generation Performance

**Table 2: Perplexity comparisons of structured pruning methods for llama-2 7B and 13B on WikiText-2, calibrated with 128 sequences of 2048 tokens.**
| Method | No | 7B (ppl: 5.12 $\downarrow$)        Llama-2<br>13B (ppl: 4.57 $\downarrow$) |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Gradient | 10% | 20% | 30% | 40% | 50% | 10% | 20% | 30% | 40% | 50% |  |
| K-OBD [, ] | ✗ | 5.48 | 9.14 | 15.43 | 28.03 | 46.64 | 4.91 | 6.29 | 10.08 | 13.06 | 16.06 |
| LLM-Pruner [] (^2^22The official code [] encountered an out-of-memory error with the 13B model, except at 20% compression.) | ✗ | 7.11 | 9.29 | 13.56 | 17.90 | 31.05 | OOM | 14.21 | OOM | OOM | OOM |
| LLM surgeon [] | ✗ | 5.25 | 6.18 | 7.83 | 10.39 | 15.38 | 4.69 | 5.29 | 6.21 | 7.25 | 9.43 |
| Uniform | ✓ | 19.09 | 27.13 | 46.25 | 176.24 | 327.99 | 13.78 | 18.18 | 29.05 | 45.44 | 82.60 |
| Magnitude | ✓ | 861.76 | 821.34 | 9623 | Overflow | Overflow | 22.41 | 320.39 | 723.60 | 2105 | 3004 |
| SVD | ✓ | Overflow | Overflow | 52719 | 51229 | Overflow | 7655 | 9919 | 21248 | 53672 | 39521 |
| ShortGPT [] | ✓ | 6.98 | 14.31 | 33.21 | 71.04 | 268.11 | 5.40 | 7.69 | 30.48 | 48.83 | 187.23 |
| SliceGPT [] | ✓ | 6.46 | 7.68 | 10.47 | 15.19 | 24.82 | 5.67 | 6.68 | 8.68 | 12.56 | 20.57 |
| MoDeGPT (ours) | ✓ | 5.48 | 6.16 | 7.51 | 8.41 | 11.88 | 4.83 | 5.29 | 6.10 | 6.95 | 8.95 |

We evaluated the generation performance of compressed Llama-2 models (7B and 13B) using the WikiText-2 test split in Table 2, 3 and B.3.
Results for OPT and Llama-3 8B are included in Appendices B.1 and B.3. The table distinguishes between compression methods using gradients (top rows) and those without (bottom rows).
Among non-gradient methods, the traditional matrix decomposition approach using SVD performed the worst. In sharp contrast, MoDeGPT outperformed all other baselines at various compression rates by jointly applying decomposition to multiple matrices within a module; it only increased the perplexity by 20% for 20% compression of the 7B model, which is substantially better than the next best alternative that saw a 50% increase.

Figure: Figure 3: Comparisons with semi-structured pruning.

In comparison to gradient-based methods, MoDeGPT surpassed other structured compression
techniques except for a low compression rate (20%). This demonstrates that using local reconstruction as a proxy for true loss can achieve state-of-the-art compression.
On the other hand, as shown in Table 3, the state-of-the-art non-structured methods, Wanda, SparseGPT, and ZeroPruner, generally outperformed MoDeGPT at 50% compression rate. However, MoDeGPT with 40% compression achieves a significantly better perplexity (8.41 versus 10.17). The observation suggests that with a small concession on compression rate, our structured compression can be on par with the semi-structured method that requires special GPU support for efficient inference.

### 4.3 Zero-shot performance

**Table 3: Zero-shot task performance of compressed Llama-2 7B and Llama-3 8B.**
| Model | Compress. | Method | ARC-e | ARC-c | PIQA | WinoG. | HellaS. | Average |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| llama-2<br>7B | 0 | Dense | 74.58 | 46.25 | 79.11 | 69.06 | 75.99 | 69.00 |
| 30 | ShortGPT [] | 48.65 | 32.85 | 64.31 | 64.33 | 56.13 | 53.25 |  |
| SliceGPT [] | 58.88 | 33.36 | 68.55 | 58.01 | 49.86 | 53.73 |  |  |
| LLM surgeon [] | 63.09 | 36.69 | 73.56 | 61.09 | 60.72 | 59.03 |  |  |
| MoDeGPT (ours) | 63.26 | 38.73 | 70.40 | 67.32 | 63.26 | 60.78 |  |  |
| MoDeGPT-Alpaca (ours) | 65.49 | 39.16 | 73.34 | 66.22 | 65.90 | 62.02 |  |  |
| 40 | ShortGPT [] | 41.16 | 29.94 | 60.12 | 60.46 | 43.67 | 47.07 |  |
| SliceGPT [] | 36.49 | 24.57 | 54.90 | 53.43 | 34.80 | 40.84 |  |  |
| LLM surgeon [] | 52.31 | 30.29 | 69.26 | 54.38 | 48.04 | 50.86 |  |  |
| MoDeGPT (ours) | 49.45 | 30.03 | 64.96 | 61.96 | 53.01 | 51.88 |  |  |
| MoDeGPT-Alpaca (ours) | 59.76 | 34.73 | 70.35 | 64.40 | 58.63 | 57.58 |  |  |
| llama-3<br>8B | 0 | Dense | 77.69 | 53.58 | 80.63 | 72.69 | 79.16 | 72.75 |
| 25 | ShortGPT-Alpaca [] | 38.13 | 31.40 | 60.94 | 54.22 | 31.52 | 43.24 |  |
| SliceGPT-Alpaca [] | 44.44 | 29.27 | 57.56 | 58.48 | 41.08 | 46.17 |  |  |
| MoDeGPT-Alpaca (ours) | 67.05 | 41.13 | 75.52 | 69.61 | 66.49 | 63.96 |  |  |

**Table 4: Comparisons of feature-mimic based methods for 30% compression of Llama-2 7B and 13B models.**
| Model | Method | ARC-e | ARC-c | PIQA | WinoG. | HellaS. | BoolQ | OBQA | Average. |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| llama-2 7B | Dense | 74.58 | 46.25 | 79.11 | 69.06 | 75.99 | 77.74 | 44.20 | 66.70 |
| LLM Pruner [] | 61.41 | 33.96 | 71.93 | 58.72 | 59.49 | 61.41 | 36.60 | 53.52 |  |
| FLAP [] | 60.65 | 34.47 | 72.74 | 64.01 | 63.80 | 66.88 | 36.40 | 56.99 |  |
| Bolaco (5 $\times$ 4) [] | 65.87 | 34.30 | 71.27 | 64.48 | 57.85 | 73.85 | 37.80 | 57.92 |  |
| MoDeGPT (ours) | 65.49 | 39.16 | 73.34 | 66.22 | 65.90 | 69.76 | 39.00 | 59.83 |  |
| llama-2 13B | Dense | 77.48 | 49.23 | 80.47 | 72.22 | 79.39 | 80.52 | 45.20 | 69.22 |
| LLM Pruner [] | 65.45 | 40.36 | 75.90 | 60.22 | 67.90 | 62.43 | 44.60 | 59.55 |  |
| FLAP [] | 67.38 | 38.23 | 74.81 | 67.48 | 70.29 | 65.54 | 40.00 | 60.53 |  |
| Bolaco (5 $\times$ 4) [] | 71.76 | 40.10 | 74.16 | 69.06 | 66.66 | 75.63 | 41.60 | 62.71 |  |
| MoDeGPT (ours) | 70.24 | 41.47 | 77.15 | 71.27 | 71.84 | 73.7 | 41.00 | 63.81 |  |

**Table 5: Comparisons with SVD-based methods in Llama-1 7B.**
| Compress. Rate | Method | WikiText-2 $\downarrow$ | PTB $\downarrow$ | ARC-e | ARC-c | PIQA | WinoG. | HellaS. | MathQA | OBQA | Avg. |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0% | Dense | 5.68 | 8.35 | 73 | 42 | 79 | 70 | 50 | 27 | 34 | 54 |
| 20% | FWSVD [] | 1727 | 2152 | 31 | 23 | 56 | 50 | 26 | 21 | 15 | 32 |
| ASVD [] | 11.14 | 16.55 | 53 | 27 | 68 | 64 | 41 | 24 | 25 | 43 |  |
| SVD-LLM [] | 7.94 | 16.22 | 58 | 29 | 69 | 58 | 43 | 24 | 22 | 44 |  |
| MoDeGPT (ours) | 6.53 | 39.17 | 70 | 36 | 74 | 69 | 50 | 26 | 31 | 51 |  |
| 40% | FWSVD [] | 18156 | 20990 | 26 | 22 | 53 | 51 | 26 | 21 | 16 | 30 |
| ASVD [] | 1407 | 3292 | 28 | 22 | 55 | 48 | 26 | 19 | 12 | 30 |  |
| SVD-LLM [] | 13.11 | 63.75 | 42 | 25 | 60 | 58 | 33 | 21 | 19 | 37 |  |
| MoDeGPT (ours) | 9.39 | 60.55 | 58 | 30 | 65 | 64 | 40 | 23 | 22 | 43 |  |

We assessed our method on five zero-shot tasks, comparing it against leading baselines. In line with generation performance trends, our method showed much superior results at higher compression rates. Notably, it excelled on WinoGrande but had worse results on PIQA, suggesting different biases in compression strategies compared to LLM Surgeon. On the bottom rows show that our method calibrated with the Alpaca dataset (instead of the WikiText-2 data used in other rows) significantly boosted zero-shot performance; a 30% compression resulted in only a 10% accuracy drop. This effect was more pronounced for Llama-13B, as shown in Table 9 in Appendix B.3.

We also tested the newer llama-3 8B model, adapting our algorithm to accommodate the head dependency of grouped query attention as outlined in Appendix B.1. The performance discrepancy between our method and other baselines was notably larger with this model.
Finally, in Table 4 and 5, we compare our method against feature-mimic and SVD-based approaches, respectively. In the former case, we observe that alternative methods generally underperform compared to state-of-the-art gradient-based techniques like LLM Surgeon, while our approach achieves comparable or even superior results. In the latter comparison, our advantage is even more pronounced, which we attribute to our more refined decomposition algorithms, tailored specifically to different components of the transformer architecture based on their levels of nonlinearity, rather than relying solely on SVD-based decompositions.

Figure: Figure 4: Compute time.
Refer to caption: x4.png

### 4.4 Computation and Throughput

Table 5 compares the compression costs of MoDeGPT with LLM surgeon, the best-performing prior work. Given that the hourly rate for H100 is about twice that of A100 [], MoDeGPT offers significant cost savings—97% for the 7B model and 98.5% for the 13B model. Next, we benchmark throughput. We set the sequence length to 256 and recorded the average generation time of Llama-2 7B on a single A100 GPU with batch size 256.
In Figure 5, SVD exhibits lower throughput than the uncompressed model due to the doubled amount of matrices in its decomposed form which makes computation less parallelizable. SliceGPT, while achieving greater throughput, sees less than a 10% speedup, hindered by additional computations in residual paths. In contrast, MoDeGPT achieves non-trivial speedups that increase with compression rates; at 50% compression, it achieves a 58% increase in throughput, significantly surpassing both SVD and SliceGPT. However, at compression rates below 10%, throughput drops below that of the uncompressed model. This decrease is attributed to the implementation of the compressed Type-II module, which needs an optimized kernel to better parallelize the computation of the pruned attention heads. We leave the implementation of such an optimized computation kernel as future work to address the corner case.

Figure: Figure 6: Module-wise compression in llama-2 7B.
Refer to caption: x5.png

### 4.5 Ablation study

Figure: Figure 8: Impact of calibration size.
Refer to caption: x6.png

First, we examined the compression effects on each module type within LLama-2 7B. In Figure 7, the left panel shows that the majority of parameters are Type-I (gated MLP), which causes the major portion of perplexity deterioration when compressed, as shown in the right panel. The effective ratio $r$ in Table 7 presents the slope of perplexity increase normalized by module size, showing that Type-II is the most sensitive module type. This aligns with our theoretical results, showing that Type-II has the weakest error bound since it is constrained by the complete spectrum, not merely a residual one (see Propositions 1, 2, 3).
Additionally, Type-III module, where SVD is applied, takes up over 50% of the compression time, but it provides a milder perplexity change with a large compression rate.

Second, we explored the effects of calibration size
on a 30% compressed llama-2 7B model. As shown in Figure 10, increasing the calibration size initially boosts performance; however, the gains in zero-shot performance diminish for sizes larger than 128.

Lastly, we assessed the effects of sparsity allocation on the same model. Figure 10 displays the score-to-sparsity mapping outlined in Section 3.3 with $\varepsilon=0.1$, where darker regions indicate higher sparsity. Our result suggests that some layers (e.g., layer 26) can eliminate up to 82% of parameters without a major impact on accuracy. Table 10 shows our global sparsity allocation strategy significantly outperforms a naive uniform approach, suggesting that our decomposition method can work well with a simple scoring function for global sparsity assignment.

## 5 Conclusion

In this work, we introduced MoDeGPT, a novel structured compression method that generalizes matrix decomposition to the modular level, achieving state-of-the-art results for structured model compression via low-rank decomposition.
Our approach has a strong theoretical grounding, offering bounds on the reconstruction errors for the components in the Transformers.
Furthermore, MoDeGPT stands out by relying solely on forward propagation to achieve comparable or better compression performance to methods that use the gradients from backward propagation.
We believe our novel methods and findings will inspire more theoretical and algorithmic innovations for training-free model compression.

## Supplementary Material

.tocmtappendix
\etocsettagdepthmtchapternone
\etocsettagdepthmtappendixsubsection

## Appendix A Proofs

This section provides proofs for the theorems and propositions in the main text, along with definitions and assumptions for formalism.

First, we define the following notation.

###### Definition 2 (Column Selection Matrix) .

A $k$-column selection matrix ${\bm{S}}_{k}$ is a matrix with $k$ columns where each column has a single non-zero element indicating the selected index. For example, ${\bm{S}}_{3}=[[0,0,1,0]^{\top},[0,1,0,0]^{\top},[0,0,0,1]^{\top}]$ is a 3-column selection matrix selecting the third, second, and fourth columns. An important property is that any matrix right-multiplied by a column selection matrix will result in a matrix consisting of the selected columns.

Next, we make an assumption regarding the nonlinear functions used in all modules, which is crucial for validating our algorithms.

###### Assumption 1 .

Any column selection matrix ${\bm{S}}$ is commutative with the nonlinear functions under consideration. Specifically, the function $\sigma$ satisfies the property that $\sigma({\bm{X}}){\bm{S}}=\sigma({\bm{X}}{\bm{S}})$ for any ${\bm{X}}$ and any column selection matrix ${\bm{S}}$.

Importantly, Assumption 1 is met by any activation function that operates element-wise on the inputs, as well as by widely used embedding functions, such as the rotary positional embedding [].

###### Definition 2 (Column Selection Matrix) .

###### Assumption 1 .

### A.1 Proof of Theorem 1 and Proposition 1 : MLP Compression with Nyström Approximation

###### Theorem 1 ( MLP compression can be solved by Nyström approximation ) .

Let $\hat{{{\bm{W}}}}_{U}$ be searched over the matrix multiplication form ${{\bm{W}}}_{U}{\bm{S}}_{k}$, where ${\bm{S}}_{k}$ is a $k$-column selection matrix, and let $\hat{{\bm{W}}}_{D}$ be searched over $\mathbb{R}^{k\times d_{h}}$. The optimal $\hat{{\bm{W}}}^{*}_{D}$ can then be expressed as: $({\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}{\bm{S}}_{k})^{\dagger}{\bm{S}}_{k}^{\top
}{\bm{C}}_{\sigma}{\bm{W}}_{D}$. Using ${{\bm{W}}}_{U}{\bm{S}}_{k}$ and $\hat{{\bm{W}}}^{*}_{D}$ as the compressed matrices, the Type-I reconstruction error in equation 6 satisfies:

$$ $\displaystyle V_{\text{I}}\leq\left\|{\bm{W}}_{D}\right\|_{2}^{2}\mathcal{E}^{ 2}_{\text{Nys}}({\bm{C}}_{\sigma}^{\frac{1}{2}}),$ (12) $$

where $\mathcal{E}_{\text{Nys}}({\bm{C}}_{\sigma}^{\frac{1}{2}})$ denotes the Nyström approximation error, defined in Def. 1, relative to the activation correlation matrix ${\bm{C}}_{\sigma}\triangleq\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{{\bm{W}}_{U}})^{
\top}\sigma({\bm{X}}_{i}{{\bm{W}}_{U}})$,
using the same ${\bm{S}}_{k}$ in the compression of ${{{\bm{W}}}}_{U}$.

###### Proof.

Ideally, we want to seek low-rank matrices ${\bm{W}}_{U}$, ${\bm{W}}_{D}$ without any constraint; however, the nonlinearity between the two matrices makes the optimal solution intractable. To overcome the nonlinearity between the two matrices, we instead restrict the compressed up matrix $\hat{{{\bm{W}}}}_{U}$ to be of the form ${\bm{W}}_{U}{\bm{S}}_{k}$, ${\bm{S}}_{k}\in\mathbb{R}^{d\times k}$ is a $k$-column selection matrix and $\hat{{\bm{W}}}_{D}$ is a general $\mathbb{R}^{k\times d}$ matrix. Plug in this form, we can simplify equation 6 as

$$ $\displaystyle\min_{{\bm{S}}_{k},\hat{{\bm{W}}}_{D}}\sum_{i=1}^{N}\|f({\bm{X}}_ {i})-\sigma({\bm{X}}_{i}{\bm{W}}_{U}{\bm{S}}_{k})\hat{{\bm{W}}}_{D}\|_{F}^{2}$ $\displaystyle\overset{(a)}{=}\leavevmode\nobreak\$ $\displaystyle\min_{{\bm{S}}_{k},\hat{{\bm{W}}}_{D}}\sum_{i=1}^{N}\|\sigma({\bm {X}}_{i}{\bm{W}}_{U}){\bm{W}}_{D}-\sigma({\bm{X}}_{i}{\bm{W}}_{U}){\bm{S}}_{k} \hat{{\bm{W}}}_{D}\|_{F}^{2}$ $\displaystyle=\leavevmode\nobreak\$ $\displaystyle\min_{{\bm{S}}_{k},\hat{{\bm{W}}}_{D}}\operatorname{Tr}\left(\sum _{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{U})^{\top}\sigma({\bm{X}}_{i}{\bm{W}}_{ U})\left({\bm{W}}_{D}-{\bm{S}}_{k}\hat{{\bm{W}}}_{D}\right)\left({\bm{W}}_{D}- {\bm{S}}_{k}\hat{{\bm{W}}}_{D}\right)^{\top}\right)$ $\displaystyle=\leavevmode\nobreak\$ $\displaystyle\min_{{\bm{S}}_{k},\hat{{\bm{W}}}_{D}}\|{\bm{C}}^{\frac{1}{2}}_{ \sigma}\left({\bm{W}}_{D}-{\bm{S}}_{k}\hat{{\bm{W}}}_{D}\right)\|_{F}^{2},$ (13) $$

where ${\bm{C}}_{\sigma}$ is the empirical correlation matrix of latent features
${\bm{C}}_{\sigma}=\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{U})^{\top}\sigma(
{\bm{X}}_{i}{\bm{W}}_{U})$, and (a) follows from Assumption 1.
Setting the gradient of the last expression with respect to $\hat{{\bm{W}}}_{D}$ to zero, we obtain the optimal down matrix $\hat{{\bm{W}}}^{*}_{D}=\left({\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}{\bm{S}}_{k}
\right)^{\dagger}{\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}{\bm{W}}_{D}$.
After Plugging this back to the objective,
we can further simplify the objective into,

$$ $\displaystyle\min_{{\bm{S}}_{k}}\left\|\left({\bm{C}}^{\frac{1}{2}}_{\sigma}-{ \bm{C}}^{\frac{1}{2}}_{\sigma}{\bm{S}}_{k}\left({\bm{S}}_{k}^{\top}{\bm{C}}_{ \sigma}{\bm{S}}_{k}\right)^{\dagger}{\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}\right ){\bm{W}}_{D}\right\|_{F}^{2}$ $\displaystyle\leq\leavevmode\nobreak\$ $\displaystyle\left\|{\bm{W}}_{D}\right\|_{2}^{2}\|{\bm{C}}^{-\frac{1}{2}}_{ \sigma}\|^{2}_{2}\min_{{\bm{S}}_{k}}\left\|{\bm{C}}_{\sigma}-{\bm{C}}_{\sigma} {\bm{S}}_{k}\left({\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}{\bm{S}}_{k}\right)^{ \dagger}{\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}\right\|_{F}^{2}=\left\|{\bm{W}}_{ D}\right\|_{2}^{2}\|{\bm{C}}^{-1}_{\sigma}\|_{2}\mathcal{E}^{2}_{\text{Nys}}({ \bm{C}}_{\sigma}).$ (14) $$

Now, observe that the error on the right side of equation 14 is proportional to the Nyström matrix approximation to the matrix ${\bm{C}}_{\sigma}$ in Definition 1. Hence, the variable ${\bm{S}}_{k}$ can be optimized with any Nyström approximation algorithm [].
In this work, we adapt a deterministic Nyström algorithm, Algorithm 1, that has the theoretical guarantee proved in the next proposition.
∎

###### Proposition 1 .

Suppose that the rank $k$ and the scores $s_{i}$ in Algorithm 1 are chosen such that there exists an error $\varepsilon>0$ satisfying $\varepsilon\geq\sum_{i=k+1}^{d_{int}}s_{i}$, then the Type-I modular reconstruction error in equation 6 is bounded by $V_{I}\leq\|{\bm{W}}_{D}\|_{2}^{2}\|{\bm{C}}^{-1}_{\sigma}\|_{2}\frac{
\varepsilon^{2}{d^{2}_{int}}}{k^{2}(1-\varepsilon)^{2}}\sum_{i=k+1}^{d_{int}}
\sigma_{i}^{2}({\bm{C}}_{\sigma})$, where $d_{\text{int}}$ and $\sigma_{i}$ denote the intermediate dimension (i.e., the input dimension of $W_{D}$) and singular values, respectively.

###### Proof.

Since our column selection is equivalent to applying the deterministic ridge leverage score sampling (DRLS) to ${\bm{C}}_{\sigma}^{\frac{1}{2}}$ [] , Theorem 1 in [] implies that

$$ $\displaystyle(1-\varepsilon){\bm{C}}_{\sigma}-\frac{\epsilon}{k}\left\|({\bm{C }}_{\sigma}^{\frac{1}{2}})_{\backslash k}\right\|_{F}^{2}\mathbf{I}\preceq{\bm {C}}_{\sigma}^{\frac{1}{2}}{\bm{S}}_{k}{\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}^{ \frac{1}{2}}\preceq{\bm{C}}_{\sigma}$ (15) $\displaystyle\Rightarrow\leavevmode\nobreak\$ $\displaystyle{\bm{C}}_{\sigma}\preceq\frac{\epsilon}{k(1-\varepsilon)}\left\|( {\bm{C}}_{\sigma}^{\frac{1}{2}})_{\backslash k}\right\|_{F}^{2}\mathbf{I}+ \frac{1}{1-\varepsilon}{\bm{C}}_{\sigma}^{\frac{1}{2}}{\bm{S}}_{k}{\bm{S}}_{k} ^{\top}{\bm{C}}_{\sigma}^{\frac{1}{2}}.$ (16) $$

Next, we define ${\bm{P}}={\bm{C}}^{\frac{1}{2}}_{\sigma}{\bm{S}}_{k}({\bm{S}}_{k}^{\top}{\bm{C
}}_{\sigma}{\bm{S}}_{k})^{\dagger}{\bm{S}}_{k}^{\top}{\bm{C}}^{\frac{1}{2}}_{\sigma}$. We note that ${\bm{P}}$ is the projection matrix of the column space of ${\bm{C}}^{\frac{1}{2}}_{\sigma}{\bm{S}}$. Now, we multiply ${\bm{I}}-{\bm{P}}$ to both sides in the previous inequality to get

$$ $\displaystyle({\bm{I}}-{\bm{P}}){\bm{C}}_{\sigma}({\bm{I}}-{\bm{P}})$ (17) $\displaystyle\preceq\leavevmode\nobreak\$ $\displaystyle\frac{\epsilon}{k(1-\varepsilon)}\left\|({\bm{C}}_{\sigma}^{\frac {1}{2}})_{\backslash k}\right\|_{F}^{2}({\bm{I}}-{\bm{P}})+\frac{1}{1- \varepsilon}({\bm{I}}-{\bm{P}}){\bm{C}}_{\sigma}^{\frac{1}{2}}{\bm{S}}_{k}{\bm {S}}_{k}^{\top}{\bm{C}}_{\sigma}^{\frac{1}{2}}({\bm{I}}-{\bm{P}})$ (18) $\displaystyle\preceq\leavevmode\nobreak\$ $\displaystyle\frac{\epsilon}{k(1-\varepsilon)}\left\|({\bm{C}}_{\sigma}^{\frac {1}{2}})_{\backslash k}\right\|_{F}^{2}{\bm{I}},$ (19) $$

where in the last inequality we use the fact that ${\bm{I}}-{\bm{P}}\preceq{\bm{I}}$ and that ${\bm{I}}-{\bm{P}}$ is the orthogonal projection to the orthogonal complement of the column space ${\bm{C}}_{\sigma}^{\frac{1}{2}}{\bm{S}}$ so that ${\bm{S}}^{\top}{\bm{C}}_{\sigma}^{\frac{1}{2}}({\bm{I}}-{\bm{P}})=\mathbf{0}$.
Now, we have

$$ $\displaystyle\|({\bm{I}}-{\bm{P}}){\bm{C}}^{\frac{1}{2}}_{\sigma}{\bm{C}}^{ \frac{1}{2}}_{\sigma}({\bm{I}}-{\bm{P}})\|_{2}\leq\frac{\varepsilon}{k(1- \varepsilon)}\left\|({\bm{C}}_{\sigma}^{\frac{1}{2}})_{\backslash k}\right\|_{ F}^{2}=\frac{\varepsilon}{k(1-\varepsilon)}\sum_{i=k+1}^{d_{\text{int}}}\sigma _{i}({\bm{C}}_{\sigma})$ (20) $\displaystyle\Rightarrow\leavevmode\nobreak\$ $\displaystyle\|{\bm{C}}^{\frac{1}{2}}_{\sigma}({\bm{I}}-{\bm{P}})^{2}{\bm{C}}^ {\frac{1}{2}}_{\sigma}\|_{2}=\|{\bm{C}}^{\frac{1}{2}}_{\sigma}({\bm{I}}-{\bm{P }}){\bm{C}}^{\frac{1}{2}}_{\sigma}\|_{2}\leq\frac{\varepsilon}{k(1-\varepsilon )}\sum_{i=k+1}^{{d_{\text{int}}}}\sigma_{i}({\bm{C}}_{\sigma}).$ (21) $$

Since ${\bm{C}}^{\frac{1}{2}}_{\sigma}{\bm{P}}{\bm{C}}^{\frac{1}{2}}_{\sigma}={\bm{C}
}_{\sigma}{\bm{S}}_{k}\left({\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}{\bm{S}}_{k}
\right)^{\dagger}{\bm{S}}_{k}^{\top}{\bm{C}}_{\sigma}$, the inequality is equivalent to

$$ $\displaystyle\|{\bm{C}}_{\sigma}-{\bm{C}}_{\sigma}{\bm{S}}\left({\bm{S}}^{\top }{\bm{C}}_{\sigma}{\bm{S}}\right)^{\dagger}{\bm{S}}^{\top}{\bm{C}}_{\sigma}\|_ {2}\leq\frac{\varepsilon}{k(1-\varepsilon)}\sum_{i=k+1}^{d_{\text{int}}}\sigma _{i}({\bm{C}}_{\sigma}).$ (22) $$

Finally, we complete the proof by,

$$ $\displaystyle\mathcal{E}_{\text{Nys}}^{2}({\bm{C}}_{\sigma})\leavevmode\nobreak\$ $\displaystyle\overset{(a)}{\leq}{d_{\text{int}}}\|{\bm{C}}_{\sigma}-{\bm{C}}_{ \sigma}{\bm{S}}\left({\bm{S}}^{\top}{\bm{C}}_{\sigma}{\bm{S}}\right)^{\dagger} {\bm{S}}^{\top}{\bm{C}}_{\sigma}\|^{2}_{2}$ $\displaystyle\overset{(b)}{\leq}\frac{\varepsilon^{2}{d_{int}}}{k^{2}(1- \varepsilon)^{2}}\left(\sum_{i=k+1}^{d_{int}}\sigma_{i}({\bm{C}}_{\sigma}) \right)^{2}$ $\displaystyle\overset{(c)}{\leq}\frac{\varepsilon^{2}{d^{2}_{int}}}{k^{2}(1- \varepsilon)^{2}}\sum_{i=k+1}^{d_{int}}\sigma_{i}^{2}({\bm{C}}_{\sigma}),$ (23) $$

where (a) follows from that$\|{\bm{A}}\|_{F}\leq\sqrt{d}\|{\bm{A}}\|_{2}$ for any matrix ${\bm{A}}\in\mathbb{R}^{d\times d}$, (b) from equation 22, and (c) from Cauchy inequality that $\left(\sum_{i=1}^{n}x_{i}\right)^{2}\leq n\sum_{i=1}^{n}x_{i}^{2}$ for any sequence $\{x_{i}\}_{i}$.
∎

###### Theorem 1 ( MLP compression can be solved by Nyström approximation ) .

###### Proof.

###### Proposition 1 .

###### Proof.

### A.2 Proof of Theorem 2 and Proposition 2 : Key-Query Compression with CR Approximation

###### Theorem 2 ( Key-Query compression can be solved by CR approximation ) .

Let the compressed $\hat{{\bm{W}}}_{Q}$, $\hat{{\bm{W}}}_{K}$ to be the form of ${\bm{W}}_{Q}{\bm{S}}_{k},{\bm{W}}_{K}{\bm{S}}_{k}$, then Type-II reconstruction error in equation 6 has

$$ $\displaystyle V_{\text{II}}\leq\mathcal{E}_{\text{CR}}^{2}({\bm{C}}^{\frac{1}{ 2}}_{K}{\bm{C}}^{\frac{1}{2}}_{Q}),$ (24) $$

where $\mathcal{E}_{\text{CR}}$ denotes the CR approximation error, defined in Def. 1, relative to ${\bm{C}}_{Q}^{1/2}{\bm{C}}_{K}^{1/2}$, utilizing the same ${\bm{S}}_{k}$ in the compression. Here, the matrices ${\bm{C}}_{Q}\triangleq\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{Q})^{\top}
\sigma({\bm{X}}_{i}{\bm{W}}_{Q})$ and ${\bm{C}}_{K}\triangleq\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{K})^{\top}
\sigma({\bm{X}}_{i}{\bm{W}}_{K})$ denote the correlation matrices of query and key states, respectively.

###### Proof.

Regarding two nonlinear functions satisfying Assumption 1, we propose to optimize the reconstruction error with compressed key query matrices of the form ${\bm{W}}_{K}{\bm{S}}_{k},{\bm{W}}_{Q}{\bm{S}}_{k}$, where ${\bm{S}}_{k}$ is some column selection matrix.
Now the reconstruction error of this module is

$$ $\displaystyle\sum_{i=1}^{N}\|f({\bm{X}}_{i})-\sigma_{r}({\bm{X}}_{i}{\bm{W}}_{ Q}{\bm{S}}_{k})\sigma_{r}^{\top}({\bm{X}}_{i}{\bm{W}}_{K}{\bm{S}}_{k})\|_{F}^{2}$ $\displaystyle\overset{(a)}{=}\leavevmode\nobreak\$ $\displaystyle\sum_{i=1}^{N}\|\sigma_{r}({\bm{X}}_{i}{\bm{W}}_{Q})\left({\bm{I} }-{\bm{S}}_{k}{\bm{S}}_{k}^{\top}\right)\sigma^{\top}_{r}({\bm{X}}_{i}{\bm{W}} _{K})\|_{F}^{2}$ $\displaystyle=\leavevmode\nobreak\$ $\displaystyle\sum_{i=1}^{N}\operatorname{Tr}\left(\left({\bm{I}}-{\bm{S}}_{k}{ \bm{S}}_{k}^{\top}\right)\sigma_{r}({\bm{X}}_{i}{\bm{W}}_{Q})^{\top}\sigma_{r} ({\bm{X}}_{i}{\bm{W}}_{Q})\left({\bm{I}}-{\bm{S}}_{k}{\bm{S}}_{k}^{\top}\right )\sigma_{r}({\bm{X}}_{i}{\bm{W}}_{K})^{\top}\sigma_{r}({\bm{X}}_{i}{\bm{W}}_{K })\right)$ $\displaystyle\overset{(b)}{\leq}\leavevmode\nobreak\$ $\displaystyle\operatorname{Tr}\left(\sum_{i=1}^{N}\left({\bm{I}}-{\bm{S}}_{k}{ \bm{S}}_{k}^{\top}\right)\sigma_{r}({\bm{X}}_{i}{\bm{W}}_{Q})^{\top}\sigma_{r} ({\bm{X}}_{i}{\bm{W}}_{Q})\left({\bm{I}}-{\bm{S}}_{k}{\bm{S}}_{k}^{\top}\right )\sum_{j=1}^{N}\sigma_{r}({\bm{X}}_{j}{\bm{W}}_{K})^{\top}\sigma_{r}({\bm{X}}_ {j}{\bm{W}}_{K})\right)$ $\displaystyle\overset{(c)}{\leq}\leavevmode\nobreak\$ $\displaystyle\operatorname{Tr}\left({\bm{C}}_{K}\left({\bm{I}}-{\bm{S}}_{k}{ \bm{S}}_{k}^{\top}\right){\bm{C}}_{Q}\right)=\|{\bm{C}}_{K}^{\frac{1}{2}}{\bm{ C}}_{Q}^{\frac{1}{2}}-{\bm{C}}_{K}^{\frac{1}{2}}{\bm{S}}_{k}{\bm{S}}_{k}^{\top }{\bm{C}}_{Q}^{\frac{1}{2}}\|_{F}^{2}=\mathcal{E}_{\text{CR}}^{2}({\bm{C}}^{ \frac{1}{2}}_{K}{\bm{C}}^{\frac{1}{2}}_{Q}),$ (25) $$

where ${\bm{C}}_{K}=\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{Q}{\bm{S}}_{k})^{\top}
\sigma({\bm{X}}_{i}{\bm{W}}_{Q}{\bm{S}}_{k})$, ${\bm{C}}_{Q}=\sum_{i=1}^{N}\sigma({\bm{X}}_{i}{\bm{W}}_{K}{\bm{S}}_{k})^{\top}
\sigma({\bm{X}}_{i}{\bm{W}}_{K}{\bm{S}}_{k})$ are the correlation matrices associated with the outputs of ${\bm{W}}_{Q}$ and ${\bm{W}}_{K}$, respectively.
Here, (a) follows from Assumption 1, (b) follows from that $\left({\bm{I}}-{\bm{S}}_{k}{\bm{S}}_{k}^{\top}\right)\sigma_{r}({\bm{X}}_{i}{
\bm{W}}_{Q})^{\top}\sigma_{r}({\bm{X}}_{i}{\bm{W}}_{Q})\left({\bm{I}}-{\bm{S}}
_{k}{\bm{S}}_{k}^{\top}\right)$ and $\sigma_{r}({\bm{X}}_{j}{\bm{W}}_{K})^{\top}\sigma_{r}({\bm{X}}_{j}{\bm{W}}_{K})$ are positive semidefinite, and (c) follows from that $\mathbf{I}-{\bm{S}}_{k}{\bm{S}}_{k}^{\top}\preceq\mathbf{I}$.
From the last expression, we observe that the reconstruction is bounded by the CR approximation [] to the matrix-product ${\bm{C}}_{K}^{\frac{1}{2}}{\bm{C}}_{Q}^{\frac{1}{2}}$.
∎

###### Proposition 2 .

If we adopt Algorithm 2 then Type-II modular reconstruction error is bounded by $V_{\text{II}}\leq\left(\frac{d_{h}-k}{d_{h}}\right)^{2}\left(\sum_{i=1}^{d_{h}
}\sigma_{i}({\bm{C}}_{K})\right)\left(\sum_{i=1}^{d_{h}}\sigma_{i}({\bm{C}}_{Q
})\right)$, where $\sigma_{i}$ denotes the singular values.

###### Proof.

Our Algorithm 2 is a deterministic variant of [].
Recall that

$$ $\displaystyle\mathcal{E}_{\text{CR}}({\bm{C}}_{K}^{\frac{1}{2}}{\bm{C}}_{Q}^{ \frac{1}{2}})=\|{\bm{C}}_{k}^{\frac{1}{2}}{\bm{C}}_{Q}^{\frac{1}{2}}-{\bm{C}}_ {K}^{\frac{1}{2}}{\bm{S}}_{k}{\bm{S}}_{k}^{\top}{\bm{C}}_{Q}^{\frac{1}{2}}\|_{ F}=\|\sum_{i=k+1}^{d}{\bm{k}}_{i}{\bm{q}}_{i}^{\top}\|_{F},$ (26) $$

where ${\bm{k}}_{i}$ and ${\bm{q}}_{i}$ are the $i$-th column and $i$-th row of ${\bm{C}}_{k}^{\frac{1}{2}}$ and ${\bm{C}}_{q}^{\frac{1}{2}}$, respectively. Then,

$$ $\displaystyle\|\sum_{i=k+1}^{d}{\bm{k}}_{i}{\bm{q}}_{i}^{\top}\|_{F}\leq \leavevmode\nobreak\$ $\displaystyle\sum_{i=k+1}^{d}\|{\bm{k}}_{i}\|_{2}\|{\bm{q}}_{i}\|_{2}\overset{ (a)}{\leq}\leavevmode\nobreak\ \sqrt{\left(\sum_{i=k+1}^{d}\|{\bm{k}}_{i}\|_{2 }^{2}\right)\left(\sum_{i=k+1}^{d}\|{\bm{q}}_{i}\|_{2}^{2}\right)}$ (27) $\displaystyle\overset{(b)}{\leq}\leavevmode\nobreak\$ $\displaystyle\frac{d-k}{d}\sqrt{\left(\sum_{i=1}^{d}\|{\bm{k}}_{i}\|_{2}^{2} \right)\left(\sum_{i=1}^{d}\|{\bm{q}}_{i}\|_{2}^{2}\right)}=\leavevmode \nobreak\ \frac{d-k}{d}\|{\bm{C}}_{K}^{\frac{1}{2}}\|_{F}\|{\bm{C}}_{Q}^{\frac {1}{2}}\|_{F}$ (28) $\displaystyle=$ $\displaystyle\leavevmode\nobreak\ \frac{d-k}{d}\sqrt{\left(\sum_{i=1}^{d} \sigma_{i}({\bm{C}}_{K})\right)\left(\sum_{i=1}^{d}\sigma_{i}({\bm{C}}_{Q}) \right)},$ (29) $$

where in (a) we use Cauchy-Schwartz inequality and in (b) we use the fact that the column selection is based on the norm product in Algorithm 2.
∎

###### Theorem 2 ( Key-Query compression can be solved by CR approximation ) .

###### Proof.

###### Proposition 2 .

###### Proof.

### A.3 Proof of Theorem 3 and Proposition 3 : Value-Output Compression with SVD

###### Theorem 3 ( Value-Output compression can be solved by SVD ) .

If we search $\hat{{\bm{W}}}_{V}$ and $\hat{{\bm{W}}}_{O}$ over $\mathbb{R}^{d_{h}\times k}$ and $\mathbb{R}^{k\times d_{h}}$, respectively, the optimum in equation 6 is $\hat{{\bm{W}}}_{V}={\bm{C}}^{-\frac{1}{2}}{\bm{U}}_{k}$ and $\hat{{\bm{W}}}_{O}=\bm{\Sigma}{\bm{V}}^{\top}$. Here, ${\bm{U}}\bm{\Sigma}{\bm{V}}^{\top}$ and ${\bm{C}}\triangleq\sum_{i=1}^{N}{\bm{X}}_{i}^{\top}{\bm{X}}_{i}$ are the SVD of ${\bm{C}}^{\frac{1}{2}}{\bm{W}}_{V}{\bm{W}}_{O}$ and input correlation matrix, respectively. The corresponding Type-III reconstruction error in equation 6 is the SVD approximation error, defined in Def. 1, relative to ${\bm{C}}^{\frac{1}{2}}{\bm{W}}_{V}{\bm{W}}_{O}$:

$$ $\displaystyle V_{\text{III}}=\mathcal{E}^{2}_{\text{SVD}}({\bm{C}}^{\frac{1}{2 }}{\bm{W}}_{V}{\bm{W}}_{O}).$ (30) $$

###### Proof.

$\hat{{\bm{W}}}_{V}\in\mathbb{R}^{d\times k}$ and $\hat{{\bm{W}}}_{O}\in\mathbb{R}^{k\times d}$. Plug in $\hat{f}({\bm{X}})={\bm{X}}\hat{{\bm{W}}}_{V}\hat{{\bm{W}}}_{O}$ into equation 6 and simplify yields the objective

$$ $\displaystyle\min_{\hat{{\bm{W}}}_{V},\hat{{\bm{W}}}_{O}}\sum_{i=1}^{N} \operatorname{Tr}\left({\bm{X}}_{i}^{\top}{\bm{X}}_{i}({{\bm{W}}_{V}}{{\bm{W}} _{O}}-\hat{{\bm{W}}}_{V}\hat{{\bm{W}}}_{O})({{\bm{W}}_{V}}{{\bm{W}}_{O}}-\hat{ {\bm{W}}}_{V}\hat{{\bm{W}}}_{O})^{\top}\right)$ $\displaystyle=\leavevmode\nobreak\$ $\displaystyle\min_{\hat{{\bm{W}}}_{V},\hat{{\bm{W}}}_{O}}\|{\bm{C}}^{\frac{1}{ 2}}{{\bm{W}}_{V}}{{\bm{W}}_{O}}-{\bm{C}}^{\frac{1}{2}}\hat{{\bm{W}}}_{V}\hat{{ \bm{W}}}_{O}\|_{F}^{2}=\mathcal{E}^{2}_{\text{SVD}}({\bm{C}}^{\frac{1}{2}}{\bm {W}}_{V}{\bm{W}}_{O}),$ (31) $$

where ${\bm{C}}=\sum_{i=1}^{N}{\bm{X}}_{i}^{\top}{\bm{X}}_{i}$ is the input correlation matrix.
∎

###### Proposition 3 .

Denote $\sigma_{i}$ as the singular values, Algorithm 3 yields the optimal Type-III modular reconstruction error $V_{\text{III}}=\sum_{i=k+1}^{d}\sigma_{i}^{2}({\bm{C}}^{\frac{1}{2}}{{\bm{W}}_
{V}}{{\bm{W}}_{O}})$.

###### Proof.

As ${\bm{C}}^{\frac{1}{2}}\hat{{\bm{W}}}_{V}\hat{{\bm{W}}}_{O}$ has low rank $k$, this reconstruction error is upper bounded by the residue of the spectrum of the matrix ${\bm{C}}^{\frac{1}{2}}{\bm{W}}_{V}{\bm{W}}_{O}$, i.e.,
$\mathcal{E}_{\text{SVD}}\leq\sqrt{\sum_{i=k+1}^{d}\sigma_{i}^{2}({\bm{C}}^{
\frac{1}{2}}{{\bm{W}}_{V}}{{\bm{W}}_{O}})}$.
In fact, the upper bound is achievable by Algorithm 2 since ${\bm{C}}^{\frac{1}{2}}\hat{{\bm{W}}}_{V}\hat{{\bm{W}}}_{O}={\bm{U}}_{k}\bm{
\Sigma}_{k}{\bm{V}}_{k}^{\top}$, which is the optimal rank $k$ approximation to the matrix ${\bm{C}}^{\frac{1}{2}}{\bm{W}}_{V}{\bm{W}}_{O}$.
∎

###### Theorem 3 ( Value-Output compression can be solved by SVD ) .

###### Proof.

###### Proposition 3 .

###### Proof.

### A.4 Proof of Theorem 4 : Global Sparsity Allocation

###### Theorem 4 .

For sufficient large $\varepsilon$, (11) is the optimal sparsity allocation in the equation 10.

###### Proof.

First we consider the relaxed problem

$$ $\displaystyle\max_{\phi_{1:L}}\sum_{i=1}^{L}s_{i}(1-\phi_{i})+\varepsilon H( \phi_{i})\quad\text{s.t. }\frac{1}{L}\sum_{i=1}^{L}\phi_{i}=\phi_{\text{avg}}.$ (32) $$

The Lagrangian of the problem is

$$ $\displaystyle\mathcal{L}(\phi_{1:L},\lambda)=\sum_{i}s_{i}-\varepsilon\log\phi _{i}-\varepsilon+\lambda\frac{1}{L}.$ (33) $$

Setting this to zero, we can solve for $s_{i}$ as

$$ $\displaystyle\phi_{i}=L\phi_{\text{avg}}\exp(-s_{i}/\varepsilon)/\sum_{j=1}^{L }\exp(-s_{j}/\varepsilon).$ (34) $$

Since $\lim\limits_{\varepsilon\rightarrow\infty}\phi_{i}=\phi_{\text{avg}}\leq 1$, we deduce that $\phi_{i}$ is a valid sparsity when $\varepsilon$ is large enough. As $\phi_{i}$ is the optimal solution to a relaxation of the original problem, it is also optimal for the original problem.
∎

###### Theorem 4 .

###### Proof.

## Appendix B Additional Experiments

### B.1 Modified Algorithms for Grouped Query Attention

Some modern LLMs such as Gemma [], Llama 3 [] utilize a shared key-query strategy to improve inference efficiency.
This design adopts the grouped-query attention (GQA) mechanism [] that couples multiple queries and output matrices with shared keys and values, so compressed key and value matrices also have the constraints of sharing across different heads. Its mechanism is illustrated as follows.

$$ $\displaystyle\text{(GQA)\leavevmode\nobreak\ \leavevmode\nobreak\ }\sum_{i=1}^ {H/G}\sum_{j\in G_{i}}\text{Softmax}(\underbrace{\sigma_{r}({\bm{X}}{\bm{W}}_{ Q}^{j})\sigma_{r}^{\top}({\bm{X}}{\bm{W}}_{K}^{i})}_{\text{{\color[rgb]{ 1,0,0.87}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0.87} \pgfsys@color@cmyk@stroke{0}{1}{0.13}{0}\pgfsys@color@cmyk@fill{0}{1}{0.13}{0} Type-II}}})\underbrace{{\bm{X}}{\bm{W}}_{V}^{i}{{\bm{W}}_{O}^{j}}}_{\text{{ \color[rgb]{0.35,0.87,1}\definecolor[named]{pgfstrokecolor}{rgb}{0.35,0.87,1} \pgfsys@color@cmyk@stroke{0.65}{0.13}{0}{0}\pgfsys@color@cmyk@fill{0.65}{0.13} {0}{0}Type-III}}},$ (35) $$

Figure: Figure 11: Illustration of Type-II and Type-III modifications in GQA. In Type-I, the index selection matrix ${\bm{S}}$ is shared among different key projection matrices in the same group. Similarly, in Type-II, the eigenmatrix ${\bm{U}}$ is shared among different output matrices within the same group.
Refer to caption: x8.png

where $G_{i}$ denotes the set of each group and $G=|G_{i}|$ is each of its size. We see that our compressed ${\bm{W}}_{V}^{i}$, ${\bm{W}}_{K}^{j}$ must be jointly optimized within each group. To address it, we modify Algorithm 2, 3 by using projection strategies.
In line 3 of Algorithm 2 for Type-II module, we calculate the group score equal to the square root of sum of the scores of each head within a group, i.e.,
$s_{i}=\sqrt{\sum_{h\in G}\|{\bm{C}}_{h,Q}^{\frac{1}{2}}[:,i]\|^{2}\|{\bm{C}}_{
h,K}^{\frac{1}{2}}[:,i]\|^{2}}$, where $h$ indicates the head. By doing in this way, we ensure that the column selection matrix for compressions remains equal within the group. For grouped Type-III modification, in line 3 of Algorithm 3, we calculate the SVD of ${\bm{C}}{\bm{W}}_{V}={\bm{U}}\bm{\Sigma}{\bm{V}}^{\top}$ and skip the calculation of ${\bm{W}}_{O}^{\prime}$ and the second SVD and then outputs $\hat{{\bm{W}}}_{V}={\bm{W}}_{V}{\bm{U}}_{k}$, $\hat{{\bm{W}}}_{O,j}={\bm{U}}_{k}^{\top}{\bm{W}}_{O,j},\forall j\in G_{i}$. Since ${\bm{W}}_{V}$ is shared within a group, this ensures that the compressed $\hat{{\bm{W}}}_{V}$ is also shared. In Table 10, we apply this modification to a Llama-3 8B compression.

### B.2 Implementation Details

#### Setup

We utilize the HuggingFace generation library [] to implement our LLM models and adapt the SliceGPT [] GitHub repository for correlation matrix estimations. All experiments for compressions are conducted on a single NVIDIA A100 80GB GPU. The models use the FP16 data format. Unless otherwise specified, the calibration set consists of a random sample of 128 sequences, each of length 2048, from WikiText-2, following the common practice in the literature [, ].

#### Conversion of Layernorm to RMSNorm

We adapt SliceGPT []
official code to implement our compression. As shown in the work, this conversion is an invariant transformation that preserves the model output. SliceGPT uses this transformation and
the orthogonal invariance property of RMSNorm
to slice the weight matrices. On the other hand, MoDeGPT does not reply on the invariance property. We use the transformation simply for easy adaptation from SliceGPT by avoiding building all from the scratch. A side benefit is that our work is compatible with SliceGPT where a slicing and our compression can be applied independently. Although our experiments on OPT and llama do not find clear improvement when incorporating the two (see Table 13), it might be beneficial for some other LLMs.

#### Correlation Matrix Estimations

Our algorithms utilize various input correlation matrices as detailed in Algorithms 1, 2, and 3. Following the approach used in SliceGPT [], we employ the Catcher function to gather empirical data from the calibration set. For matrix decomposition, we upcast correlation matrices from FP16 to FP64 and then downcast the decomposed weights back to FP16. Our process sequentially compresses weights across all layers, mirroring SliceGPT’s method. Additionally, our approach is adaptable to parallel structural models like Phi-2, showcasing flexibility similar to that demonstrated by SliceGPT.

#### Matrix Operations

We utilize torch.svd and torch.pinv in PyTorch for performing Singular Value Decomposition (SVD) and computing the Moore-Penrose inverse on tensors of dtype FP64.

#### MLP Module

Algorithm 1 requires a ridge leverage score parameter $\lambda$. We find that the results are largely insensitive to this parameter; therefore, we simply use $\lambda=1$ across all experiments.

#### Key-Query Module

MoDeGPT reduces the feature dimension in the key-query module.
In our current setup, we store head-dependent index selections, which specify the rows of cosine and sine matrices in the rotary embedding, using only $O(d_{h})$ INT8 numbers, together with the reduced dimension matrices. We’ve observed that this method may slow down generation speed at compression rates below 10%. A feasible modification is zeroing out columns associated with pruned indices; however, this increases the memory footprint because the matrices stored do not undergo dimension reduction. We think there is potential for improvements through enhanced engineering efforts that could better optimize the balance between memory savings and generation speed.

#### Value-Output Module

Lines 3-5 in Algorithm 3 provide a more computationally efficient implementation of the SVD of ${\bm{C}}^{\frac{1}{2}}{\bm{W}}_{V,j}{\bm{W}}_{O,j}$. Since ${\bm{W}}_{V,j}$ and ${\bm{W}}_{O,j}$ are thin matrices, applying SVD directly on their product incurs $O(d_{h}^{3})$ complexity, while applying SVD to them sequentially incurs only $O(d_{h}\times(d_{h}/H)^{2})$ computations.

#### Global Sparsity Allocation

To allocate global sparsity, we first calculate the BI scores with a single forward pass on the calibration set. We then set the sparsity according to a chosen temperature $\varepsilon$, as detailed in Section 3.3.
A high $\varepsilon$ leads to a very uniform allocation, while a low value introduces excessive sparsity in some layers.
Empirically, we find that a simple rule of thumb is to choose a temperature $\varepsilon$ that results in maximal layer sparsity around 80%.

#### Throughput Benchmark

We use the official SliceGPT [] codebase to benchmark the throughput of all methods, with both sequence length and batch size set to 256 and utilizing KVCache.

### B.3 Additional Generation and Zero-Shot Experiments

**Table 6: Perplexities of none gradient-based structured compression methods on WikiText-2.**
| Method | Compression | OPT | Llama-2 | Complexity |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 125M | 1.3B | 2.7B | 6.7B | 7B |  |  |  |
| Dense | 0% | 27.65 | 14.62 | 12.47 | 10.86 | 5.12 | - |
| Sparse GPT 2:4 [] | 50% | 45.07 | 29.61 | 14.90 | 13.00 | 8.69 | $O(d_{\text{hidden}}^{3})$ |
|  | 10% | 767.2 | 894.4 | 1229 | 3464 | 861.76 |  |
| Magnitude | 20% | 4685 | 1278 | 2788 | 16747 | 821.34 | $O(d_{\text{hidden}}^{2})$ |
|  | 30% | 17970 | 3098 | 9255 | 17312 | 9623 |  |
|  | 10% | 36.29 | 68.36 | 20.82 | 357.61 | n/a |  |
| SVD | 20% | 55.48 | 1023.49 | 50.01 | 2387.39 | n/a | $O(d_{\text{hidden}}^{3})$ |
|  | 30% | 173.77 | 8851.45 | 707.17 | 9448.12 | 52719 |  |
|  | 10% | 33.3 | 20.76 | 17.69 | 27.2 | 14259 |  |
| OBD [] | 20% | 94.14 | 1392 | 3236 | 7570 | 15630 | $O(Td_{\text{hidden}}^{3})$ |
|  | 30% | 545.6 | 2147 | 7233 | 7628 | 21386 |  |
|  | 10% | 34.48 | 16.58 | 13.86 | 11.6 | 6.46 |  |
|  | 20% | 42.87 | 19.15 | 15.86 | 12.62 | 7.68 |  |
| SliceGPT [] | 30% | 59.87 | 23.87 | 19.91 | 14.19 | 10.47 | $O(d_{\text{hidden}}^{3})$ |
|  | 40% | 102.41 | 36.2 | 30.77 | 17.99 | 15.19 |  |
|  | 50% | 185.52 | 66.12 | 56.99 | 26.72 | 24.82 |  |
|  | 10% | 28.06 | 15.03 | 12.78 | 11.17 | 5.48 |  |
|  | 20% | 29.62 | 15.98 | 13.56 | 11.79 | 6.16 |  |
| MoDeGPT | 30% | 33.27 | 17.91 | 14.71 | 12.67 | 7.51 | $O(d_{\text{hidden}}^{3})$ |
| (ours) | 40% | 38.37 | 21.92 | 17.43 | 14.79 | 8.41 |  |
|  | 50% | 51.81 | 32.67 | 24.75 | 20.39 | 11.88 |  |

#### Generation Performance

In Table 6, we compare the perplexity of compressed OPT and Llama-2 7B models on WikiText-2 with other baselines that do not use gradient information. The rightmost column indicates their computational complexity per layer. We observe that MoDeGPT performs the best among all structured compression methods, and the 30-40% compressed MoDeGPT models outperform the 2:4 SparseGPT. Notably, our method shows better performance in Llama than in OPT models. We suspect this is due to the higher nonlinearity, such as RoPE and Gated MLP, adopted in Llama, and that our method favors more nonlinear structures. This table also shows that our compression is effective on small language models.

#### Zero-Shot Task Performance

**Table 7: Downstream zero-shot task performance of Llama-2 7B calibrated with 128 samples from WikiText2.**
| Compression | Method | ARC-e | ARC-c | PIQA | WinoGrande | HellaSwag | Average |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 0% | Dense | 74.58% | 46.25% | 79.11% | 69.06% | 75.99% | 69.00% |
| 20% | ShortGPT [] | 58.33% | 38.05% | 72.58% | 65.51% | 65.27% | 59.95% |
| SliceGPT [] | 51.47% | 31.06% | 64.25% | 62.74% | 49.78% | 51.86% |  |
| LLM surgeon [] | 71.36% | 41.89% | 77.09% | 66.30% | 71.30% | 65.59% |  |
| MoDeGPT (ours) | 69.07% | 42.06% | 74.05% | 68.03% | 69.05% | 64.46% |  |
| MoDeGPT-Alpaca (ours) | 71.71% | 41.89% | 76.22% | 68.19% | 69.59% | 65.52% |  |
| 30% | ShortGPT [] | 48.65% | 32.85% | 64.31% | 64.33% | 56.13% | 53.25% |
| SliceGPT [] | 44.44% | 29.27% | 57.56% | 58.48% | 41.08% | 46.17% |  |
| LLM surgeon [] | 63.09% | 36.69% | 73.56% | 61.09% | 60.72% | 59.03% |  |
| MoDeGPT (ours) | 63.26% | 38.73% | 70.40% | 67.32% | 63.26% | 60.78% |  |
| MoDeGPT-Alpaca (ours) | 65.49% | 39.16% | 73.34% | 66.22% | 65.90% | 62.02% |  |
| 40% | ShortGPT [] | 41.16% | 29.94% | 60.12% | 60.46% | 43.67% | 47.07% |
| SliceGPT [] | 36.49% | 24.57% | 54.90% | 53.43% | 34.80% | 40.84% |  |
| LLM surgeon [] | 52.31% | 30.29% | 69.26% | 54.38% | 48.04% | 50.86% |  |
| MoDeGPT (ours) | 49.45% | 30.03% | 64.96% | 61.96% | 53.01% | 51.88% |  |
| MoDeGPT-Alpaca (ours) | 59.76% | 34.73% | 70.35% | 64.40% | 58.63% | 57.58% |  |

**Table 8: Downstream zero-shot task performance of Llama-2 13B calibrated with 128 samples from WikiText2.**
| Method | Compression | ARC-e | ARC-c | PIQA | WinoGrande | HellaSwag | Average |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Dense | 0% | 77.48% | 49.23% | 80.47% | 72.22% | 79.39% | 71.76% |
| SliceGPT [] | 20% | 55.81% | 35.84% | 65.83% | 67.17% | 53.58% | 55.65% |
| 30% | 45.96% | 30.80% | 59.63% | 61.80% | 44.09% | 48.46% |  |
| 40% | 38.59% | 27.05% | 55.98% | 56.51% | 37.15% | 43.06% |  |
| MoDeGPT (ours) | 20% | 74.07% | 46.16% | 74.53% | 70.32% | 68.96% | 66.81% |
| 30% | 71.93% | 43.60% | 73.94% | 71.90% | 68.21% | 65.92% |  |
| 40% | 62.88% | 38.40% | 69.10% | 67.72% | 58.27% | 59.27% |  |

**Table 9: Downstream zero-shot task performance of Llama-2 13B calibrated with 128 samples from Alpaca.**
| Method | Compression | ARC-e | ARC-c | PIQA | WinoGrande | HellaSwag | Average |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Dense | 0% | 77.48% | 49.23% | 80.47% | 72.22% | 79.39% | 71.76% |
| SliceGPT [] | 20% | 69.36% | 40.70% | 74.97% | 65.67% | 61.01% | 62.34% |
| 30% | 60.27% | 36.18% | 69.42% | 64.09% | 49.74% | 55.94% |  |
| 40% | 48.99% | 32.51% | 63.17% | 56.75% | 39.85% | 48.25% |  |
| MoDeGPT (ours) | 20% | 74.24% | 45.90% | 78.24% | 72.53% | 75.78% | 69.34% |
| 30% | 70.24% | 41.47% | 77.15% | 71.27% | 71.84% | 66.39% |  |
| 40% | 63.72% | 38.82% | 71.87% | 66.30% | 62.10% | 60.56% |  |

In Table 7, we report the zero-shot performance of Llama-2 7B, calibrated with WikiText-2 and the Alpaca dataset, across various compression rates. We observe that MoDeGPT outperforms LLM Surgeon as the compression rate increases, and the benefits of using the Alpaca dataset also grow with higher compression rates. Notably, while ShortGPT performs poorly in generation tasks, it significantly outperforms SliceGPT in zero-shot tasks. Both LLM Surgeon and MoDeGPT maintain high performance in generation and zero-shot tasks, but our method requires only 3% of the computational resources compared to LLM Surgeon.

We also test the performance on Llama-2 13B using the WikiText-2 calibration set, as shown in Table 8. Similar to the 7B model, our method excels at higher compression rates (above 20%). However, at a 40% compression rate, we notice a performance drop in the HellaSwag task compared to the 30% compression, likely due to inherent biases in our method. Nevertheless, with calibration from the Alpaca dataset, as shown in Table 9, our method achieves high performance at 20% and 30% compression. Addressing these inherent biases and enhancing performance on the HellaSwag task is a promising area for future research.

**Table 10: Downstream zero-shot task performance of Llama-3 8B calibrated with 128 samples from Alpaca.**
| Method | Compression | Perplexity $\downarrow$ | ARC-e | ARC-c | PIQA | WinoGrande | HellaSwag | Average |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Dense | 0% | 2.98 | 77.69% | 53.58% | 80.63% | 72.69% | 79.16% | 72.75% |
| ShortGPT [] | 25% | 282.56 | 38.13% | 31.40% | 60.94% | 54.22% | 31.52% | 43.24% |
| 30% | 659.33 | 36.83% | 30.72% | 58.98% | 54.62% | 29.08% | 42.04% |  |
| SliceGPT [] | 25% | 3.87 | 58.88% | 33.36% | 68.55% | 58.01% | 49.86% | 53.73% |
| 30% | 4.52 | 52.02% | 29.18% | 64.85% | 54.62% | 41.38% | 48.41% |  |
| MoDeGPT (ours) | 25% | 3.52 | 67.05% | 41.13% | 75.52% | 69.61% | 66.49% | 63.96% |
| 30% | 3.80 | 62.75% | 38.65% | 73.61% | 67.25% | 62.10% | 60.87% |  |

In Table 10, we test our method on Llama-3 8B using our modified algorithm tailored for grouped query attention. As this is a relatively new model, we could only compare results with SliceGPT and ShortGPT, which already support this model. We observe that compression has a more significant impact on performance degradation compared to Llama-2 for all tested methods. We believe this is due to denser information encoding in each parameter, making the model more sensitive to weight changes. However, MoDeGPT maintains approximately 90% performance with 25% compression. Another interesting observation is that the performance order of ShortGPT and SliceGPT is reversed for Llama-3 compared to Llama-2, with ShortGPT’s layer pruning strategy performing much worse. This suggests fundamental differences between the two models and indicates that Llama-3 may require more sophisticated compression techniques.

**Table 11: Generation samples of Llama-2 7B with $30\%$ compression.**
|  | Prompt: The universe is the entirety of space, time, matter, and energy that exists. |
| --- | --- |
| ShortGPT [] | sierpę 2018.<br>The universe is everything that ever did or ever will exist. It includes all the past, all the<br>present, and all the future.<br>What are the 5 most important things you learned about life?<br>How do you<br>describe a person in words?<br>Can you be happy with nothing?<br>Is there a word for everything?<br>What is<br>the meaning of universe?<br>Who is the best person to talk to when you need advice?<br>What is the<br>meaning of the word universe?<br>What is the meaning of universe according to Godungsseite.<br>According to Wikipedia, the universe refers to everything that ever existed, continues existence, or<br>could possibly exist. Thus it includes all the past, all the present, and all the future. |
| SliceGPT [] | The universe contains many galaxies, stars, planets, other objects such as asteroids, planetary systems.<br>It has been estimated to contain 100 billion trillion stars. The Sun is a star in the Milky Way galaxy ,<br>which is one of about 400 billion galaxies in the Milky Way’s vicinity .<br>The Milky Way itself is part<br>of the Milk Way Group , which includes several smaller groups of galaxies . |
| MoDeGPT (ours) | The universe is a vast, dynamic, and complex structure that contains many different types of objects,<br>including stars, galaxies, planets, asteroids, and intergalactic gas clouds. It is also home to life-forms<br>such as humans, animals, plants, microorganisms, and microscopic organisms.<br>The universe has been<br>studied by astronomers for centuries, and its size and complexity have been estimated using various<br>methods.<br>Astronomical observations have revealed that the universe is much larger than previously<br>thought, with an estimated diameter of approximately 10 billion light years. This means that the<br>universe is roughly 33 times larger than our solar system.<br>The universe is composed of two main<br>components: the cosmos and the cosmic void. The cosmos consists of galaxies, which are large<br>collections of stars and other objects bound together by gravitational forces. The cosmic void, on the<br>other hand, is a region of space between galaxies that is largely empty of matter. |

Finally, we compare the generation quality using samples from the three methods’ generations for 30% compressed Llama-2 7B, as shown in Table 11. ShortGPT produces the lowest quality generation, while both SliceGPT and MoDeGPT generate high-quality responses, with MoDeGPT providing more detailed responses than SliceGPT.

### B.4 Recovery Fine-tuning

**Table 12: Compression and recovery fine-tuning for llama-2 7B using Alpaca dataset**
| Method | Compress. | ARC-e | ARC-c | PIQA | WinoGrande | HellaSwag | Average |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Dense | 0% | 74.58% | 46.25% | 79.11% | 69.06% | 75.99% | 69.00% |
| MoDeGPT<br>RCT-MLP | 20% | 69.78 % ( $\downarrow$ 1.93%) | 44.20% ( $\uparrow$ 2.31%) | 76.99% ( $\uparrow$ 0.77%) | 66.61% ( $\downarrow$ 1.58%) | 69.23% ( $\downarrow$ 0.36%) | 65.36% ( $\downarrow$ 0.16%) |
| 30% | 64.94% ( $\downarrow$ 0.55%) | 42.15% ( $\uparrow$ 2.99%) | 73.83% ( $\uparrow$ 0.49%) | 66.54% ( $\uparrow$ 0.32%) | 67.08% ( $\uparrow$ 1.18%) | 62.91% ( $\uparrow$ 0.89%) |  |
| 40% | 59.26% ( $\downarrow$ 0.50%) | 37.12% ( $\uparrow$ 2.39%) | 72.09% ( $\uparrow$ 1.74%) | 64.33% ( $\downarrow$ 0.07%) | 60.82% ( $\uparrow$ 2.19%) | 58.72% ( $\uparrow$ 1.14%) |  |
| MoDeGPT<br>RCT-ALL | 20% | 70.45% ( $\downarrow$ 1.26%) | 42.92% ( $\uparrow$ 1.03%) | 77.20% ( $\uparrow$ 0.98%) | 66.30% ( $\downarrow$ 1.89%) | 68.07% ( $\downarrow$ 1.52%) | 64.99% ( $\downarrow$ 0.53%) |
| 30% | 63.38% ( $\downarrow$ 2.11%) | 41.47% ( $\uparrow$ 2.31%) | 74.81% ( $\uparrow$ 1.47%) | 66.06% ( $\downarrow$ 0.16%) | 65.64% ( $\downarrow$ 0.58%) | 62.27% ( $\uparrow$ 0.25%) |  |
| 40% | 58.42% ( $\downarrow$ 1.34%) | 38.23% ( $\uparrow$ 3.50%) | 72.03% ( $\uparrow$ 1.68%) | 63.61% ( $\downarrow$ 0.79%) | 59.55% ( $\uparrow$ 0.92%) | 58.34% ( $\uparrow$ 0.76%) |  |

While MoDeGPT does not require recovery fine-tuning, in this section, we explore how RFT can further enhance performance.
In Table 12, we present recovery fine-tuning results for our method on Llama-2 7B, following the same tuning setting as SliceGPT []. We use a calibration set of 128 random samples, each 2048 in length, from the Alpaca dataset, and a recovery fine-tuning set of 8000 samples, each 1024 in length, employing LoRA []. We use SliceGPT’s hyperparameters for LoRA, except for the learning rate, which is set to $5\times 10^{-5}$. The other primary hyperparameters used are $lora_alpha=10$, $lora_r=32$, $lora_dropout=0.05$, and $batch_size=3$. We evaluate two scenarios: 1) fine-tuning all linear matrices, and 2) tuning only the MLP.

The green and red indicators in the table denote performance increases or decreases relative to the compressed model before fine-tuning. Notably, tuning exclusively within the MLP consistently yields better performance than tuning all parameters. Since we followed the same tuning setting as SliceGPT [] for a fair comparison, it is likely that better configurations exist for our method, potentially enhancing performance further. Another key observation is that despite fine-tuning using 40 times more data than calibration and employing backpropagation, MoDeGPT without RFT achieves very similar performance. The percentage difference is minimal, suggesting that using local reconstruction error as the objective is an effective and efficient method with our compression technique.

The table demonstrates that fine-tuning can slightly improve performance for higher compression rates, with the most significant increase observed in the ARC-c task. Evaluating the full benefits of fine-tuning remains a subject for future research.

### B.5 Combination of MoDeGPT and SliceGPT

**Table 13: Perplexity performance of SliceGPT + MoDeGPT on llama-2 7B**
| Slice-MLP-MHA<br>(%-%-%) | Compression<br>Rate | WikiText2<br>Perplexity $\downarrow$ | MLP Sparsity<br>Allocation | MHA Sparsity<br>Allocation |
| --- | --- | --- | --- | --- |
| Dense | 0% | 5.12 | - | - |
| 20-20-0 | 19.65% | 7.38 | ✓ | ✗ |
| 20-20-0 | 19.65% | 7.33 | ✗ | ✗ |
| 25-25-0 | 27.38% | 8.42 | ✓ | ✗ |
| 30-30-0 | 34.93% | 9.99 | ✓ | ✗ |
| 20-25-0 | 22.25% | 7.70 | ✗ | ✗ |
| 15-30-0 | 11.77% | 7.27 | ✗ | ✗ |
| 10-30-0 | 9.03% | 6.83 | ✗ | ✗ |
| 10-25-25 | 28.00% | 7.31 | ✗ | ✗ |
| 10-30-25 | 30.91% | 7.78 | ✗ | ✗ |
| 20-20-20 | 29.18% | 8.00 | ✗ | ✗ |

MoDeGPT is orthogonal to SliceGPT as it reduces dimensions from different sides of a weight matrix. Figures 1 (c) and (d) provide an illustrative comparison. Combining SliceGPT with MoDeGPT seems to be a natural extension. To demonstrate their compatibility, we experimented with various configurations as shown in Table 13. The numbers $x$-$y$-$z$ in the leftmost column indicate $x$% slicing rate of SliceGPT, and $y$% and $z$% compression rates of MoDeGPT in MLP and MHA modules, respectively. The two rightmost columns test the use of sparsity allocation in the MLP and/or MHA modules.

Notably, our tests show that applying sparsity allocation with SliceGPT barely improves performance, consistent with the findings in the SliceGPT paper []. Therefore, we do not use sparsity allocation for slicing. Compared to the results in Table 2, the combination of SliceGPT and MoDeGPT does not improve perplexity over pure MoDeGPT. We attribute this to two points: 1. the significant overhead induced by slicing: to achieve a target compression rate, the model must slice at a higher rate.
2. the slicing and compression ratio might not be optimal, and it might changes from layer to layer.

Although we did not make exhaustive search, we believe there is an efficient sparsity allocation for slicing, and better tuning of the slicing and compression ratios could enhance the performance of the combined method. We leave this as a topic for future research.

### B.6 Compression Time and Memory Consumption

**Table 14: Compression computations for calibration set of size 128 in WikiText2.**
| Model | MoDeGPT | SliceGPT [] | LLM surgeon [] |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Time | GPUs | Time | GPUs | Time | GPUs |  |
| Llama-2 7B | 4h09m | 1xA100 80GB | 0h26m | 1xA100 80GB | 17h08m | 4xH100 80GB |
| Llama-2 13B | 8h26m | 1xA100 80GB | 0h45m | 1xA100 80GB | 1d9h26m | 8xH100 80GB |

**Table 15: Memory consumption and compute time of 30% compression for blocks in transformer layers tested on a single A100 80GB GPU.**
| Block | LLAMA-7B (13.81 GiB) | LLAMA-13B (25.92 GiB) |  |  |
| --- | --- | --- | --- | --- |
| Peak Memory (GiB) | GPU hours | Peak Memory (GiB) | GPU hours |  |
| MHA | 15.54 (+11.5%) | 2h52m | 28.60 (+9.4%) | 5h04m |
| MLP | 23.33 (+68.9%) | 1h13m | 41.40 (+54.1%) | 3h22m |

In Table 14, we compare the compression times of MoDeGPT, SliceGPT, and LLM Surgeon. Since MoDeGPT and SliceGPT do not leverage gradients, they can compress a model of size 13B using a single GPU. From previous tables, we observe that while our compute time is longer than SliceGPT, MoDeGPT achieves significantly better performance. Conversely, our computation time is considerably shorter than LLM Surgeon, yet we achieve comparable performance. Even when equating 1 H100 to 1 A100, our method can save up to 97% of computations.
In Table 15, we report the peak GPU memory usage when compressing LLAMA-2 7B and 13B models on a single A100 GPU. The primary source of additional memory overhead, beyond the model itself, is the storage of intermediate activations required for correlation estimation in the MLP. The table shows that this overhead ranges from approximately 50% to 70%. However, for the 13B model, the peak memory usage remains under 50% of the total GPU memory capacity.

### B.7 Global Sparsity Allocation

In Table 16, we report the perplexity and zero-shot performance as we vary the temperature parameter in the global sparsity allocation. Initially, the uniform strategy, corresponding to an infinite temperature, performs significantly worse than our sparsity allocation strategy.

**Table 16: Downstream zero-shot task performance of $30\%$ MoDeGPT on Llama-2 7B for varying global rank temperature.**
| Method | $\varepsilon$ | Perplexity $\downarrow$ | ARC-e | ARC-c | PIQA | WinoGrande | HellaSwag | Average |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Dense | - | 5.12 | 74.58% | 46.25% | 79.11% | 69.06% | 75.99% | 69.00% |
| MoDeGPT (ours) | 0.075 | 7.44 | 59.72% | 37.29% | 68.50% | 65.90% | 61.55% | 58.59% |
| 0.1 | 7.46 | 63.43% | 39.42% | 70.78% | 65.59% | 63.24% | 60.49% |  |
| 0.5 | 7.03 | 56.14% | 32.34% | 67.68% | 64.88% | 58.01% | 55.81% |  |
| 1 | 7.25 | 53.20% | 31.06% | 66.16% | 64.17% | 56.66% | 54.25% |  |
| 2 | 7.35 | 53.62% | 31.06% | 65.83% | 63.14% | 55.98% | 53.93% |  |
| $\infty$ | 9.06 | 52.36% | 30.80% | 65.18% | 63.69% | 55.31% | 53.47% |  |

Figure: Figure 12: Dynamic sparsity allocation across layers for Llama-2 7B.
Refer to caption: x9.png

For $\varepsilon=0.075$, this results in extreme sparsity, as shown in Figure 12, and performance begins to drop. For $\varepsilon\geq 1$, the allocation becomes too similar to the uniform strategy. In practice, we find that the $\varepsilon$ value that yields a minimum layer allocation around 20% performs exceptionally well. In Figure 12, left and middle panels, we also observe how the allocation shape for different $\varepsilon$ values corresponds to the importance score in the left figure. For LLMs, both OPT and Llama show that the first and last few layers have significantly higher importance and, therefore, should allocate less sparsity, as depicted in the figure.
On the right of Figure 12, we also show the allocation for different compression levels. The shape remains similar across different levels using the same $\varepsilon$. For higher compression rates, the maximum layer sparsity also increases, suggesting that we should increase $\varepsilon$ to avoid extreme sparsity.

### B.8 Ablation Study on Compression in Each Module

#### Impact of Module-Wise Compression on Perplexity.

**Table 17: Perplexity of compressed LLAMA-2 7B in each module.**
| Module<br>Compression Rate | 0% | 10% | 20% | 30% | 40% | 50% | Normalized Slope |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Type I: MLP | 5.12 | 5.34 | 5.68 | 6.71 | 7.12 | 8.24 | 0.094 |
| Type II: Query, Key | 5.12 | 5.14 | 5.23 | 5.43 | 5.58 | 6.33 | 0.121 |
| Type III: Value, Output | 5.12 | 5.16 | 5.24 | 5.37 | 5.62 | 5.92 | 0.095 |

Table 17 presents the perplexity changes in the LLAMA-2 7B model when compressing each module individually. The rightmost column shows the normalized slope of perplexity change relative to the parameter size in each module. The results reveal that the MLP module has the most significant impact on overall performance, likely due to its containing 66% of the model’s parameters. On the other hand, the slope indicates that the compression algorithms for Type I and Type III modules perform comparably, while Type II performs the worst. This finding aligns with our theoretical results, which suggest that the reconstruction bounds are weakest in Type III. From a decomposition perspective, the CR approximation is the most coarse-grained, leading to the least effective compression outcomes.

#### Impact of Module-Wise Compression on Throughput.

Figure: Figure 13: Module-Wise Throughputs of 30% Compressed LLAMA-2 7B

Table 13 presents the throughputs for the 30% compressed LLAMA-2 7B across different modules. The results indicate that the compression yields similar speedups for both Type-II and Type-III modules. This sharp difference in speedups highlights the potential for uniform compression across modules, which we leave as a direction for future research.

### B.9 Scalability to Larger Models

While our work is tested on a single GPU, it can be extended to multi-GPU setups to compress larger models, such as those with 70B parameters. To apply our method to larger models, the model must fit within the GPU memory to perform the forward pass. As shown in Table 15
, memory utilization is less than twice the model size, so approximately double the model’s size in GPU memory is expected for running our method. In our compression process, the most computationally intensive part is the compression of the value-output module, as highlighted in Table 7. Since the computational complexity of this module scales cubically with the hidden dimension (due to the SVD in the value-output compression) and is proportional to the number of layers being compressed, the time required to compress a 70B model using multi-GPUs can be estimated using the following formula:

$$ Compute Time (70B) $\displaystyle=\leavevmode\nobreak\$ $\displaystyle\text{Compute Time (7B)}\times\left(\frac{\text{hidden dim(70B)}} {\text{hidden dim(7B)}}\right)^{3}\times\frac{\text{layer num(70B)}}{\text{ layer num(7B)}}$ $\displaystyle=\leavevmode\nobreak\$ $\displaystyle\text{4 hours}\times(8192/4096)^{3}\times(80/32)\leavevmode \nobreak\ =\text{80 hours}$ $$

For a sanity check, we applied the same formula to estimate the compression time for a 13B model and obtained an estimate of 9 hours, which aligns closely with our empirical result of 8 hours and 26 minutes, as shown in Table 7.

### B.10 High Compression Rate Experiments

**Table 18: Perplexity of LLAMA-2 7B Across 10% to 80% Compressions**
| Compression Rate | 0% | 10% | 20% | 30% | 40% | 50% | 60% | 70% | 80% |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Perplexity | 5.12 | 5.48 | 6.16 | 7.51 | 8.41 | 11.88 | 26.59 | 84.22 | 245.84 |
|  |  |  |  |  |  |  |  |  |  |

We analyzed the perplexity of LLAMA-2 7B at high compression rates, using 128 samples from WikiText2 for calibration. We observed a significant breakdown point at 50% compression, where the perplexity increased sharply from 41% to 123%. This indicates the compression limit of our method.

### B.11 Sensitivity Analysis of Dfferent Calibration Sets

**Table 19: Perplexity results under different calibration datasets.**
| Calibration Set<br>Test Set | WikiText2 $\downarrow$ | PTB $\downarrow$ | Alpaca $\downarrow$ |
| --- | --- | --- | --- |
| WikiText2 | 6.16 | 27.69 (+22%) | 3.12 (+11%) |
| PTB | 6.99 (+13%) | 22.75 | 3.14 (+12%) |
| Alpaca | 7.64 (+24%) | 40.71 (+79%) | 2.80 |
|  |  |  |  |

In Table 19, we evaluate in-domain and out-of-domain perplexity using different calibration sets: WikiText2, PTB [], and Alpaca. Our results indicate that perplexity is minimized when the model is calibrated with the same dataset as the test set. Notably, when calibrated with different datasets, the results on Alpaca demonstrate the most consistent performance with the least variance, while PTB shows the highest variance. Nevertheless, calibration with PTB provides the most robust results across all three datasets.

### B.12 Additional Speedup Experiments

**Table 20: Inference speed and computational complexity of the pruned Llama-2 7B model.**
| Method | # Parameter<br>(B) | Memory<br>(GiB) | Compute Complexity<br>(GMACs) $\downarrow$ | Latency CPU<br>(s/token) $\downarrow$ | Latency GPU<br>(s/token)<br>$\downarrow$ | 256-Batch Throughputs<br>(tokens/s) $\uparrow$ |
| --- | --- | --- | --- | --- | --- | --- |
| Dense | 6.74 | 12.92 | 425.12 (1.00$\times$) | 32.41 (1.00$\times$) | 0.035 (1.00$\times$) | 1700 (1.00$\times$) |
| 20% SliceGPT | 5.45 | 10.45 | 339.04 (0.80$\times$) | 26.46 (0.82$\times$) | 0.037 (1.06$\times$) | 1802 (1.06$\times$) |
| 20% MoDeGPT | 5.44 | 10.43 | 339.34 (0.80$\times$) | 22.66 (0.70$\times$) | 0.034 (0.97$\times$) | 2168 (1.28$\times$) |
| 30% SliceGPT | 4.73 | 9.07 | 298.36 (0.70$\times$) | 25.28 (0.78$\times$) | 0.037 (1.06$\times$) | 1830 (1.08$\times$) |
| 30% MoDeGPT | 4.79 | 9.07 | 297.91 (0.70$\times$) | 19.20 (0.59$\times$) | 0.034 (0.97$\times$) | 2521 (1.48$\times$) |
| 40% SliceGPT | 4.11 | 7.88 | 262.12 (0.62$\times$) | 22.68 (0.70$\times$) | 0.037 (1.06$\times$) | 1839 (1.08$\times$) |
| 40% MoDeGPT | 4.14 | 7.94 | 256.34 (0.60$\times$) | 18.57 (0.57$\times$) | 0.036 (1.03$\times$) | 2568 (1.51$\times$) |

Figure: Figure 14: Throughput benchmarks of compressed Llama-2 7B on a single A100 80GB GPU.
Refer to caption: x10.png

Table 20
reports the throughputs and latency on fast and slow parallel computing environments using NVIDIA A100 and Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50 GHz with 20 cores. The results indicate that the reduction in computational complexity is proportional to the compression percentage. While the speedup for single-batch inference is comparable to that of the original model, we observe significant improvements in speedup for multi-batch inference on the GPU and on the CPU. Therefore, our method performs optimally when the parallel computing capabilities of the environment are fully utilized.

In Figure 14, we explored various batch sizes, comparing the throughput of 30% compressed MoDeGPT with 30% sliced SliceGPT [] and the dense model. We found that throughput surpassed that of the dense model for batch sizes over 64. Particularly, at batch sizes exceeding 256, MoDeGPT’s throughput was 1.46 times greater than the dense model, while SliceGPT only achieved 1.07 times the throughput. MoDeGPT’s increased throughput stems from its reduced matrix size and avoidance of extra adapters in residual paths.

## Appendix C Limitations and Broader Impacts

#### Intrinsic Bias

Our experiments on zero-shot tasks show that MoDeGPT excels in certain zero-shot tasks while underperforming in others, indicating an intrinsic bias toward specific tasks. Our current method does not offer a definitive solution to eliminate this bias. Addressing bias removal will be a critical area for future research.

#### Overfitting the Reconstruction Loss

While MoDeGPT excels in zero-shot tasks by minimizing local reconstruction error, we noted instances where compressed models, despite achieving lower perplexity, underperformed in zero-shot tasks. This discrepancy may stem from the models overfitting local reconstructions to calibration data. Addressing this overfitting remains a challenge for our method.

#### Broader Impacts

The introduction of Modular Decomposition (MoDeGPT) significantly impacts the ethical deployment and broader adoption of Large Language Models (LLMs). By minimizing computational demands, MoDeGPT enables effective deployment on resource-constrained devices, democratizing access to cutting-edge AI and potentially reducing the technological divide between large and small entities.

Additionally, MoDeGPT ’s efficiency in using computational resources can decrease energy consumption during AI training and inference, promoting sustainable AI practices and reducing the environmental impact of large-scale computations. However, the potential for increased misuse of AI technologies, such as surveillance and disinformation, highlights the need for robust governance and ethical frameworks.

Ultimately, by maintaining high accuracy while reducing model size, MoDeGPT ensures the reliability of AI applications in critical domains such as healthcare. The development of MoDeGPT thus promises greater AI accessibility and sustainability, but it also introduces new challenges in governance and ethical technology use.

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: 1. Why does Table 3 include only 50% compression results for models like SparseGPT but lack results for 40% compression? Why is a 40% compression result of MoDeGPT compared to a 50% compression result of SparseGPT?
2. I am curious why magnitude-based and SVD-based compression methods seem to cause model collapse in Table 1, performing worse than random compression (Uniform).
3. The authors applied different compression rates to different layers, but are the compression rates for the three types of computations identical? Based on the analysis in Figure 4, it might be better to allocate a higher compression rate for Attention computations.
4. Why is MoDeGPT more efficient than the baseline at the same compression rate (Figure 3)?
soundness: 3
strengths: 1. The authors propose the interesting idea of using three different matrix decomposition algorithms to compress computations in both MLP and Attention.
2. Experimental results demonstrate that the proposed method offers advantages in terms of both performance and efficiency compared to prior pruning and matrix decomposition algorithms.
3. The Appendix includes additional methods and experiments related to group-query attention.
summary: This paper proposes a novel model compression method by applying three different matrix decomposition algorithms to three distinct types of computations within Transformers. Compared to previous model compression algorithms, this approach achieves a significant improvement in performance.
weaknesses: 1. The authors suggest using three different types of matrix decompositions for three different types of computations within Transformers, but they do not provide motivation for this choice. For example, why is CR decomposition more suitable for Type-2 computation?

---

confidence: 2
contribution: 3
initial_rating: 8
presentation: 3
questions: 1. In Table 3, is the main claim that although semi-structured methods may outperform MoDeGPT, they are held back by custom GPU support which hinders research velocity?
2. It would be nice to see a throughput versus perplexity graph as well, as opposed to just sparsity vs ppl/throughput, e.g. merge tables 2 and 3.
soundness: 3
strengths: To the best of my knowledge, the method of structured approximations across multiple matrices is novel and the results are strong. For the most part, the paper is well-written.
summary: This paper proposes MoDeGPT, which compresses transformers by applying structure decompositions on operations that span *two* weight matrices. The parameter subgroups targeted are the MLP weights, key and query projections, and value and attention output projections. Experimental results show that MoDeGPT is the best no-gradient structured method, and also comparable to the best structured and gradient-based method.
weaknesses: One weakness is the lack of justification for the approximation methods for each weight group. Could you give more intuition behind why each method was chosen? For example, the sentence "Since $W_U$ is inside a nonlinear function $\sigma_s$, we constrain the search space for its approximation to a matrix multiplication $W_U S_k$ for tractability, where $S_k$ is the $k$-column selection matrix" (line 244) only describes the approximation, whereas a justification would explain why Nystrom is a better fit for this problem than other methods.

Another weakness is the relative lack of analysis on the global sparsity allocation. However, this is orthogonal to the main contribution of structured multi-weight approximations.

---

confidence: 4
contribution: 2
initial_rating: 8
presentation: 3
questions: 1. Can MoDeGPT outperform "efficient" competitors, such as SliceGPT [2], SLEB, if the competitors perform fine-tuning on the sample dataset to have the same pruning cost as MoDeGPT?

2. Could you elaborate on the detailed explanation of the proof for Theorem 4? Is it permissible to assume that epsilon is large enough to simplify the problem?

3. Does the proposed Global Sparsity Allocation outperform OWL [3]'s strategy?

4.  Does MoDeGPT outperform competitors when pruning gigantic models, e.g., Llama-3 70B?

5. What are the characteristics of Nystrom approximation, CR decomposition, and SVD, and why do we have to use them as proposed in this paper?

### References

[1] Song, Jiwon, et al. "SLEB: Streamlining LLMs through Redundancy Verification and Elimination of Transformer Blocks." arXiv preprint arXiv:2402.09025 (2024).

[2] Ashkboos, Saleh, et al. "Slicegpt: Compress large language models by deleting rows and columns." arXiv preprint arXiv:2401.15024 (2024).

[3] Yin, Lu, et al. "Outlier weighed layerwise sparsity (owl): A missing secret sauce for pruning llms to high sparsity." arXiv preprint arXiv:2310.05175 (2023).
soundness: 2
strengths: This paper has diverse strengths and I summarize them as follows:

### Method
1. The authors introduce Nystrom approximation, CR decomposition, and SVD to pruning row-column pairs in LLMs. To the best of my knowledge, this is the first work to use Nystrom approximation and CR decomposition to prune LLMs. The authors carefully use them to prune different types of modules.

2. The authors propose a novel global sparsity allocation algorithm with entropic regularization. If this algorithm contributes a lot to improving the accuracy of the pruned models, then this algorithm can be broadly used in pruning.

### Experiments
3. The authors conduct exhaustive experiments to show the superiority of MoDeGPT. Their experiments not only covers accuracies, but also inference speed and pruning cost.

4. The authors analyze the effect of MoDeGPT in a detailed way. They also analyze the sparsity patterns.

### Writing

5. The contents are well-organized and easy to read. Specifically, the authors assign unique colors for each module type and consistently use them. This was very helpful to understand this paper.
summary: This paper proposes MoDeGPT, an accurate structured pruning algorithm for LLMs. 
The main idea of MoDeGPT is to define "modules", a novel pruning structure, and apply tailored decomposition algorithms for three different types of modules.
The main strengths of this paper are (1) introducing decomposition algorithms that are not previously used in this domain, (2) proposing a new global sparsity allocation algorithm, and (3) exhaustive experiments and theoretical analysis in Appendix.
However, I have concerns regarding the following: (1) overclaiming regarding the efficiency of MoDeGPT,  (2) lack of experiments regarding large models, e.g., Llama 3 70B, and (3) too simplified proof of Theorem 4.
Therefore, I summarized my concerns in "Weaknesses" and "Questions" and I need to discuss them with the authors.
The score can be increased according to the author's response.
weaknesses: ### Method

1. In the caption of Figure 1, the authors insist that their new pruning structure avoids the need for extra adapters. However, SliceGPT's adapters are introduced to improve accuracy and can be removed for inferencing without (dimensional) errors. Therefore, that statement should be modified.

2. The main contribution of this paper is introducing diverse decomposition algorithms and applying them to the proper modules. However, there are lack of explanations of the characteristics of these decomposition algorithms and justification for using them for each type of module.

3. The proof of Theorem 4 is too simplified and hard to understand. There are lack of explanations to get Equation 33. The authors impose a strong assumption that epsilon becomes infinity which indicates the uniformness of phis.

### Experiment

4. The authors emphasize that MoDeGPT is an efficient pruning algorithm, for example, in Lines 475-477, but MoDeGPT requires expensive pruning costs more than 8 hours for pruning Llama-2 13B models. According to SELB [1], most of pruning algorithms requires less than 16 minutes for pruning Llama-2 13B models. Therefore, it is an overclaiming to insist that MoDeGPT is an efficient algorithm. 

5. There are lack of competitors. The authors should compare their results with state-of-the-art pruning algorithms, especially layer (or block) pruning algorithms, such as SLEB [1]. Layer pruning algorithms provide significant inference speedup and should be included in Figure 3.

### Writing

6. The second paragraph of the Introduction is too detailed and hard to find the main point. It is hard to capture "these challenges" in the third paragraph after reading.

7. The criteria of Table 1 are ambiguous. (1) "No backward propagation" seems like an indirect criteria of pruning efficiency, but MoDeGPT is slow without requiring backpropagation. (2) What is the threshold of maintaining accuracy? (3) SparseGPT supports 2:4 pruning which is treated as a (semi-)structured pruning algorithm.

---

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: The specific questions and suggestions are listed below:

(1)Do you consider evaluating on more diverse tasks to verify the method's generalizability?

(2)In the specific experiments, could you provide the chosen rank size for the matrix decomposition or an analysis of the related experiments?
soundness: 3
strengths: The paper has the following strengths：

(1) The paper presents a novel training-free compression method called MoDeGPT, applies matrix decomposition at the module level for the first time, and extends the theoretical foundation for weight decomposition in language models.

(2) The paper offers a comprehensive literature review and theoretical analysis, demonstrates significant performance improvements through experimental results, and provides error guarantees along with a theoretical framework.

(3) The method outperforms previous approaches in compression performance, achieves a 46% increase in inference throughput, and enhances the practical value of large language models.
summary: This paper introduces MoDeGPT, a novel training-free compression method for large language models.  It presents a systematic framework for categorizing approximation challenges in Transformer compression, complete with error guarantees. MoDeGPT demonstrates significant performance gains. This method outperforms prior approaches in compression, and achieves a 46% increase in inference throughput.
weaknesses: The Weaknesses of the paper are listed as follows：
(1) MoDeGPT shows intrinsic bias, performing well on some zero-shot tasks but poorly on others, and currently lacks a solution for bias removal.
(2) Overfitting of the model to calibration data prevents the compression method from generalizing across most tasks.

Meta-review: This paper proposes a new approach to compressing Transformer-based models. The idea is to use a set of particular forms of low-rank matrix factorization for the weight matrices. The authors’ strategy is fairly sophisticated, as it seeks to associate various component operations inside a Transformer with different matrix approximation approaches. 

There’s a bunch of strengths here: the overall approach is creative, the empirical results are pretty strong. The authors have provided extensive details on the approach. 

This is a good paper that is worth accepting.

Decision: Accept (Oral)