Quantization and pruning optimization method for attention mechanism
CSTR:
Author:
Affiliation:

(1. College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China;2. National Key Laboratory of Paralle and Distributed Computing, National University of Defense Technology, Changsha 410073, China)

Clc Number:

TP18

Fund Project:

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    To address the significant computation and memory overhead of models based on attention mechanism, model compression techniques, such as collaborative optimization of quantization and pruning, were studied. A symmetric linear fixed point quantization method was proposed for four activation matrices of query, key, value and probability in the attention mechanism. Meanwhile, a probability matrix pruning method and a progressive pruning strategy were proposed to effectively reduce the pruning accuracy loss. Experimental results on different datasets show that for the typical attention-based model BERT, this optimization method can achieve 4 bit or 8 bit fixed point quantization and 0.93~0.98 sparsity with little or no accuracy loss, which greatly reduces the model computation and lays a strong foundation for accelerating the inference of quantized sparse models.

    Reference
    Related
    Cited by
Get Citation

HE Yuanhong, JIANG Jingfei, XU Jinwei. Quantization and pruning optimization method for attention mechanism[J]. Journal of National University of Defense Technology,2024,46(1):113-120.

Copy
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:October 17,2022
  • Revised:
  • Adopted:
  • Online: January 28,2024
  • Published: February 28,2024
Article QR Code