# SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression

SLiM: LLM 가중치 압축을 위한 저랭크 근사를 활용한 원샷 양자화 및 희소화

Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · arXiv · 2024년 10월 12일

- **연구 문제** 대규모 언어 모델의 압축에서 재학습 없이 양자화와 희소성을 함께 적용하면 정확도 손실이 커지는 문제를 다룹니다.
- **연구 방법** SLIM-Quant로 스케일을 찾고 Wanda로 희소성을 도입한 뒤 saliency 기반 저랭크 adapter로 압축 오차를 보정합니다.
- **주요 결과** 2:4 희소성과 4-bit 양자화에서 LLaMA-2-7B 정확도가 최대 5.66% 향상되고, 일부 설정에서 SLIM-LoRA가 Naive-LoRA보다 높은 평균 정확도를 보입니다.

## 연구 문제와 기존 방식의 한계

대규모 언어 모델(LLM)은 파라미터 수가 많아 메모리 사용량과 추론 비용이 큽니다. 기존 압축 기법인 가지치기와 양자화는 정확도를 회복하기 위해 대규모 데이터로 재학습을 요구하는 경우가 많아 실제 적용에 부담이 됩니다. 반면 재학습 없이 적용하는 one-shot 압축은 조밀(dense) 모델의 정확도에 미치지 못하는 경우가 많습니다. 특히 2:4 희소성처럼 하드웨어 가속에 유리한 반구조적 희소성은 SparseGPT와 Wanda 같은 방법에서 잘 다루지 못하는 패턴입니다. 저자들은 양자화와 희소성을 함께 적용하면 오차가 누적되어 정확도 격차가 커진다고 지적합니다. 이 논문은 이러한 문제를 해결하기 위해 양자화, 희소성, 저랭크 근사를 하나의 one-shot 과정으로 통합한 SLIM을 제안합니다.

## SLIM의 세 단계 파이프라인

SLIM은 가중치 W에 대해 세 단계를 순서대로 적용합니다. 첫 단계인 SLIM-Quant는 대칭 양자화의 스케일 인자 α를 찾기 위해 양자화 오차와 클리핑 오차를 가중치 분포에 대해 적분한 목적함수를 사용합니다. 원문은 이 목적함수를 비볼록 문제로 보고, 가중치 히스토그램에 대한 수치 적분과 다단계 격자 탐색으로 최적 α를 찾는다고 설명합니다. 둘째 단계에서는 양자화된 가중치 W^Q에 Wanda를 적용해 희소성을 도입하고 압축 가중치 W^C를 얻습니다. 셋째 단계에서는 압축 오차 E\_C = W^C − W를 saliency 함수 F로 변환한 뒤 SVD로 저랭크 근사를 구합니다. 원문은 F(W) = diag(x)W로 정의하며, x는 calibration 입력의 평균 절댓값에서 얻은 값입니다.

이 함수는 가역적이고 가법적이어서, 변환된 공간에서 얻은 저랭크 인수를 다시 역변환하여 L과 R을 구할 수 있습니다.

## 정확도와 속도 측정의 비교 조건

정확도 검증은 OPT와 LLaMA-2 모델 계열에서 2:4 희소성과 50% unstructured 희소성, 4-bit 가중치 양자화 조건으로 수행됩니다. 평가 과제는 MMLU, Piqa, Arc-Easy, Arc-Challenge, WinoGrande, OpenBookQA의 zero-shot 정확도이며, 비교 기준에는 Wanda, SparseGPT, Magnitude Pruning, JSQ, L2QER 등이 포함됩니다. 속도 향상은 NVIDIA RTX 3060에서 측정하고, A100 결과는 부록 J에 제시됩니다. 메모리 감소는 A100 GPU에서 측정한다고 원문이 서술합니다. 같은 모델 계열이라도 정확도 측정과 속도 측정에 쓴 조건은 서로 구분해서 읽어야 합니다.

![Figure 4: SLIM speedup for LLaMA-2 family of models on NVIDIA A100-40GB GPUs. The brighter color shows the contribution of quantization to the total speedup](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd/figures/figure-f894f42aa7169090fdb3bdd8c25eb64d.png?thumb=512)

**Figure 4** . SLIM speedup for LLaMA-2 family of models on NVIDIA A100-40GB GPUs. The brighter color shows the contribution of quantization to the total speedup.

[원문](https://arxiv.org/abs/2410.09615v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression · 원문 그림 인용 · 원본 PDF 20쪽에서 그림 영역을 추출했습니다.

## 주요 결과와 절제 비교

원문은 2:4 희소성과 4-bit 가중치 양자화에서 LLaMA-2-7B의 평균 정확도가 최대 5.66% 향상된다고 보고합니다. Table 1에서 Naive-LoRA와 SLIM-LoRA는 같은 SLIM-Quant\_W 양자화 설정을 공유하므로, SLIM-LoRA로 바꿨을 때의 추가 향상은 saliency 기반 adapter 설계의 효과로 읽을 수 있습니다. 같은 설정에서 SLIM-LoRA를 양자화한 SLIM-LoRAQ는 정확도를 거의 유지하면서 adapter 오버헤드를 줄입니다. 한편 원문은 SLIM-Quant 단독은 높은 정확도를 목표로 설계되지 않았다고 서술하며, 이 결과는 저랭크 adapter와 결합했을 때의 성능과 구분됩니다.

또한 약 8배 크기 축소 조건에서는 2-bit 단독 양자화보다 4-bit 양자화와 희소성을 결합한 설정이 더 나은 결과를 보인다고 보고합니다.

![Table 1: Average zero-shot accuracy of LLaMA-2 and OPT models with 50% sparsity and 4-bit weight quantization . Best Method∗ indicates the best quantization me…](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd/figures/figure-3d265a8899a91f2ccd8cae4723f51758.png?thumb=512)

**Table 1** . Average zero-shot accuracy of LLaMA-2 and OPT models with 50% sparsity and 4-bit weight quantization . Best Method∗ indicates the best quantization method out of Group AbsMax, AWQ, OmniQuant, and AffineQuant. ↑ indicates better performance.

[원문](https://arxiv.org/abs/2410.09615v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

![Table 15: Average zero-shot accuracy of LLaMA-2 and OPT models with 2:4 sparsity and 4-bit weight quantization . ↑ indicates better performance](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd/figures/figure-0a998cf63661a4b7feca9550f01f754a.png?thumb=512)

**Table 15** . Average zero-shot accuracy of LLaMA-2 and OPT models with 2:4 sparsity and 4-bit weight quantization . ↑ indicates better performance.

[원문](https://arxiv.org/abs/2410.09615v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression · 원문 그림 인용 · 원본 PDF 19쪽에서 그림 영역을 추출했습니다.

![Table 16: Average accuracy of different models on WikiText-2 dataset using different pruning and quantization schemes.↑ indicates better performance. Combining…](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd/figures/figure-34419fd97264463007099a384f36ca3c.png?thumb=512)

**Table 16** . Average accuracy of different models on WikiText-2 dataset using different pruning and quantization schemes.↑ indicates better performance. Combining sparsity and quantization provides better accuracy results in comparison to solely using quantization.

[원문](https://arxiv.org/abs/2410.09615v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression · 원문 그림 인용 · 원본 PDF 19쪽에서 그림 영역을 추출했습니다.

## 적용 범위와 남은 비용

SLIM의 장점은 재학습 없이 적용되는 one-shot 과정에 있지만, 선택적 fine-tuning과 그룹 양자화에는 비용이 따릅니다. 원문은 양자화된 모델의 일반 fine-tuning이 125M 모델에서 12시간, 13B 모델에서 36일 이상 걸렸다고 보고하며, 이 값은 단일 H100 GPU와 C4 300,000 토큰 조건의 측정입니다. 저랭크 adapter만 학습하는 방식은 이 비용을 줄이지만, 본문 실험의 정확도 향상은 특정 모델 계열과 평가 설정에 대한 결과입니다. 또한 L2QER은 희소성과 결합될 때 정확도를 유지하기 어렵다고 원문이 서술하며, calibration 데이터 민감도 분석은 C4와 SlimPajama의 WikiText-2 perplexity 비교로 제한됩니다.

![Table 4: Group quantization slow-down on different LLaMA-2 and LLaMA 3.1 models](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd/figures/figure-61e8d4be5f816e1765054ef4d859b40e.png?thumb=512)

**Table 4** . Group quantization slow-down on different LLaMA-2 and LLaMA 3.1 models.

[원문](https://arxiv.org/abs/2410.09615v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression · 원문 그림 인용 · 원본 PDF 13쪽에서 그림 영역을 추출했습니다.

![Table 18: The required time for fine-tuning the models with a single H100 GPU on 300,000 tokens from the C4 dataset with a batch size of 64 and a sequence leng…](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd/figures/figure-8aa3a486557ed1e678cf918ccc7fbd52.png?thumb=512)

**Table 18** . The required time for fine-tuning the models with a single H100 GPU on 300,000 tokens from the C4 dataset with a batch size of 64 and a sequence length of 1024.

[원문](https://arxiv.org/abs/2410.09615v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression · 원문 그림 인용 · 원본 PDF 21쪽에서 그림 영역을 추출했습니다.

![Table 22: Perplexity of different models on WikiText-2 dataset using SL IM-LoRA with 4-bit quantization using SLIM-Quant with different calibration datasets. ↓…](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd/figures/figure-7f7b073599955359760eb1f51c366ca0.png?thumb=512)

**Table 22** . Perplexity of different models on WikiText-2 dataset using SL IM-LoRA with 4-bit quantization using SLIM-Quant with different calibration datasets. ↓ indicates better performance.

[원문](https://arxiv.org/abs/2410.09615v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi · SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression · 원문 그림 인용 · 원본 PDF 24쪽에서 그림 영역을 추출했습니다.

## 논문 정보

- **저자**: Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2024년 10월 12일
- **등록일**: 2026년 10월 30일
- **수정일**: 2025년 8월 14일
- **버전**: v4
- **arXiv**: 2410.09615
- **분류**: cs.LG · cs.AI · cs.PF
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2410.09615v4) · [원문 PDF ↗](https://arxiv.org/pdf/2410.09615v4)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Conventional model compression techniques for LLMs address high memory consumption and slow inference challenges but typically require computationally expensive retraining to preserve accuracy. In contrast, one-shot compression methods eliminate retraining cost, but struggle to achieve accuracy comparable to dense models. This paper presents SLIM, a new one-shot compression framework that holistically integrates hardware-friendly quantization, sparsity, and low-rank approximation into a unified process. First, we formulate the quantization process using a probabilistic approach (SLIM-Quant) that enables us to apply uniform quantization. Then, we use an existing one-shot pruning method to apply semi-structured sparsity on top of the quantized weights. Finally, to compensate for the introduced aggregated quantization and sparsity error, we use a novel saliency function with unique invertible and additive features that enables us to mathematically compute the value of low-rank adapters. SLIM improves model accuracy by up to 5.66% (LLaMA-2-7B) for 2:4 sparsity with 4-bit weight quantization, outperforming prior methods. Models compressed with SLIM achieve up to 4.3x and 3.8x on Nvidia RTX3060 and A100 GPUs, respectively. Additionally, they achieve up to 0.23x end-to-end memory reduction in comparison to their dense counterparts. We also propose an optional PEFT recipe that further improves accuracy by up to 1.66% (LLaMA-2-13B) compared to SLIM without fine-tuning.

## 원문 인용

Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi (2024). SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression. arXiv:2410.09615v4. https://arxiv.org/abs/2410.09615v4

**BibTeX**

```
@misc{mozaffari2024slim,
  title = {{SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression}},
  author = {Mohammad Mozaffari and Amir Yazdanbakhsh and Maryam Mehri Dehnavi},
  year = {2024},
  eprint = {2410.09615},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.09615v4}
}
```

## 이 논문의 용어

- [Perplexity](https://refivu.com/terms/2b204e513801-perplexity)
- [straight-through estimator](https://refivu.com/terms/daa90b015f59-straight-through-estimator)
- [OPT](https://refivu.com/terms/a143812dd93a-opt)
- [Slimpajama](https://refivu.com/terms/49417fc10791-slimpajama)
- [WikiText2](https://refivu.com/terms/d68c6ead5039-wikitext2)
- [AWQ](https://refivu.com/terms/5f945404d2c2-awq)
- [LLaMA-2](https://refivu.com/terms/86caf7cd440f-llama-2)
- [SparseGPT](https://refivu.com/terms/104184b30234-sparsegpt)
- [Wanda](https://refivu.com/terms/6edd023c4de6-wanda)
- [Low-rank adapters](https://refivu.com/terms/5a165ee891ff-low-rank-adapters)
- [MaskLLM](https://refivu.com/terms/860a140c1768-maskllm)
- [2:4 sparsity](https://refivu.com/terms/184c4247461a-2-4-sparsity)
- [FP8](https://refivu.com/terms/57b0ddf501c7-fp8)

## 다른 논문 해설

- [Mixture of Experts Provably Detect and Learn the Latent Cluster Structure in Gradient-Based Learning](https://refivu.com/papers/3ab7c868-c20e-4dad-b7aa-17e3aeea307b-mixture-of-experts-provably-detect-and-learn-the.md)
- [CauchyNet: Compact and Data-Efficient Learning using Holomorphic Activation Functions](https://refivu.com/papers/4a1f76c6-dfc7-4204-a0c6-234f217002c6-cauchynet-compact-and-data-efficient-learning-using.md)
- [Polybasic Speculative Decoding Through a Theoretical Perspective](https://refivu.com/papers/74f9df3c-47ca-4679-a2bd-c22f74c31c78-polybasic-speculative-decoding-through-a-theoretical.md)
- [BanditSpec: Adaptive Speculative Decoding via Bandit Algorithms](https://refivu.com/papers/6700034d-7c08-40c5-aa82-a9a07368d19f-banditspec-adaptive-speculative-decoding-via-bandit.md)
- [Weight-sparse transformers have interpretable circuits](https://refivu.com/papers/57b058ed-824e-41f1-9bf7-37d4673924a5-weight-sparse-transformers-have-interpretable-circuits.md)
- [Evaluating Parameter Efficient Methods for RLVR](https://refivu.com/papers/1f28563f-e8fd-4532-93ab-1e626d48e2b0-evaluating-parameter-efficient-methods-for-rlvr.md)
- [Neighbour-Driven Gaussian Process Variational Autoencoders for Scalable Structured Latent Modelling](https://refivu.com/papers/3c78e990-8b51-4fb2-9b27-ffc2917a6a2f-neighbour-driven-gaussian-process-variational-autoencoders.md)
- [SAND: One-Shot Feature Selection with Additive Noise Distortion](https://refivu.com/papers/cac62d30-d3ce-4278-a3c8-fb57494aebfd-sand-one-shot-feature-selection-with-additive-noise.md)
- [Embedding Safety into RL: A New Take on Trust Region Methods](https://refivu.com/papers/b53eafdc-46d3-4844-ad24-47dbe7888a01-embedding-safety-into-rl-a-new-take-on.md)
- [Scalable Gaussian Processes with Latent Kronecker Structure](https://refivu.com/papers/1d5b6ab1-f72e-49ab-842e-cf71b44106cd-scalable-gaussian-processes-with-latent-kronecker-structure.md)
- [Towards an Explainable Comparison and Alignment of Feature Embeddings](https://refivu.com/papers/4c62b9f9-0911-405b-85d7-c1a55d765b00-towards-an-explainable-comparison-and-alignment-of-feature.md)
- [Convergence Analysis of the Lion Optimizer in Centralized and Distributed Settings](https://refivu.com/papers/a1f15ca4-f1b6-408f-a0fb-c5095033136b-convergence-analysis-of-the-lion-optimizer-in-centralized.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/ae072c0e-34a1-4b14-ba29-e3cb3b4b38fd-slim-one-shot-quantization-and-sparsity-with-low)
