APTQ: Attention-aware Post-Training Mixed-Precision Quantization for Large Language Models

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Guan, Ziyi, Huang, Hantao, Su, Yupeng, Huang, Hong, Wong, Ngai, Yu, Hao
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866929315075063808
author Guan, Ziyi
Huang, Hantao
Su, Yupeng
Huang, Hong
Wong, Ngai
Yu, Hao
author_facet Guan, Ziyi
Huang, Hantao
Su, Yupeng
Huang, Hong
Wong, Ngai
Yu, Hao
contents Large Language Models (LLMs) have greatly advanced the natural language processing paradigm. However, the high computational load and huge model sizes pose a grand challenge for deployment on edge devices. To this end, we propose APTQ (Attention-aware Post-Training Mixed-Precision Quantization) for LLMs, which considers not only the second-order information of each layer's weights, but also, for the first time, the nonlinear effect of attention outputs on the entire model. We leverage the Hessian trace as a sensitivity metric for mixed-precision quantization, ensuring an informed precision reduction that retains model performance. Experiments show APTQ surpasses previous quantization methods, achieving an average of 4 bit width a 5.22 perplexity nearly equivalent to full precision in the C4 dataset. In addition, APTQ attains state-of-the-art zero-shot accuracy of 68.24\% and 70.48\% at an average bitwidth of 3.8 in LLaMa-7B and LLaMa-13B, respectively, demonstrating its effectiveness to produce high-quality quantized LLMs.
format Preprint
id arxiv_https___arxiv_org_abs_2402_14866
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle APTQ: Attention-aware Post-Training Mixed-Precision Quantization for Large Language Models
Guan, Ziyi
Huang, Hantao
Su, Yupeng
Huang, Hong
Wong, Ngai
Yu, Hao
Machine Learning
Artificial Intelligence
Computation and Language
Large Language Models (LLMs) have greatly advanced the natural language processing paradigm. However, the high computational load and huge model sizes pose a grand challenge for deployment on edge devices. To this end, we propose APTQ (Attention-aware Post-Training Mixed-Precision Quantization) for LLMs, which considers not only the second-order information of each layer's weights, but also, for the first time, the nonlinear effect of attention outputs on the entire model. We leverage the Hessian trace as a sensitivity metric for mixed-precision quantization, ensuring an informed precision reduction that retains model performance. Experiments show APTQ surpasses previous quantization methods, achieving an average of 4 bit width a 5.22 perplexity nearly equivalent to full precision in the C4 dataset. In addition, APTQ attains state-of-the-art zero-shot accuracy of 68.24\% and 70.48\% at an average bitwidth of 3.8 in LLaMa-7B and LLaMa-13B, respectively, demonstrating its effectiveness to produce high-quality quantized LLMs.
title APTQ: Attention-aware Post-Training Mixed-Precision Quantization for Large Language Models
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2402.14866