Pushing the Limits of Large Language Model Quantization via the Linearity Theorem

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Malinovskii, Vladimir, Panferov, Andrei, Ilin, Ivan, Guo, Han, Richtárik, Peter, Alistarh, Dan
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866915035882717184
author Malinovskii, Vladimir
Panferov, Andrei
Ilin, Ivan
Guo, Han
Richtárik, Peter
Alistarh, Dan
author_facet Malinovskii, Vladimir
Panferov, Andrei
Ilin, Ivan
Guo, Han
Richtárik, Peter
Alistarh, Dan
contents Quantizing large language models has become a standard way to reduce their memory and computational costs. Typically, existing methods focus on breaking down the problem into individual layer-wise sub-problems, and minimizing per-layer error, measured via various metrics. Yet, this approach currently lacks theoretical justification and the metrics employed may be sub-optimal. In this paper, we present a "linearity theorem" establishing a direct relationship between the layer-wise $\ell_2$ reconstruction error and the model perplexity increase due to quantization. This insight enables two novel applications: (1) a simple data-free LLM quantization method using Hadamard rotations and MSE-optimal grids, dubbed HIGGS, which outperforms all prior data-free approaches such as the extremely popular NF4 quantized format, and (2) an optimal solution to the problem of finding non-uniform per-layer quantization levels which match a given compression constraint in the medium-bitwidth regime, obtained by reduction to dynamic programming. On the practical side, we demonstrate improved accuracy-compression trade-offs on Llama-3.1 and 3.2-family models, as well as on Qwen-family models. Further, we show that our method can be efficiently supported in terms of GPU kernels at various batch sizes, advancing both data-free and non-uniform quantization for LLMs.
format Preprint
id arxiv_https___arxiv_org_abs_2411_17525
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Pushing the Limits of Large Language Model Quantization via the Linearity Theorem
Malinovskii, Vladimir
Panferov, Andrei
Ilin, Ivan
Guo, Han
Richtárik, Peter
Alistarh, Dan
Machine Learning
Quantizing large language models has become a standard way to reduce their memory and computational costs. Typically, existing methods focus on breaking down the problem into individual layer-wise sub-problems, and minimizing per-layer error, measured via various metrics. Yet, this approach currently lacks theoretical justification and the metrics employed may be sub-optimal. In this paper, we present a "linearity theorem" establishing a direct relationship between the layer-wise $\ell_2$ reconstruction error and the model perplexity increase due to quantization. This insight enables two novel applications: (1) a simple data-free LLM quantization method using Hadamard rotations and MSE-optimal grids, dubbed HIGGS, which outperforms all prior data-free approaches such as the extremely popular NF4 quantized format, and (2) an optimal solution to the problem of finding non-uniform per-layer quantization levels which match a given compression constraint in the medium-bitwidth regime, obtained by reduction to dynamic programming. On the practical side, we demonstrate improved accuracy-compression trade-offs on Llama-3.1 and 3.2-family models, as well as on Qwen-family models. Further, we show that our method can be efficiently supported in terms of GPU kernels at various batch sizes, advancing both data-free and non-uniform quantization for LLMs.
title Pushing the Limits of Large Language Model Quantization via the Linearity Theorem
topic Machine Learning
url https://arxiv.org/abs/2411.17525