QQQ: Quality Quattuor-Bit Quantization for Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Ying, Zhang, Peng, Huang, Mincong, Xiang, Jingyang, Wang, Yujie, Wang, Chao, Zhang, Yineng, Yu, Lei, Liu, Chuan, Lin, Wei
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909274777583616
author Zhang, Ying
Zhang, Peng
Huang, Mincong
Xiang, Jingyang
Wang, Yujie
Wang, Chao
Zhang, Yineng
Yu, Lei
Liu, Chuan
Lin, Wei
author_facet Zhang, Ying
Zhang, Peng
Huang, Mincong
Xiang, Jingyang
Wang, Yujie
Wang, Chao
Zhang, Yineng
Yu, Lei
Liu, Chuan
Lin, Wei
contents Quantization is a proven effective method for compressing large language models. Although popular techniques like W8A8 and W4A16 effectively maintain model performance, they often fail to concurrently speed up the prefill and decoding stages of inference. W4A8 is a promising strategy to accelerate both of them while usually leads to a significant performance degradation. To address these issues, we present QQQ, a Quality Quattuor-bit Quantization method with 4-bit weights and 8-bit activations. QQQ employs adaptive smoothing and Hessian-based compensation, significantly enhancing the performance of quantized models without extensive training. Furthermore, we meticulously engineer W4A8 GEMM kernels to increase inference speed. Our specialized per-channel W4A8 GEMM and per-group W4A8 GEMM achieve impressive speed increases of 3.67$\times$ and 3.29 $\times$ over FP16 GEMM. Our extensive experiments show that QQQ achieves performance on par with existing state-of-the-art LLM quantization methods while significantly accelerating inference, achieving speed boosts up to 2.24 $\times$, 2.10$\times$, and 1.25$\times$ compared to FP16, W8A8, and W4A16, respectively.
format Preprint
id arxiv_https___arxiv_org_abs_2406_09904
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle QQQ: Quality Quattuor-Bit Quantization for Large Language Models
Zhang, Ying
Zhang, Peng
Huang, Mincong
Xiang, Jingyang
Wang, Yujie
Wang, Chao
Zhang, Yineng
Yu, Lei
Liu, Chuan
Lin, Wei
Machine Learning
Quantization is a proven effective method for compressing large language models. Although popular techniques like W8A8 and W4A16 effectively maintain model performance, they often fail to concurrently speed up the prefill and decoding stages of inference. W4A8 is a promising strategy to accelerate both of them while usually leads to a significant performance degradation. To address these issues, we present QQQ, a Quality Quattuor-bit Quantization method with 4-bit weights and 8-bit activations. QQQ employs adaptive smoothing and Hessian-based compensation, significantly enhancing the performance of quantized models without extensive training. Furthermore, we meticulously engineer W4A8 GEMM kernels to increase inference speed. Our specialized per-channel W4A8 GEMM and per-group W4A8 GEMM achieve impressive speed increases of 3.67$\times$ and 3.29 $\times$ over FP16 GEMM. Our extensive experiments show that QQQ achieves performance on par with existing state-of-the-art LLM quantization methods while significantly accelerating inference, achieving speed boosts up to 2.24 $\times$, 2.10$\times$, and 1.25$\times$ compared to FP16, W8A8, and W4A16, respectively.
title QQQ: Quality Quattuor-Bit Quantization for Large Language Models
topic Machine Learning
url https://arxiv.org/abs/2406.09904