Bit-Flip Attack: Crushing Neural Network withProgressive Bit Search

Adnan Siraj Rakin, Zhezhi He, Deliang Fan

Abstract

This paper introduces the Bit-Flip Attack (BFA), a highly efficient method to compromise Deep Neural Networks (DNNs) by targeting weight bits in hardware memory. Using a novel Progressive Bit Search (PBS) algorithm, the attack identifies a minimal set of vulnerable bits that, when flipped via hardware exploits like Row-Hammer, can reduce a model's accuracy to near-zero. Experimental results on ImageNet demonstrate that flipping as few as 11 bits out of 200 million can completely disable a ResNet-50 model, highlighting a critical vulnerability in modern AI hardware security.

The Vulnerability of Quantized Weights

Most research into AI security focuses on adversarial examples—maliciously crafted inputs designed to fool a model. However, this research shifts the focus to the security of the model's parameters (weights) stored in hardware memory (DRAM). While previous work showed that flipping bits in floating-point models is relatively straightforward due to exponent sensitivity, modern efficient AI often uses quantized (fixed-point) weights. These models were previously thought to be more robust because their values are constrained. The authors demonstrate that even these "hardened" models can be crushed if an attacker targets specific bits using hardware vulnerabilities like Row-Hammer.

Progressive Bit Search (PBS)

The core of the attack is the Progressive Bit Search (PBS) algorithm. Since searching through millions of bits is computationally impossible, PBS uses a two-step gradient-based approach to identify the most sensitive bits in the network.

The PBS algorithm consists of an In-layer Search to find vulnerable bits and a Cross-layer Search to identify the layer with the maximum impact on loss.
  1. In-layer Search: It calculates the gradient of the loss function with respect to every bit in a layer. It then ranks bits by their gradient magnitude to find the most "sensitive" candidates.
  2. Cross-layer Search: It evaluates these sensitive bits across all layers of the network to identify the single bit that, when flipped, causes the maximum increase in classification error.

The attack is iterative: it finds the most vulnerable bit, flips it, and then repeats the process until the model's accuracy collapses.

Key Results and Evaluation

The researchers evaluated their attack on standard computer vision benchmarks, including CIFAR-10 and ImageNet, across various architectures like AlexNet and ResNet. The results are startlingly efficient: a ResNet-18 on ImageNet was "crushed" (accuracy dropped from 69.8% to 0.1%) with only 13 bit-flips out of 93 million bits. For ResNet-50, only 11 bit-flips were required.

Experimental results showing the number of flips (N_flip) required to degrade accuracy across different network depths and quantization levels (N_q).

As shown in the experimental data, the attack modifies roughly 0.000003% of the model's parameters to cause a total malfunction. Furthermore, the attack is practical in terms of data requirements; using a small "attack sample" of just 128 to 256 images is sufficient to identify the vulnerable bits.

Insights and Future Work

DNNs are vulnerable because they are highly linear; a small error injected into early layers is multiplied as it propagates, eventually overwhelming the final output. Quantization does not act as a shield because the gradient-based PBS algorithm effectively finds the specific bits that disrupt the model's logic.

While the current PBS algorithm requires "white-box" access to the model's architecture and weights, it exposes a significant security gap. Standard defenses like adversarial training fail because the search space for bits is too vast. Future work must focus on new data integrity checks in memory or specialized hardware-software co-designs to detect and prevent unauthorized bit-flips at the hardware level.

Summary updated

BibTeX
@inproceedings{rakin2019bit,
  author = {Adnan Siraj Rakin and Zhezhi He and Deliang Fan},
  title = {{Bit-Flip Attack: Crushing Neural Network withProgressive Bit Search}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00130},
}
Figure