Skip to main content
QUICK REVIEW

[논문 리뷰] Outlier Suppression: Pushing the Limit of Low-bit Transformer Language Models

Xiuying Wei, Yuncheng Zhang|arXiv (Cornell University)|2022. 09. 27.
Topic ModelingComputer Science인용 수 28
한 줄 요약

본 논문은 Gamma Migration과 Token-Wise Clipping으로 이상치 억제 프레임워크를 제시하여 Transformer 모델의 저비트 양자화를 개선하고, BERT, RoBERTa, BART와 같은 모델에서 6-bit PTQ 및 4-bit QAT에서 거의 FP 정확도에 근접한 성능을 달성한다.

ABSTRACT

Transformer architecture has become the fundamental element of the widespread natural language processing~(NLP) models. With the trends of large NLP models, the increasing memory and computation costs hinder their efficient deployment on resource-limited devices. Therefore, transformer quantization attracts wide research interest. Recent work recognizes that structured outliers are the critical bottleneck for quantization performance. However, their proposed methods increase the computation overhead and still leave the outliers there. To fundamentally address this problem, this paper delves into the inherent inducement and importance of the outliers. We discover that $\boldsymbol γ$ in LayerNorm (LN) acts as a sinful amplifier for the outliers, and the importance of outliers varies greatly where some outliers provided by a few tokens cover a large area but can be clipped sharply without negative impacts. Motivated by these findings, we propose an outlier suppression framework including two components: Gamma Migration and Token-Wise Clipping. The Gamma Migration migrates the outlier amplifier to subsequent modules in an equivalent transformation, contributing to a more quantization-friendly model without any extra burden. The Token-Wise Clipping takes advantage of the large variance of token range and designs a token-wise coarse-to-fine pipeline, obtaining a clipping range with minimal final quantization loss in an efficient way. This framework effectively suppresses the outliers and can be used in a plug-and-play mode. Extensive experiments prove that our framework surpasses the existing works and, for the first time, pushes the 6-bit post-training BERT quantization to the full-precision (FP) level. Our code is available at https://github.com/wimh966/outlier_suppression.

연구 동기 및 목표

  • 트랜스포머 양자화에서 구조화된 이상치의 근본 원인과 영향을 조사한다.
  • 추론 비용을 증가시키지 않으면서 이상치를 억제하는 플러그-앤-플레이 프레임워크를 개발한다.
  • 분류, QA, 요약 작업에서 BERT, RoBERTa, BART 전반에 걸친 개선을 보여준다.

제안 방법

  • LayerNorm의 gamma가 Transformer 활성화에서 이상치 증폭기로 작용한다는 것을 식별한다.
  • 동등한 FP 변환에서 gamma 증폭을 이후 모듈로 이동시키는 Gamma Migration을 제안한다.
  • 최소한의 양자화 손실 클리핑 범위를 찾기 위한 거친-세부(coarse-to-fine) 토큰별 파이프라인을 갖춘 Token-Wise Clipping을 도입한다.
  • Gamma Migration 이후 출력을 양자화하여 추가 계산 없이 활성화 양자화 오차를 줄인다.
  • 토큰별 대표를 통해 클리핑 범위를 빠르게 추정하는 거친 단계와 클리핑 매개변수를 미세 조정하는 정밀 단계로 구성된다.
  • 기존 PTQ/QAT 방법과의 플러그-앤-플레이 호환성을 시연한다.

실험 결과

연구 질문

  • RQ1Transformer 활성화에서 이상치가 어떻게 발생하고 LayerNorm의 gamma가 이에 어떻게 기여하는가?
  • RQ2추가 비용 없이 양자화 강건성을 높이기 위해 이상치 증폭을 나중 계층으로 옮길 수 있는가?
  • RQ3다양한 범위를 가진 토큰 간의 양자화 손실을 효율적으로 최소화하기 위해 토큰별 거친-정밀(clipping)을 어떻게 적용할 수 있는가?
  • RQ4Gamma Migration과 Token-Wise Clipping이 PTQ와 QAT 설정에서 BERT, RoBERTa, BART 전반의 양자화 성능을 향상시키는가?

주요 결과

  • Gamma Migration은 가중치에 거의 영향을 주지 않으면서 활성화 양자화 부담을 줄인다.
  • Token-Wise Clipping은 최종 양자화 손실을 최소화하면서 클리핑 범위를 효율적으로 식별한다.
  • 이 프레임워크는 여러 작업에서 BERT, RoBERTa, BART의 PTQ/QAT 성능을 향상시킨다.
  • 6-bit PTQ에서 방법은 성능을 거의 전체 정밀도에 가깝게 끌어올리고; 4-bit QAT에서는 여러 설정에서 근사 FP 정확도를 달성한다.
  • 이 프레임워크는 트랜스포머 양자화에서 최첨단 결과를 달성하고 일부 모델에서 6-bit PTQ로도 풀 정밀도 수준의 성능을 가능하게 한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.