QuEST: Addestramento stabile di LLM con pesi e attivazioni a 1 bit
QuEST: Stable Training of LLMs with 1-Bit Weights and Activations
February 7, 2025
Autori: Andrei Panferov, Jiale Chen, Soroush Tabesh, Roberto L. Castro, Mahdi Nikdan, Dan Alistarh
cs.AI
Abstract
Un approccio per ridurre i costi massicci dei grandi modelli linguistici (LLM) è l'utilizzo di rappresentazioni quantizzate o sparse per l'addestramento o il deployment. Sebbene i metodi di compressione post-addestramento siano molto popolari, la questione di ottenere modelli compressi ancora più accurati addestrandoli direttamente su tali rappresentazioni, cioè l'Addestramento Consapevole della Quantizzazione (QAT), è ancora aperta: ad esempio, uno studio recente (arXiv:2411.04330v2) ha individuato la "migliore" larghezza di bit con cui i modelli possono essere addestrati utilizzando QAT, rimanendo competitivi in termini di accuratezza rispetto alla precisione standard FP16/BF16, a 8 bit per pesi e attivazioni.
Avanziamo questo stato dell'arte attraverso un nuovo metodo chiamato QuEST, che è competitivo secondo il principio di Pareto con FP16, cioè fornisce una maggiore accuratezza con dimensioni di modello inferiori, addestrando modelli con pesi e attivazioni a 4 bit o meno. Inoltre, QuEST consente un addestramento stabile con pesi e attivazioni a 1 bit. QuEST raggiunge questo risultato migliorando due aspetti chiave dei metodi QAT: (1) quantizzazione accurata e veloce delle distribuzioni (continue) di pesi e attivazioni tramite normalizzazione di Hadamard e adattamento ottimale MSE; (2) un nuovo stimatore del gradiente di fiducia basato sull'idea di minimizzare esplicitamente l'errore tra il gradiente rumoroso calcolato su stati quantizzati e il gradiente "vero" (ma sconosciuto) a piena precisione. Gli esperimenti su architetture di tipo Llama mostrano che QuEST induce leggi di scaling stabili su tutta la gamma di precisioni supportate dall'hardware e può essere esteso a rappresentazioni sparse. Forniamo il supporto del kernel GPU mostrando che i modelli prodotti da QuEST possono essere eseguiti in modo efficiente. Il nostro codice è disponibile su https://github.com/IST-DASLab/QuEST.
English
One approach to reducing the massive costs of large language models (LLMs) is
the use of quantized or sparse representations for training or deployment.
While post-training compression methods are very popular, the question of
obtaining even more accurate compressed models by directly training over such
representations, i.e., Quantization-Aware Training (QAT), is still open: for
example, a recent study (arXiv:2411.04330v2) put the "optimal" bit-width at
which models can be trained using QAT, while staying accuracy-competitive with
standard FP16/BF16 precision, at 8-bits weights and activations.
We advance this state-of-the-art via a new method called QuEST, which is
Pareto-competitive with FP16, i.e., it provides better accuracy at lower model
size, while training models with weights and activations in 4-bits or less.
Moreover, QuEST allows stable training with 1-bit weights and activations.
QuEST achieves this by improving two key aspects of QAT methods: (1) accurate
and fast quantization of the (continuous) distributions of weights and
activations via Hadamard normalization and MSE-optimal fitting; (2) a new trust
gradient estimator based on the idea of explicitly minimizing the error between
the noisy gradient computed over quantized states and the "true" (but unknown)
full-precision gradient. Experiments on Llama-type architectures show that
QuEST induces stable scaling laws across the entire range of hardware-supported
precisions, and can be extended to sparse representations. We provide GPU
kernel support showing that models produced by QuEST can be executed
efficiently. Our code is available at https://github.com/IST-DASLab/QuEST.Summary
AI-Generated Summary