CAR-SAM: Cross-Attention Reconstruction for Post-Training Quantization of the Segment Anything Model
Houji Wen, Jiangyong Yu, Dawei Yang, Jun Li
Abstract
Segment Anything Models (SAMs) are extensively used in computer vision for universal image segmentation, but deploying them on resource-constrained devices is challenging due to their high computational and memory demands. Post-Training Quantization (PTQ) is a widely used technique for model compression and acceleration. However, existing PTQ methods fail to consider the cross-attention architecture in the SAM decoder. This degradation primarily stems from the unique challenges posed by SAMs: (1) Attention dissipation, where the attention information in the decoder, which is crucial for representing segmentation masks, collapses into a diffuse and non-semantic form under low-bit quantization; and (2) Reconstruction oscillation, where bidirectional coupling within the two-way transformer introduces cross-branch error interference and destabilizes convergence. To tackle these issues, we propose CAR-SAM, a unified quantization framework tailored for SAMs. Firstly, to mitigate attention dissipation, we introduce MatMul-Aware Compensation (MAC) mechanism that transfers activation-induced quantization errors from MatMul to preceding linear weights. Secondly, to mitigate oscillation in decoder optimization, we develop a Joint Cross-Attention Reconstruction (JCAR) strategy that jointly reconstructs coupled attention branches, suppressing oscillatory behavior and promoting stable convergence. Extensive experiments show that CAR-SAM robustly quantizes SAM models down to 4-bit precision, surpassing existing methods by 14.6% and 6.6% mAP on SAM-B and SAM-L respectively.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e2c27f08-180d-40c9-a5f4-9c98e9d21492Builds on13
- Segment AnythingAlexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao et al.ICCV 2023 · 13,211 citations
- Learned Step Size quantizationSteven K. Esser, Jeffrey L. McKinstry, Deepika Bablani, Rathinakumar Appuswamy et al.ICLR 2020 · 1,037 citations
- Up or Down? Adaptive Rounding for Post-Training QuantizationMarkus Nagel, Rana Ali Amjad, Mart van Baalen, Christos Louizos et al.ICML 2020 · 816 citations
- BRECQ: Pushing the Limit of Post-Training Quantization by Block ReconstructionYuhang Li, Ruihao Gong, Xu Tan, Yang Yang et al.ICLR 2021 · 619 citations
- QDrop: Randomly Dropping Quantization for Extremely Low-bit Post-Training QuantizationXiuying Wei, Ruihao Gong, Yuhang Li, Xianglong Liu et al.ICLR 2022 · 248 citations
Related papers
- PTQ4SAM: Post-Training Quantization for Segment AnythingChengtao Lv, Hong Chen, Jinyang Guo, Yifu Ding et al.CVPR 2024 · 22 citations
- SAQ-SAM: Semantically-Aligned Quantization for Segment Anything ModelJing Zhang, Zhikai Li, Chengzhi Hu, Xuewen Liu et al.AAAI 2026 · 3 citations
- AHCPTQ: Accurate and Hardware-Compatible Post-Training Quantization for Segment Anything ModelWenlun Zhang, Yunshan Zhong, Shimpei Ando, Kentaro YoshiokaICCV 2025 · 3 citations
- QSCA: Quantization with Self-Compensating Auxiliary for Monocular Depth EstimationJincheol Yang, Jaemin Choi, Matti Zinke, Suk-Ju KangNeurIPS 2025 · 1 citation
- CBQ: Cross-Block Quantization for Large Language ModelsXin Ding, Xiaoyu Liu, Zhijun Tu, Yun Zhang et al.ICLR 2025 · 1 citation
