BitNet a4.8: Ativações de 4 bits para LLMs de 1 bit
BitNet a4.8: 4-bit Activations for 1-bit LLMs
November 7, 2024
Autores: Hongyu Wang, Shuming Ma, Furu Wei
cs.AI
Resumo
Pesquisas recentes sobre Modelos de Linguagem de Grande Porte (LLMs) de 1 bit, como o BitNet b1.58, apresentam uma direção promissora para reduzir o custo de inferência dos LLMs mantendo seu desempenho. Neste trabalho, introduzimos o BitNet a4.8, que permite ativações de 4 bits para LLMs de 1 bit. O BitNet a4.8 emprega uma estratégia híbrida de quantização e esparsificação para mitigar os erros de quantização introduzidos pelos canais discrepantes (outliers). Especificamente, utilizamos ativações de 4 bits para as entradas das camadas de atenção e da rede *feed-forward*, enquanto esparsificamos os estados intermediários seguidos por uma quantização de 8 bits. Experimentos extensivos demonstram que o BitNet a4.8 alcança um desempenho comparável ao BitNet b1.58 com custos de treinamento equivalentes, sendo mais rápido na inferência ao habilitar *kernels* de 4 bits (INT4/FP4). Adicionalmente, o BitNet a4.8 ativa apenas 55% dos parâmetros e suporta cache KV de 3 bits, aumentando ainda mais a eficiência da implantação e inferência de LLMs em larga escala.
English
Recent research on the 1-bit Large Language Models (LLMs), such as BitNet
b1.58, presents a promising direction for reducing the inference cost of LLMs
while maintaining their performance. In this work, we introduce BitNet a4.8,
enabling 4-bit activations for 1-bit LLMs. BitNet a4.8 employs a hybrid
quantization and sparsification strategy to mitigate the quantization errors
introduced by the outlier channels. Specifically, we utilize 4-bit activations
for inputs to the attention and feed-forward network layers, while sparsifying
intermediate states followed with 8-bit quantization. Extensive experiments
demonstrate that BitNet a4.8 achieves performance comparable to BitNet b1.58
with equivalent training costs, while being faster in inference with enabling
4-bit (INT4/FP4) kernels. Additionally, BitNet a4.8 activates only 55% of
parameters and supports 3-bit KV cache, further enhancing the efficiency of
large-scale LLM deployment and inference.