Skip to main content
QUICK REVIEW

[논문 리뷰] SpQR: A Sparse-Quantized Representation for Near-Lossless LLM Weight Compression

Tim Dettmers, Ruslan Svirschevski|arXiv (Cornell University)|2023. 06. 05.
Topic ModelingComputer Science인용 수 25
한 줄 요약

SpQR은 고감도 이상치 가중치의 소규모 집합을 더 높은 정밀도로 유지하고 나머지를 3-4비트로 양자화하는 하이브리드 희소-양자화 형식을 도입하여, 대형 언어 모델의 거의 손실 없는 압축과 효율적인 GPU 디코딩을 가능하게 한다.

ABSTRACT

Recent advances in large language model (LLM) pretraining have led to high-quality LLMs with impressive abilities. By compressing such LLMs via quantization to 3-4 bits per parameter, they can fit into memory-limited devices such as laptops and mobile phones, enabling personalized use. However, quantization down to 3-4 bits per parameter usually leads to moderate-to-high accuracy losses, especially for smaller models in the 1-10B parameter range, which are well-suited for edge deployments. To address this accuracy issue, we introduce the Sparse-Quantized Representation (SpQR), a new compressed format and quantization technique which enables for the first time near-lossless compression of LLMs across model scales, while reaching similar compression levels to previous methods. SpQR works by identifying and isolating outlier weights, which cause particularly-large quantization errors, and storing them in higher precision, while compressing all other weights to 3-4 bits, and achieves relative accuracy losses of less than 1% in perplexity for highly-accurate LLaMA and Falcon LLMs. This makes it possible to run 33B parameter LLM on a single 24 GB consumer GPU without any performance degradation at 15% speedup thus making powerful LLMs available to consumer without any downsides. SpQR comes with efficient algorithms for both encoding weights into its format, as well as decoding them efficiently at runtime. Specifically, we provide an efficient GPU inference algorithm for SpQR which yields faster inference than 16-bit baselines at similar accuracy, while enabling memory compression gains of more than 4x.

연구 동기 및 목표

  • 표준 저비트 양자화가 LLM의 품질을 왜 저하시기는지 조사하고, 특히 1-10B 매개변수 범위에서의 영향에 주목한다.
  • 이상치를 별도로 다루어 정확성을 보존하는 하이브리드 희소-양자화 표현을 제안한다.
  • SpQR를 위한 효율적인 인코딩/디코딩 알고리즘과 GPU 가속 런타임을 개발한다.
  • 7B에서 65B 매개변수 규모에 걸친 거의 손실 없는 압축(≤1% perplexity 손실)을 입증한다.
  • 기존 PTQ 방법과 비교한 메모리 및 속도 이점을 평가한다.

제안 방법

  • 양자화로 인해 출력 오차가 불균형적으로 크게 유발되는 이상치 가중치를 식별하고 이를 더 높은 정밀도(16비트)로 저장한다.
  • 기본 가중치에 매우 작은 그룹 양자화(β1 ≈ 8-32)를 적용하고 통계를 위해 2단계 양자화(β2 ≈ 16)를 사용하여 이중 수준 양자화를 가능하게 한다.
  • 기본 가중치를 3-4비트로 양자화하고 이상치를 CSR 유사 희소 형식으로 별도 인코딩한다.
  • 처음 및 두 번째 수준 통계 자체를 동일한 양자화 파이프라인으로 양자화한다(작은 그룹에 대해 3비트 스케일/제로포인트).
  • GPTQ에서 영감을 받은 확장 PTQ 접근법으로 두 단계 프로세스를 사용: 민감도(Eq. 2)에 의한 이상치 탐지와 기본 가중치 양자화, 그다음 희소 이상치 및 메타데이터를 조합하는 단계.
  • 토큰별 생성을 위한 CSR 기반 이상치 처리를 결합한 밀집 16비트 디퀀타이제이션과 GPU 디코딩 알고리즘을 제공한다.

실험 결과

연구 질문

  • RQ1다양한 LLM에서 매매개변수당 3-4비트로 모델 크기를 줄이면서 근사 손실이 없는 압축(≤1% perplexity 손실)을 SpQR가 달성할 수 있는가?
  • RQ2이상치를 격리하고 아주 작은 그룹의 이중 수준 양자화를 사용하는 것이 RTN 및 GPTQ와 비교했을 때 언어 모델링 perplexity 및 제로샷 작업에 어떤 영향을 미치는가?
  • RQ3대형 모델의 GPU 추론에서 SpQR이 제공하는 메모리 및 연산 이점은 무엇인가?

주요 결과

  • SpQR은 매개변수당 3-4비트로 양자화했을 때 높은 정확도의 LLaMA 및 Falcon 모델에서 상대 perplexity 손실이 1% 미만이다.
  • SpQR은 정확도 저하 없이 LLM을 약 3.4배 이상 압축하며, 24 GB GPU에서 33B 매개변수 모델을 실행하고 16비트 기반 대비 약 15% 속도 향상을 달성한다.
  • 유사한 규모의 GPTQ 및 RTN 기준치와 비교하여 SpQR은 현저히 더 나은 perplexity와 제로샷 성능을 보여주며, GPTQ가 RTN 대비 얻은 이득의 크기만큼 개선이 나타난다.
  • 4비트 기본 양자화를 사용하여, SpQR은 LLaMA 및 Falcon 계열에서 최첨단 기준선의 성능에 근접하거나 이를 능가할 수 있으며, 종종 16비트 기준 대비 오차를 절반으로 줄인다.
  • 이상치(약 1%의 가중치)는 16비트로 유지되고 CSR 유사 희소 구조에 저장되어 GPU에서 효율적인 디코딩을 가능하게 한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.