ChatPaper.aiChatPaper

EfficientQAT: 대규모 언어 모델을 위한 효율적인 양자화 인지 학습

EfficientQAT: Efficient Quantization-Aware Training for Large Language Models

July 10, 2024
저자: Mengzhao Chen, Wenqi Shao, Peng Xu, Jiahao Wang, Peng Gao, Kaipeng Zhang, Yu Qiao, Ping Luo
cs.AI

초록

대규모 언어 모델(LLM)은 현대 자연어 처리와 인공지능의 핵심 요소입니다. 그러나 이러한 모델은 상당한 메모리 요구 사항을 관리하는 데 어려움을 겪고 있습니다. 양자화 인지 훈련(QAT)은 낮은 비트 표현을 통해 메모리 소비를 줄이고 정확도 손실을 최소화하는 해결책을 제공하지만, 모델 가중치와 양자화 매개변수를 최적화하기 위해 상당한 훈련 자원을 요구합니다. 이를 해결하기 위해 우리는 LLM 압축을 위한 새로운 양자화 기술인 Efficient Quantization-Aware Training(EfficientQAT)을 제안합니다. EfficientQAT은 두 가지 연속적인 단계로 구성됩니다: 모든 매개변수의 블록 단위 훈련(Block-AP)과 양자화 매개변수의 종단 간 훈련(E2E-QP). Block-AP는 각 트랜스포머 블록의 모든 매개변수에 대해 블록 단위 재구성을 통해 양자화 인지 훈련을 순차적으로 수행하며, 전체 LLM을 훈련하지 않음으로써 효율성을 유지합니다. 양자화된 모델로 초기화된 E2E-QP는 양자화 매개변수(스텝 크기)만을 종단 간 훈련하여, 고정된 양자화 백본과 감소된 훈련 가능 매개변수 수로 효율성을 향상시킵니다. 광범위한 실험을 통해 EfficientQAT이 기본 LLM, 지시 튜닝된 LLM, 다중 모달 LLM을 포함한 다양한 모델에서 7B에서 70B 매개변수 규모의 다양한 양자화 비트에서 이전 양자화 방법들을 능가함을 입증했습니다. 예를 들어, EfficientQAT은 단일 A100-80GB GPU에서 41시간 만에 2비트 Llama-2-70B 모델을 얻었으며, 전체 정밀도 대비 3% 미만의 정확도 저하를 보였습니다(69.48 대 72.41). 특히, 이 INT2 양자화된 70B 모델은 Llama-2-13B 모델 대비 1.67의 정확도 향상을 달성하면서 더 적은 메모리를 요구했습니다(19.2GB 대 24.2GB). 코드는 https://github.com/OpenGVLab/EfficientQAT에서 확인할 수 있습니다.
English
Large language models (LLMs) are integral to modern natural language processing and artificial intelligence. However, they face challenges in managing their significant memory requirements. Although quantization-aware training (QAT) offers a solution by reducing memory consumption through low-bit representations with minimal accuracy loss, it demands substantial training resources to optimize model weights and quantization parameters. To address this, we propose Efficient Quantization-Aware Training (EfficientQAT), a novel quantization technique for compressing LLMs. EfficientQAT involves two consecutive phases: Block-wise training of all parameters (Block-AP) and end-to-end training of quantization parameters (E2E-QP). Block-AP sequentially conducts quantization-aware training for all parameters in each transformer block with block-wise reconstruction, maintaining efficiency by avoiding training the entire LLM. Initialized with quantized model, E2E-QP then trains only quantization parameters (step sizes) end-to-end, enhancing efficiency with a fixed quantized backbone and reduced trainable parameter count. Extensive experiments demonstrate that EfficientQAT outperforms previous quantization methods across a range of models, including base LLMs, instruction-tuned LLMs, and multimodal LLMs, with scales from 7B to 70B parameters at various quantization bits. For instance, EfficientQAT obtains a 2-bit Llama-2-70B model on a single A100-80GB GPU in 41 hours, with less than 3\% accuracy degradation compared to the full precision (69.48 vs. 72.41). Notably, this INT2 quantized 70B model obtains a 1.67 accuracy gain over the Llama-2-13B model (69.48 vs. 67.81) while requiring less memory (19.2GB vs. 24.2GB). Code is available at https://github.com/OpenGVLab/EfficientQAT.

Summary

AI-Generated Summary

PDF93November 28, 2024