Enhancing Computation Efficiency in Large Language Models through Weight and Activation Quantization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Lee, Janghwan, Kim, Minsoo, Baek, Seungcheol, Hwang, Seok Joong, Sung, Wonyong, Choi, Jungwook
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929425531011072
author Lee, Janghwan
Kim, Minsoo
Baek, Seungcheol
Hwang, Seok Joong
Sung, Wonyong
Choi, Jungwook
author_facet Lee, Janghwan
Kim, Minsoo
Baek, Seungcheol
Hwang, Seok Joong
Sung, Wonyong
Choi, Jungwook
contents Large Language Models (LLMs) are proficient in natural language processing tasks, but their deployment is often restricted by extensive parameter sizes and computational demands. This paper focuses on post-training quantization (PTQ) in LLMs, specifically 4-bit weight and 8-bit activation (W4A8) quantization, to enhance computational efficiency -- a topic less explored compared to weight-only quantization. We present two innovative techniques: activation-quantization-aware scaling (AQAS) and sequence-length-aware calibration (SLAC) to enhance PTQ by considering the combined effects on weights and activations and aligning calibration sequence lengths to target tasks. Moreover, we introduce dINT, a hybrid data format combining integer and denormal representations, to address the underflow issue in W4A8 quantization, where small values are rounded to zero. Through rigorous evaluations of LLMs, including OPT and LLaMA, we demonstrate that our techniques significantly boost task accuracies to levels comparable with full-precision models. By developing arithmetic units compatible with dINT, we further confirm that our methods yield a 2$\times$ hardware efficiency improvement compared to 8-bit integer MAC unit.
format Preprint
id arxiv_https___arxiv_org_abs_2311_05161
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Enhancing Computation Efficiency in Large Language Models through Weight and Activation Quantization
Lee, Janghwan
Kim, Minsoo
Baek, Seungcheol
Hwang, Seok Joong
Sung, Wonyong
Choi, Jungwook
Computation and Language
Large Language Models (LLMs) are proficient in natural language processing tasks, but their deployment is often restricted by extensive parameter sizes and computational demands. This paper focuses on post-training quantization (PTQ) in LLMs, specifically 4-bit weight and 8-bit activation (W4A8) quantization, to enhance computational efficiency -- a topic less explored compared to weight-only quantization. We present two innovative techniques: activation-quantization-aware scaling (AQAS) and sequence-length-aware calibration (SLAC) to enhance PTQ by considering the combined effects on weights and activations and aligning calibration sequence lengths to target tasks. Moreover, we introduce dINT, a hybrid data format combining integer and denormal representations, to address the underflow issue in W4A8 quantization, where small values are rounded to zero. Through rigorous evaluations of LLMs, including OPT and LLaMA, we demonstrate that our techniques significantly boost task accuracies to levels comparable with full-precision models. By developing arithmetic units compatible with dINT, we further confirm that our methods yield a 2$\times$ hardware efficiency improvement compared to 8-bit integer MAC unit.
title Enhancing Computation Efficiency in Large Language Models through Weight and Activation Quantization
topic Computation and Language
url https://arxiv.org/abs/2311.05161