SharQ: Bridging Activation Sparsity and FP4 Quantization for LLM Inference

Haoqian Meng, Yilun Luo, Yafei Zhao, Wenyuan Liu, Huaqing Zheng +2 more
6/25/2026
cs.LGcs.AI
quantization-pruning

Official code: actypedef/SharQ (15 stars, last commit 2026-05-19).

Abstract

Low-bit floating-point formats and semi-structured sparsity are increasingly supported by modern accelerators, yet combining them for LLM activation compression remains challenging: activations contain input-dependent outliers that dominate block scales in FP4 quantization, and directly applying N:M sparsity masks discards moderate values, coupling sparsification loss with quantization error. We introduce SharQ, a training-free inference method that bridges activation sparsity and FP4 quantization through an online sparse--dense decomposition. For each activation tensor, SharQ generates an input-adaptive N:M mask to extract an outlier-dominated sparse backbone, quantizes it to FP4, and defines a dense residual relative to the quantized sparse backbone rather than the unquantized sparse values. A sparse FP4 GEMM processes the backbone while a dense FP4 GEMM compensates for both mask-induced activation loss and sparse-path quantization error. The two paths share a single FP4 weight payload with path-specific scale views, and a fused preparation kernel absorbs mask generation, residual construction, and layer normalization into one operator. SharQ requires no calibration data, retraining, or model-specific tuning. Evaluated on Llama-3.1-8B, Qwen2.5-7B, Qwen3-30B-A3B, and Qwen3-VL-8B, SharQ recovers 43--63% of the NVFP4-to-FP16 accuracy gap across language and vision-language tasks, and generalizes across NVFP4, HiF4, and MXFP4 formats. On an RTX 5090, SharQ delivers 2.2--2.4$\times$ latency reduction over FP16 and 1.2--1.4$\times$ throughput improvement over FP8 in language model serving, and up to 1.58$\times$ speedup on Wan2.2-T2V-A14B video generation when combined with SageAttention. Our code is available at https://github.com/actypedef/SharQ.

View on arXivView PDF

Code Implementations(1)

actypedef/SharQOfficial100%

SharQ: Bridging Activation Sparsity and FP4 Quantization for LLM Inference

152C, C++Mar 26, 20265 months ago
blackwellllmllm-inferencenvfp4quantization+1 more

Similar Papers

Cite this paper

@article{meng2026sharq,
  title  = {SharQ: Bridging Activation Sparsity and FP4 Quantization for LLM Inference},
  author = {Haoqian Meng and Yilun Luo and Yafei Zhao and Wenyuan Liu and Huaqing Zheng and Xindian Ma and Peng Zhang},
  year   = {2026},
  eprint = {2606.26587},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.26587v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.26587.svg)](https://codeofpaper.com/paper/2606.26587)

Discussion