Nearest is Not Dearest: Towards Practical Defense against Quantization-conditioned Backdoor Attacks

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Li, Boheng, Cai, Yishuo, Li, Haowei, Xue, Feng, Li, Zhifeng, Li, Yiming
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910454396223488
author Li, Boheng
Cai, Yishuo
Li, Haowei
Xue, Feng
Li, Zhifeng
Li, Yiming
author_facet Li, Boheng
Cai, Yishuo
Li, Haowei
Xue, Feng
Li, Zhifeng
Li, Yiming
contents Model quantization is widely used to compress and accelerate deep neural networks. However, recent studies have revealed the feasibility of weaponizing model quantization via implanting quantization-conditioned backdoors (QCBs). These special backdoors stay dormant on released full-precision models but will come into effect after standard quantization. Due to the peculiarity of QCBs, existing defenses have minor effects on reducing their threats or are even infeasible. In this paper, we conduct the first in-depth analysis of QCBs. We reveal that the activation of existing QCBs primarily stems from the nearest rounding operation and is closely related to the norms of neuron-wise truncation errors (i.e., the difference between the continuous full-precision weights and its quantized version). Motivated by these insights, we propose Error-guided Flipped Rounding with Activation Preservation (EFRAP), an effective and practical defense against QCBs. Specifically, EFRAP learns a non-nearest rounding strategy with neuron-wise error norm and layer-wise activation preservation guidance, flipping the rounding strategies of neurons crucial for backdoor effects but with minimal impact on clean accuracy. Extensive evaluations on benchmark datasets demonstrate that our EFRAP can defeat state-of-the-art QCB attacks under various settings. Code is available at https://github.com/AntigoneRandy/QuantBackdoor_EFRAP.
format Preprint
id arxiv_https___arxiv_org_abs_2405_12725
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Nearest is Not Dearest: Towards Practical Defense against Quantization-conditioned Backdoor Attacks
Li, Boheng
Cai, Yishuo
Li, Haowei
Xue, Feng
Li, Zhifeng
Li, Yiming
Cryptography and Security
Computer Vision and Pattern Recognition
Model quantization is widely used to compress and accelerate deep neural networks. However, recent studies have revealed the feasibility of weaponizing model quantization via implanting quantization-conditioned backdoors (QCBs). These special backdoors stay dormant on released full-precision models but will come into effect after standard quantization. Due to the peculiarity of QCBs, existing defenses have minor effects on reducing their threats or are even infeasible. In this paper, we conduct the first in-depth analysis of QCBs. We reveal that the activation of existing QCBs primarily stems from the nearest rounding operation and is closely related to the norms of neuron-wise truncation errors (i.e., the difference between the continuous full-precision weights and its quantized version). Motivated by these insights, we propose Error-guided Flipped Rounding with Activation Preservation (EFRAP), an effective and practical defense against QCBs. Specifically, EFRAP learns a non-nearest rounding strategy with neuron-wise error norm and layer-wise activation preservation guidance, flipping the rounding strategies of neurons crucial for backdoor effects but with minimal impact on clean accuracy. Extensive evaluations on benchmark datasets demonstrate that our EFRAP can defeat state-of-the-art QCB attacks under various settings. Code is available at https://github.com/AntigoneRandy/QuantBackdoor_EFRAP.
title Nearest is Not Dearest: Towards Practical Defense against Quantization-conditioned Backdoor Attacks
topic Cryptography and Security
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2405.12725