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

- **ID:** 581
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2407.10969
- **Authors:** Hongyu Wang, Shuming Ma, Ruiping Wang, Furu Wei
- **Venue:** arXiv / Microsoft Research / University of Chinese Academy of Sciences
- **Published:** 2024
- **Tags:** q-sparse, activation-sparsity, top-k, ste, bitnet, block-sparsity, microsoft, inference-optimal-scaling
- **Topics:** activation sparsity, LLM inference, quantization
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/581

## Summary

Q-Sparse applies top-K (absolute-value) masks on activations of all linear layers, STE so non-selected grads are not zeroed, optional 8-bit quantized top-K, squared-ReLU/ReLU²GLU in FFNs, and Block Q-Sparse (N:M, e.g. 16:32) for batched GPU kernels. Inference-optimal sparsity ~45.58% full-precision (1.84× params at matched activated N_a) and ~61.25% for 1.58-bit. From-scratch 40% sparsity matches dense loss at the same size/tokens (RedPajama 50B). Continue-train Mistral-7B: 3.8B activated avg 63.7 vs dense 64.6 (ARC/HS/MMLU/WG/TQA); 2.9B 61.7, beating ReLUfication 60.8 and dReLU 61.0. Works with BitNet b1.58. No official code on abs.

## Attributes

- **Purpose:** Enable full activation sparsity in every linear projection via top-K sparsification and a straight-through estimator
- **Scale:** From-scratch 300M–7B, 50B RedPajama tokens. Continue-train Mistral-7B 40B FineWeb-Edu (10k updates, 4M tok/step). SFT Mistral-7B and Qwen1.5-7B on Open-Orca 1 epoch. Block Q-Sparse block size 32.
- **Time period:** 2024-07-15 (arXiv 2407.10969 v1); last revised 2024-07-24 (v3). Comment: Work in progress. HF paper publishedAt 2024-07-15.

## From the source (fetched 2026-10-03)

- **Published:** Jul 15, 2024 (arXiv)
- **Last revised:** Jul 24, 2024 (arXiv)
- **arXiv categories:** cs.CL, cs.LG (arXiv)
- **Author comment:** Work in progress (arXiv)
- **Citations:** 31 (2 influential) (Semantic Scholar)
- **References:** 30 (Semantic Scholar)

## Abstract

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.

## Research notes

- Primary: arxiv abs (cs.CL; also cs.LG). License: arXiv.org perpetual non-exclusive on HTML at check. Equal contrib Wang/Ma; corresponding Shuming Ma and Furu Wei (Microsoft Research). H. Wang and R. Wang at University of Chinese Academy of Sciences. No official code URL on abs (OpenReview version: “The code will be released”). Later github.com/ustcwhy/Q-Sparse not treated as abs-linked. HF paper page 23 upvotes; no linked models/datasets. Discord posted PDF. Trains on public RedPajama/FineWeb-Edu/Open-Orca rather than a new hosted corpus, so no datasets_local row. License field left blank per catalog convention.

## Cited by, within this collection

- [Sparser, Faster, Lighter Transformer Language Models](https://papers.projxon.ai/entries/528) (paper 2026, #528)

## Similar entries

- [BitNet a4.8: 4-bit Activations for 1-bit LLMs](https://papers.projxon.ai/entries/556) (paper, #556)
- [BitNet b1.58 2B4T](https://papers.projxon.ai/entries/586) (model, #586)
- [Optimizing Large Language Model Training Using FP4 Quantization](https://papers.projxon.ai/entries/565) (paper, #565)
- [AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration](https://papers.projxon.ai/entries/963) (paper, #963)
- [Disaggregated Quantization: Specializing LLM Prefill and Decode](https://papers.projxon.ai/entries/829) (paper, #829)
- [FlashHead: Efficient Drop-In Replacement for the Classification Head in Language Model Inference](https://papers.projxon.ai/entries/983) (paper, #983)
