ChatPaper.aiChatPaper

VPTQ: 대규모 언어 모델을 위한 극히 낮은 비트 벡터 사후 훈련 양자화

VPTQ: Extreme Low-bit Vector Post-Training Quantization for Large Language Models

September 25, 2024
저자: Yifei Liu, Jicheng Wen, Yang Wang, Shengyu Ye, Li Lyna Zhang, Ting Cao, Cheng Li, Mao Yang
cs.AI

초록

모델 크기 확장은 대규모 언어 모델 (LLM)의 배포와 추론에 중대한 도전을 제공합니다. LLM 가중치의 중복으로 인해, 최근 연구는 가중치만을 대상으로 한 양자화를 극히 낮은 비트로 이끌어내는 데 초점을 맞추었습니다 (심지어 2비트까지). 이는 메모리 요구 사항을 줄이고 저장 비용을 최적화하며 추론 중 메모리 대역폭 요구를 감소시킵니다. 그러나 수치 표현 제한으로 인해, 전통적인 스칼라 기반의 가중치 양자화는 이러한 극히 낮은 비트를 달성하기 어렵습니다. LLM에 대한 Vector Quantization (VQ)에 대한 최근 연구는 벡터를 룩업 테이블을 사용하여 인덱스로 압축함으로써 극히 낮은 비트 모델 양자화의 잠재력을 입증했습니다. 본 논문에서는 LLM의 극히 낮은 비트 양자화를 위한 Vector Post-Training Quantization (VPTQ)를 소개합니다. LLM VQ 문제를 정의하기 위해 Second-Order Optimization을 사용하고 최적화 문제를 해결하여 양자화 알고리즘 설계를 안내합니다. 또한 Channel-Independent Second-Order Optimization을 사용하여 가중치를 더 세밀하게 조정하여 VQ를 진행합니다. 최적화 문제를 분해함으로써 간결하고 효과적인 코드북 초기화 알고리즘을 제안합니다. 또한 잔차 및 이상치 양자화를 지원하도록 VPTQ를 확장하여 모델 정확도를 향상시키고 모델을 더 압축합니다. 실험 결과는 VPTQ가 LLaMA-2에서 0.01-0.34, Mistral-7B에서 0.38-0.68, LLaMA-3에서 4.41-7.34의 모델 양자화 퍼플렉서티를 감소시키고, LLaMA-2에서 0.79-1.5%, Mistral-7B에서 1%, LLaMA-3에서 11-22%의 평균 정확도 향상을 보여줍니다. 양자화 알고리즘 실행 시간의 10.4-18.6%만을 활용하여 SOTA 대비 추론 처리량이 1.6-1.8배 증가합니다.
English
Scaling model size significantly challenges the deployment and inference of Large Language Models (LLMs). Due to the redundancy in LLM weights, recent research has focused on pushing weight-only quantization to extremely low-bit (even down to 2 bits). It reduces memory requirements, optimizes storage costs, and decreases memory bandwidth needs during inference. However, due to numerical representation limitations, traditional scalar-based weight quantization struggles to achieve such extreme low-bit. Recent research on Vector Quantization (VQ) for LLMs has demonstrated the potential for extremely low-bit model quantization by compressing vectors into indices using lookup tables. In this paper, we introduce Vector Post-Training Quantization (VPTQ) for extremely low-bit quantization of LLMs. We use Second-Order Optimization to formulate the LLM VQ problem and guide our quantization algorithm design by solving the optimization. We further refine the weights using Channel-Independent Second-Order Optimization for a granular VQ. In addition, by decomposing the optimization problem, we propose a brief and effective codebook initialization algorithm. We also extend VPTQ to support residual and outlier quantization, which enhances model accuracy and further compresses the model. Our experimental results show that VPTQ reduces model quantization perplexity by 0.01-0.34 on LLaMA-2, 0.38-0.68 on Mistral-7B, 4.41-7.34 on LLaMA-3 over SOTA at 2-bit, with an average accuracy improvement of 0.79-1.5% on LLaMA-2, 1% on Mistral-7B, 11-22% on LLaMA-3 on QA tasks on average. We only utilize 10.4-18.6% of the quantization algorithm execution time, resulting in a 1.6-1.8times increase in inference throughput compared to SOTA.

Summary

AI-Generated Summary

PDF294November 16, 2024