MambaQuant: Quantizing the Mamba Family with Variance Aligned Rotation Methods

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Xu, Zukang, Yue, Yuxuan, Hu, Xing, Yuan, Zhihang, Jiang, Zixu, Chen, Zhixuan, Yu, Jiangyong, Xu, Chen, Zhou, Sifan, Yang, Dawei
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909533414096896
author Xu, Zukang
Yue, Yuxuan
Hu, Xing
Yuan, Zhihang
Jiang, Zixu
Chen, Zhixuan
Yu, Jiangyong
Xu, Chen
Zhou, Sifan
Yang, Dawei
author_facet Xu, Zukang
Yue, Yuxuan
Hu, Xing
Yuan, Zhihang
Jiang, Zixu
Chen, Zhixuan
Yu, Jiangyong
Xu, Chen
Zhou, Sifan
Yang, Dawei
contents Mamba is an efficient sequence model that rivals Transformers and demonstrates significant potential as a foundational architecture for various tasks. Quantization is commonly used in neural networks to reduce model size and computational latency. However, applying quantization to Mamba remains underexplored, and existing quantization methods, which have been effective for CNN and Transformer models, appear inadequate for Mamba models (e.g., Quarot suffers a 21% accuracy drop on Vim-T$^\dagger$ even under W8A8). We have pioneered the exploration of this issue and identified several key challenges. First, significant outliers are present in gate projections, output projections, and matrix multiplications. Second, Mamba's unique parallel scan further amplifies these outliers, leading to uneven and heavy-tailed data distributions. Third, even with the application of the Hadamard transform, the variance across channels in weights and activations still remains inconsistent. To these ends, we propose MambaQuant, a post-training quantization (PTQ) framework consisting of: 1) Karhunen-Loeve Transformation (KLT) enhanced rotation, rendering the rotation matrix adaptable to diverse channel distributions. 2) Smooth-Fused rotation, which equalizes channel variances and can merge additional parameters into model weights. Experiments show that MambaQuant can quantize both weights and activations into 8-bit with less than 1% accuracy loss for Mamba-based vision and language tasks. To the best of our knowledge, MambaQuant is the first comprehensive PTQ design for the Mamba family, paving the way for further advancements in its application.
format Preprint
id arxiv_https___arxiv_org_abs_2501_13484
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle MambaQuant: Quantizing the Mamba Family with Variance Aligned Rotation Methods
Xu, Zukang
Yue, Yuxuan
Hu, Xing
Yuan, Zhihang
Jiang, Zixu
Chen, Zhixuan
Yu, Jiangyong
Xu, Chen
Zhou, Sifan
Yang, Dawei
Machine Learning
Artificial Intelligence
Computation and Language
Mamba is an efficient sequence model that rivals Transformers and demonstrates significant potential as a foundational architecture for various tasks. Quantization is commonly used in neural networks to reduce model size and computational latency. However, applying quantization to Mamba remains underexplored, and existing quantization methods, which have been effective for CNN and Transformer models, appear inadequate for Mamba models (e.g., Quarot suffers a 21% accuracy drop on Vim-T$^\dagger$ even under W8A8). We have pioneered the exploration of this issue and identified several key challenges. First, significant outliers are present in gate projections, output projections, and matrix multiplications. Second, Mamba's unique parallel scan further amplifies these outliers, leading to uneven and heavy-tailed data distributions. Third, even with the application of the Hadamard transform, the variance across channels in weights and activations still remains inconsistent. To these ends, we propose MambaQuant, a post-training quantization (PTQ) framework consisting of: 1) Karhunen-Loeve Transformation (KLT) enhanced rotation, rendering the rotation matrix adaptable to diverse channel distributions. 2) Smooth-Fused rotation, which equalizes channel variances and can merge additional parameters into model weights. Experiments show that MambaQuant can quantize both weights and activations into 8-bit with less than 1% accuracy loss for Mamba-based vision and language tasks. To the best of our knowledge, MambaQuant is the first comprehensive PTQ design for the Mamba family, paving the way for further advancements in its application.
title MambaQuant: Quantizing the Mamba Family with Variance Aligned Rotation Methods
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2501.13484