EasyQuant: An Efficient Data-free Quantization Algorithm for LLMs

Hanlin Tang, Yifu Sun, Decheng Wu, Kai Liu, Jianchen Zhu +1 more
3/5/2024
cs.AIcs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Large language models (LLMs) have proven to be very superior to conventional methods in various tasks. However, their expensive computations and high memory requirements are prohibitive for deployment. Model quantization is an effective method for reducing this overhead. The problem is that in most previous works, the quantized model was calibrated using few samples from the training data, which might affect the generalization of the quantized LLMs to unknown cases and tasks. Hence in this work, we explore an important question: Can we design a data-independent quantization method for LLMs to guarantee its generalization performance? In this work, we propose EasyQuant, a training-free and data-independent weight-only quantization algorithm for LLMs. Our observation indicates that two factors: outliers in the weight and quantization ranges, are essential for reducing the quantization error. Therefore, in EasyQuant, we leave the outliers (less than 1%) unchanged and optimize the quantization range to reduce the reconstruction error. With these methods, we surprisingly find that EasyQuant achieves comparable performance to the original model. Since EasyQuant does not depend on any training data, the generalization performance of quantized LLMs is safely guaranteed. Moreover, EasyQuant can be implemented in parallel so that the quantized model could be attained in a few minutes even for LLMs over 100B. To our best knowledge, we are the first work that achieves almost lossless quantization performance for LLMs under a data-independent setting and our algorithm runs over 10 times faster than the data-dependent methods.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{tang2024easyquant,
  title  = {EasyQuant: An Efficient Data-free Quantization Algorithm for LLMs},
  author = {Hanlin Tang and Yifu Sun and Decheng Wu and Kai Liu and Jianchen Zhu and Zhanhui Kang},
  year   = {2024},
  eprint = {2403.02775},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.02775v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.02775.svg)](https://codeofpaper.com/paper/2403.02775)

Discussion