Back to Feed
Efficiency & Inference

8-bit Matrix Multiplication for Large Language Models

Original: LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale

Listen to the summary

Uses a voice available on your device

Audio options
On this page 4 sections
Related concepts 7 concepts

Key Takeaways

  • LLM.int8() enables zero-degradation inference for language models up to 175B parameters.
  • At the 6.7B scale, 150,000 outliers occur per sequence, concentrated in 6 feature dimensions.
  • Setting outlier feature dimensions to zero decreases top-1 attention softmax probability mass by more than 20% and degrades validation perplexity by 600-1000%.
  • The method isolates emergent outlier feature dimensions into a 16-bit matrix multiplication via a mixed-precision decomposition scheme while multiplying more than 99.9% of values in 8-bit.

Summary & Methodology Analysis

Large language models require significant GPU memory for inference, and existing 8-bit quantization methods degrade performance, require post-training tuning, and have only been studied for models under 350M parameters. The paper introduces LLM.int8() to solve this memory issue without performance degradation. The method works by loading a 16-bit or 32-bit checkpoint for transformer models, which are neural network architectures using attention mechanisms, and applying vector-wise quantization using separate normalization constants for each inner product in the matrix multiplication to quantize most features. To prevent performance loss, it isolates emergent outlier feature dimensions into a 16-bit matrix multiplication via a mixed-precision decomposition scheme while multiplying more than 99.9% of values in 8-bit. It then dequantizes 8-bit matrix multiplication outputs by the outer product of column and row normalization constants, and accumulates outputs from both outlier and regular matrix multiplications in 16-bit floating-point outputs for immediate inference without performance degradation. At the 6.7B scale, 150,000 outliers occur per sequence, concentrated in 6 feature dimensions. Furthermore, setting outlier feature dimensions to zero decreases top-1 attention softmax probability mass by more than 20% and degrades validation perplexity by 600-1000% despite making up about 0.1% of all input features.

The research evaluates models and datasets including OPT-175B, BLOOM, BLOOM-176B, GPT-3, OPT, WinoGrande, HellaSwag, PIQA, LAMBADA, C4, Books, English Wikipedia, CC-News, OpenWebText, CC-Stories, English CC100, GPT-2, GPT-J, RoBERTa, GLUE, WMT14, and WMT16. The paper demonstrates that LLM.int8() enables zero-degradation inference for language models up to 175B parameters.

Despite its effectiveness, the paper notes several limitations. The analysis is solely focused on the Int8 data type and does not study 8-bit floating-point data types. The study is restricted to models with up to 175B parameters, and additional emergent properties might disrupt the quantization methods at larger scales. Additionally, Int8 multiplication is not used for the attention function, and the work focuses on inference and does not study training or finetuning.

Interactive System Flowchart

Click diagram to expand and zoom

Cross-Examination & FAQs

A deeper dive clarifying mechanics, constraints, and baseline evaluations.

Q1. What problem does the paper address?

Large language models require significant GPU memory for inference, and existing 8-bit quantization methods degrade performance, require post-training tuning, and have only been studied for models under 350M parameters.

Q2. What is the main solution proposed?

The paper proposes LLM.int8(), an 8-bit matrix multiplication method using mixed-precision decomposition to maintain model performance.

Q3. What scale of models does the method support?

LLM.int8() enables zero-degradation inference for language models up to 175B parameters.

Q4. How are most features quantized?

By applying vector-wise quantization using separate normalization constants for each inner product in the matrix multiplication.

Q5. How are outlier features handled?

Emergent outlier feature dimensions are isolated into a 16-bit matrix multiplication via a mixed-precision decomposition scheme while multiplying more than 99.9% of values in 8-bit.

Q6. What happens to the outputs of the matrix multiplications?

Outputs from both outlier and regular matrix multiplications are accumulated in 16-bit floating-point outputs for immediate inference without performance degradation.

Q7. What frequency and concentration do outliers exhibit at the 6.7B scale?

At the 6.7B scale, 150,000 outliers occur per sequence, concentrated in 6 feature dimensions.

Q8. What are the limitations regarding data types and scale?

The analysis is solely focused on the Int8 data type and does not study 8-bit floating-point data types, and the study is restricted to models with up to 175B parameters.

Q9. Does the paper study training or finetuning?

No, the work focuses on inference and does not study training or finetuning.

Flag an issue

What is wrong with this summary?

What is wrong?