Versatile Weight Attack via Flipping Limited Bits

Jiawang Bai, Baoyuan Wu, Zhifeng Li, Shu-Tao Xia

Abstract: To explore the vulnerability of deep neural networks (DNNs), many attack paradigms have been well studied, such as the poisoning-based backdoor attack in the training stage and the adversarial attack in the inference stage. In this paper, we study a novel attack paradigm, which modifies model parameters in the deployment stage. Considering the effectiveness and stealthiness goals, we provide a general formulation to perform the bit-flip based weight attack, where the effectiveness term could be customized depending on the attacker's purpose. Furthermore, we present two cases of the general formulation with different malicious purposes, i.e., single sample attack (SSA) and triggered samples attack (TSA). To this end, we formulate this problem as a mixed integer programming (MIP) to jointly determine the state of the binary bits (0 or 1) in the memory and learn the sample modification. Utilizing the latest technique in integer programming, we equivalently reformulate this MIP problem as a continuous optimization problem, which can be effectively and efficiently solved using the alternating direction method of multipliers (ADMM) method. Consequently, the flipped critical bits can be easily determined through optimization, rather than using a heuristic strategy. Extensive experiments demonstrate the superiority of SSA and TSA in attacking DNNs.

Introduction

As Deep Neural Networks (DNNs) are increasingly deployed in security-critical environments, understanding their vulnerabilities is paramount. Traditional security research has focused on adversarial attacks, which manipulate input data during inference, and backdoor attacks, which poison training data. This paper investigates a more insidious threat: the weight attack.

In a weight attack, the model is already trained and deployed. The attacker exploits physical hardware vulnerabilities—such as "Row Hammer" or laser-induced faults—to flip specific binary bits (0 to 1 or vice versa) in the device's RAM where model weights are stored. The primary challenge lies in identifying the "critical bits" that achieve a malicious goal with minimal impact on the model's overall performance, ensuring the attack remains stealthy.

The Weight Attack Paradigm

Illustration of the bit-flip weight attack and the two scenarios: Single Sample Attack (SSA) and Triggered Samples Attack (TSA).

Unlike previous methods that relied on heuristics or exhaustive searches, this work treats bit-flipping as a formal optimization problem. The authors propose a general framework that formulates the search for critical bits as a Mixed Integer Programming (MIP) problem. This approach allows for the optimization of two distinct malicious scenarios:

  1. Single Sample Attack (SSA): Flipping bits so that one specific, unmodified target image (e.g., a specific face) is misclassified.
  2. Triggered Samples Attack (TSA): Creating a "digital backdoor" where the model only misbehaves when a specific patch (trigger) is added to an image, while behaving normally on clean inputs.

Methodology: Optimization via ADMM

To solve the discrete and computationally difficult MIP problem, the researchers employ a sophisticated optimization technique called $\ell_p$-box ADMM. This method reformulates hard binary constraints into continuous ones that can be solved efficiently using gradient-based methods. This allows the attacker to identify the most vulnerable bits through direct optimization, ensuring high success rates with a remarkably low number of flips.

Experimental Results

The researchers evaluated their attacks on the CIFAR-10 and ImageNet benchmarks using popular architectures like ResNet and VGG. They specifically focused on quantized models (4-bit and 8-bit), which are common in edge devices and mobile hardware.

Comparison of SSA against baseline methods on CIFAR-10 and ImageNet. SSA achieves 100% ASR with the fewest bit flips.

Key Findings

  • Extreme Vulnerability: The most startling insight is how few bits need to change. On an 8-bit quantized ResNet-18 model using ImageNet, flipping an average of just 7.37 bits out of millions was sufficient to achieve a 100% attack success rate (ASR).
  • Stealthiness: The framework includes a stealthiness loss term, ensuring that the model's accuracy on normal images remains virtually unchanged (often less than a 0.1% drop), making the sabotage nearly impossible to detect through standard validation.
  • Superiority over Baselines: As shown in the performance tables, the proposed SSA consistently outperforms existing methods like T-BFA and GDA, requiring significantly fewer bit flips ($N_{flip}$) to reach a 100% ASR.
  • Defense Resistance: Even when models were trained with specialized defenses like "Piece-wise Clustering," the optimization-based attack remained effective, though it required a slightly higher number of flips to succeed.

Conclusion

This research demonstrates that DNNs are highly vulnerable to surgical bit-flip attacks in memory. By moving from heuristic guesses to a formal optimization framework, the authors show that an attacker can compromise a model's integrity with extreme precision. While executing these flips in hardware remains a complex engineering challenge, the mathematical possibility highlights a critical need for hardware-level security and more robust model architectures in the AI deployment lifecycle.

Summary updated

BibTeX
@article{bai2022versatile,
  author = {Jiawang Bai and Baoyuan Wu and Zhifeng Li and Shu-Tao Xia},
  title = {{Versatile Weight Attack via Flipping Limited Bits}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2022},
  url = {https://openreview.net/forum?id=euBa8_uhhG},
}
Figure