about
Q-Sparse: All Large Language Models Can Be Fully Sparsely-Activated (arxiv.org)
5 points by quxinxin on Jul 19, 2024 | hide | past | pdf | discuss on HN

In plain words: During training, it keeps only the strongest few signals in each layer and zeroes the rest, using a trick that lets learning pass through the hard cutoff. The result matches normal models' quality while making inference much cheaper.

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

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. We also introduce Block Q-Sparse for batch training and inference. 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.

Hongyu Wang, Shuming Ma, Ruiping Wang, Furu Wei
arXiv:2407.10969 · cs.CL, cs.LG · submitted Jul 15, 2024 · updated Jul 24, 2024
abstract · pdf · html · Work in progress

add comment on HN