GPTVQ : La bénédiction de la dimensionnalité pour la quantification des LLM
GPTVQ: The Blessing of Dimensionality for LLM Quantization
February 23, 2024
Auteurs: Mart van Baalen, Andrey Kuzmin, Markus Nagel, Peter Couperus, Cedric Bastoul, Eric Mahurin, Tijmen Blankevoort, Paul Whatmough
cs.AI
Résumé
Dans ce travail, nous démontrons que le compromis entre taille et précision dans la quantification des réseaux de neurones peut être considérablement amélioré en augmentant la dimensionnalité de la quantification. Nous proposons la méthode GPTVQ, une nouvelle méthode rapide pour la quantification vectorielle (VQ) post-entraînement, qui s'adapte bien aux grands modèles de langage (LLMs). Notre méthode alterne la quantification d'une ou plusieurs colonnes avec des mises à jour des poids non quantifiés restants, en utilisant des informations provenant de la Hessienne de l'erreur quadratique moyenne (MSE) de reconstruction de la sortie par couche. Les codebooks de quantification sont initialisés à l'aide d'une version efficace et basée sur les données de l'algorithme EM. Les codebooks sont ensuite mis à jour et davantage compressés en utilisant la quantification entière et la compression basée sur la décomposition en valeurs singulières (SVD). GPTVQ établit un nouvel état de l'art dans les compromis taille vs précision sur une large gamme de LLMs tels que Llama-v2 et Mistral. De plus, notre méthode est efficace : sur un seul H100, il faut entre 3 et 11 heures pour traiter un modèle Llamav2-70B, selon le paramètre de quantification. Enfin, avec des mesures de temps sur appareil pour la décompression VQ sur un CPU mobile, nous montrons que la VQ conduit à une latence améliorée par rapport à l'utilisation d'un format entier 4 bits.
English
In this work we show that the size versus accuracy trade-off of neural
network quantization can be significantly improved by increasing the
quantization dimensionality. We propose the GPTVQ method, a new fast method for
post-training vector quantization (VQ) that scales well to Large Language
Models (LLMs). Our method interleaves quantization of one or more columns with
updates to the remaining unquantized weights, using information from the
Hessian of the per-layer output reconstruction MSE. Quantization codebooks are
initialized using an efficient data-aware version of the EM algorithm. The
codebooks are then updated, and further compressed by using integer
quantization and SVD-based compression. GPTVQ establishes a new state-of-the
art in the size vs accuracy trade-offs on a wide range of LLMs such as Llama-v2
and Mistral. Furthermore, our method is efficient: on a single H100 it takes
between 3 and 11 hours to process a Llamav2-70B model, depending on
quantization setting. Lastly, with on-device timings for VQ decompression on a
mobile CPU we show that VQ leads to improved latency compared to using a 4-bit
integer format.