BitNet v2: Attivazioni Native a 4-bit con Trasformata di Hadamard per LLM a 1-bit
BitNet v2: Native 4-bit Activations with Hadamard Transformation for 1-bit LLMs
April 25, 2025
Autori: Hongyu Wang, Shuming Ma, Furu Wei
cs.AI
Abstract
L'implementazione efficiente di modelli linguistici di grandi dimensioni (LLM) a 1 bit è ostacolata dalla presenza di outlier nelle attivazioni, che complicano la quantizzazione a bassa larghezza di bit. Introduciamo BitNet v2, un nuovo framework che abilita la quantizzazione nativa delle attivazioni a 4 bit per LLM a 1 bit. Per affrontare gli outlier nelle attivazioni dell'attenzione e delle reti feed-forward, proponiamo H-BitLinear, un modulo che applica una trasformazione di Hadamard online prima della quantizzazione delle attivazioni. Questa trasformazione addolcisce le distribuzioni delle attivazioni, rendendole più simili a forme gaussiane, adatte per la rappresentazione a basso numero di bit. Gli esperimenti mostrano che BitNet v2, addestrato da zero con attivazioni a 8 bit, eguaglia le prestazioni di BitNet b1.58. In modo cruciale, BitNet v2 ottiene una degradazione minima delle prestazioni quando addestrato con attivazioni native a 4 bit, riducendo significativamente l'impronta di memoria e il costo computazionale per l'inferenza in batch.
English
Efficient deployment of 1-bit Large Language Models (LLMs) is hindered by
activation outliers, which complicate quantization to low bit-widths. We
introduce BitNet v2, a novel framework enabling native 4-bit activation
quantization for 1-bit LLMs. To tackle outliers in attention and feed-forward
network activations, we propose H-BitLinear, a module applying an online
Hadamard transformation prior to activation quantization. This transformation
smooths sharp activation distributions into more Gaussian-like forms, suitable
for low-bit representation. Experiments show BitNet v2 trained from scratch
with 8-bit activations matches BitNet b1.58 performance. Crucially, BitNet v2
achieves minimal performance degradation when trained with native 4-bit
activations, significantly reducing memory footprint and computational cost for
batched inference.Summary
AI-Generated Summary