ChatPaper.aiChatPaper

Q-Sparse: Tutti i Modelli Linguistici di Grande Dimensione Possono Essere Completamente Attivati in Modo Sparso

Q-Sparse: All Large Language Models can be Fully Sparsely-Activated

July 15, 2024
Autori: Hongyu Wang, Shuming Ma, Ruiping Wang, Furu Wei
cs.AI

Abstract

Introduciamo Q-Sparse, un approccio semplice ma efficace per l'addestramento di modelli linguistici di grandi dimensioni (LLM) con attivazione sparsa. Q-Sparse consente la completa sparsità delle attivazioni negli LLM, portando a significativi guadagni di efficienza durante l'inferenza. Questo risultato è ottenuto applicando la sparsificazione top-K alle attivazioni e lo stimatore diretto (straight-through-estimator) durante l'addestramento. I risultati chiave di questo lavoro sono: (1) Q-Sparse può raggiungere prestazioni paragonabili a quelle dei LLM di riferimento, pur essendo molto più efficiente in fase di inferenza; (2) Presentiamo una legge di scalabilità ottimizzata per l'inferenza di LLM con attivazione sparsa; (3) Q-Sparse è efficace in diversi contesti, tra cui l'addestramento da zero, il continuo addestramento di LLM preesistenti e il fine-tuning; (4) Q-Sparse funziona sia per LLM a precisione completa che per quelli a 1 bit (ad esempio, BitNet b1.58). In particolare, la sinergia tra BitNet b1.58 e Q-Sparse (che può essere integrata con MoE) fornisce le basi e un percorso chiaro per rivoluzionare l'efficienza, inclusi i costi e il consumo energetico, dei futuri LLM.
English
We introduce, Q-Sparse, a simple yet effective approach to training sparsely-activated large language models (LLMs). Q-Sparse enables full sparsity of activations in LLMs which can bring significant efficiency gains in inference. This is achieved by applying top-K sparsification to the activations and the straight-through-estimator to the training. The key results from this work are, (1) Q-Sparse can achieve results comparable to those of baseline LLMs while being much more efficient at inference time; (2) We present an inference-optimal scaling law for sparsely-activated LLMs; (3) Q-Sparse is effective in different settings, including training-from-scratch, continue-training of off-the-shelf LLMs, and finetuning; (4) Q-Sparse works for both full-precision and 1-bit LLMs (e.g., BitNet b1.58). Particularly, the synergy of BitNet b1.58 and Q-Sparse (can be equipped with MoE) provides the cornerstone and a clear path to revolutionize the efficiency, including cost and energy consumption, of future LLMs.
PDF233November 28, 2024