[논문 리뷰] OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
OmniQuant는 Learnable Weight Clipping 및 Learnable Equivalent Transformation을 도입하여 PTQ 효율로 대형 언어 모델의 고품질 가중치-전용 및 가중치-활성화 양자화를 가능하게 합니다.
Large language models (LLMs) have revolutionized natural language processing tasks. However, their practical deployment is hindered by their immense memory and computation requirements. Although recent post-training quantization (PTQ) methods are effective in reducing memory footprint and improving the computational efficiency of LLM, they hand-craft quantization parameters, leading to low performance, especially in extremely low-bit quantization. To tackle this issue, we introduce an Omnidirectionally calibrated Quantization ( extbf{OmniQuant}) technique for LLMs, which achieves good performance in diverse quantization settings while maintaining the computational efficiency of PTQ by efficiently optimizing various quantization parameters. OmniQuant comprises two innovative components including Learnable Weight Clipping (LWC) and Learnable Equivalent Transformation (LET). LWC modulates the extreme values of weights by optimizing the clipping threshold. Meanwhile, LET tackles activation outliers by shifting the challenge of quantization from activations to weights. Operating within a differentiable framework using block-wise error minimization, OmniQuant can optimize the quantization process efficiently for both weight-only and weight-activation quantization. For instance, the LLaMA-2 model family size 7-70B can be processed with OmniQuant on a single A100-40G GPU within 1-16 hours using 128 samples. Extensive experiments validate OmniQuant's superior performance across diverse quantization configurations such as W4A4 (4-bit weight, 4-bit activation), W6A6, W4A16, W3A16, and W2A16. Additionally, OmniQuant demonstrates effectiveness in instruction-tuned models and delivers notable improvements in inference speed and memory reduction on real devices. Codes are available at \url{https://github.com/OpenGVLab/OmniQuant}.
연구 동기 및 목표
- 대형 언어 모델(LLMs)의 메모리 및 계산 필요성을 정확도를 포기하지 않고 줄이는 것을 목표로 함.
- QAT 유사 성능을 달성하는 미분 가능하고 포스트 트레이닝 양자화 프레임워크를 개발함.
- 다양한 LLM 계열에서 신뢰할 수 있는 저비트 양자화(예: W2A16, W4A4)를 가능하게 함.
- 대형 모델에 대해 PTQ 스타일의 데이터 효율성 및 단일 GPU 실용성을 유지함.
제안 방법
- 전체 정밀도 가중치를 고정시키고 양자화 매개변수의 소수 집합을 학습하는 블록 단위 양자화 오차 최소화 objective를 수식화함.
- 가중치 양자화를 개선하기 위해 가중치 클리핑 임계값을 최적화하는 Learnable Weight Clipping(LWC)을 도입함.
- 채널별 스케일링/시프트를 통한 활성화에서 가중치로 양자화 난이도를 이동시키기 위해 선형 및 주의(attention) 계층에서 LET(Leafable Equivalent Transformation)을 도입함.
- 블록 단위 프레임워크 내에서 LWC와 LET를 함께 최적화하는 미분 가능한 최적화를 적용하여 가중치-전용 및 가중치-활성화 양자화를 가능하게 함.
- 최적화 후 원래 가중치에 매개변수를 융합한 상태로 Activation 및 Weight 모두에 대해 MinMax 양자화를 사용함.
- 여러 모델(LLaMA, OPT, Falcon, LLaMA-2, LLaMA-2-chat)과 양자화 설정(W4A4, W3A16, W2A16, W6A6 등)을 대상으로 검증함.
실험 결과
연구 질문
- RQ1그라데이션 기반 최적화를 PTQ에 도입하여 LLM 양자화에 대해 QAT 유사 성능을 달성할 수 있는가?
- RQ2Transformer의 가중치 분포와 활성화 이상치가 매우 낮은 비트 양자화를 가능하게 하도록 어떻게 완화될 수 있는가?
- RQ3학습가능한 구성요소(LWC 및 LET)가 모델 계열 및 지시문 조정 변형에 걸쳐 일반화되는가?
- RQ4단일 GPU 하드웨어에서 대형 모델을 양자화하기 위한 실용적 데이터 및 시간 요건은 어떤가?
- RQ5OmniQuant의 가중치-전용 및 가중치-활성화 양자화가 제로샷 작업 및 언어 생성 perplexity에서 기존 PTQ/QAT 방법과 비교하여 어떤가?
주요 결과
- OmniQuant는 다양한 구성(W4A4, W3A16, W2A16, W6A6 등) 및 모델 계열에서 기존 PTQ 기반 방법보다 우수한 성능을 보인다.
- W2A16 양자화의 경우, LLaMA-1/2 모델에서 GPTQ 및 기타 벤치마크 대비 상당히 더 나은 perplexity를 달성한다.
- 가중치-활성화 설정에서 OmniQuant는 제로샷 작업 정확도에서 현저한 이점을 제공하며(여러 LLaMA 변형에서 평균적으로 약 5–12포인트 정도의 향상) 일부 QAT 접근법을 더 작은 모델에서 능가할 수 있다.
- OmniQuant는 LLaMA-2-chat 및 기타 지시문 조정 모델의 GPT-4 평가 프로토콜 하에서 경쟁력 있는 성능으로 양자화를 가능하게 한다.
- LLaMA-2 계열 및 기타 모델에 대한 양자화는 단일 A100-40G GPU에서 최소 128 샘플과 모델 크기에 대해 1–16시간의 컴퓨팅으로 수행될 수 있다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.