Bit-Flip Attack: Crushing Neural Network With Progressive Bit Search

Adnan Siraj Rakin, Zhezhi He, Deliang Fan

Abstract

As Deep Neural Networks (DNNs) transition from high-performance data centers to resource-constrained edge devices, they are frequently quantized into fixed-point integers to optimize memory and power consumption. This paper introduces the Bit-Flip Attack (BFA), a novel security threat that exploits hardware vulnerabilities like Row-Hammer to maliciously alter weight parameters in DRAM. By employing a Progressive Bit Search (PBS) algorithm, the authors demonstrate that flipping a minuscule fraction of bits—as few as 13 out of 93 million in a ResNet-18 model—can reduce ImageNet accuracy from 70% to 0.1%, effectively rendering the model useless. This research highlights a critical vulnerability in quantized DNNs, proving that even robust models are susceptible to surgical parameter tampering.

Introduction

Traditional AI security research has largely focused on adversarial examples—perturbing input data to deceive a model. However, the Bit-Flip Attack shifts the focus to the model's internal weights. With the rise of hardware-level exploits such as Row-Hammer, which allows unauthorized bit-flipping in memory, the integrity of stored model parameters is no longer guaranteed. This paper investigates how an attacker with "white-box" access can systematically identify and flip the most sensitive bits to maximize damage with minimal effort.

Methodology: Progressive Bit Search (PBS)

The core of the BFA is the Progressive Bit Search (PBS) algorithm. Unlike random or brute-force approaches, PBS utilizes the model's own gradients to pinpoint the most vulnerable bits. The search operates through two primary stages:

  1. In-layer Search: For every layer in the network, the algorithm calculates the gradient of the loss function with respect to each bit ($\partial \mathcal{L}/\partial b$). It identifies the bits that, when flipped, would yield the most significant increase in the overall network loss.
  2. Cross-layer Search: After evaluating individual layers, the algorithm compares potential candidates across the entire network architecture. It then selects and flips the single most impactful bit identified during that iteration.
The Progressive Bit Search (PBS) flowchart, detailing the iterative process of identifying vulnerable bits within and across layers.

This iterative process continues until the model's accuracy drops to a predefined target, such as 10% for CIFAR-10 (equivalent to random guessing) or 0.1% for ImageNet. By flipping bits in the direction of the gradient, the attack essentially "un-trains" the model with extreme efficiency.

Experimental Setup

The researchers evaluated the BFA across two major computer vision benchmarks:

  • CIFAR-10: 60,000 images across 10 classes.
  • ImageNet: 1.2 million images across 1,000 classes.

The attack was tested on several architectures, including AlexNet and various ResNet depths (ResNet-18, 20, 32, 34, 44, 50, and 56). To reflect real-world deployment scenarios, models were quantized to 4-bit, 6-bit, and 8-bit fixed-point integers.

Key Results and Insights

The findings reveal a startling level of vulnerability in modern DNNs. In one instance, modifying just 0.000003% of the bits in a ResNet-50 model caused a 63% drop in test accuracy.

Architectural Resilience and Quantization

Contrary to previous assumptions, quantization does not act as a shield. While fixed-point models lack the highly sensitive exponent bits of floating-point representations, the PBS algorithm still finds high-impact bits with ease. As shown in the experimental data, the number of flips required to crush a network remains remarkably low regardless of the quantization bit-width ($N_q$).

Performance of BFA across different ResNet architectures and quantization levels, showing the number of flips ($N_{flip}$) required to degrade accuracy.

The "Force Multiplier" Effect

The study found that attacking early layers is often more devastating than attacking later ones. Because DNNs are hierarchical and largely linear, small errors introduced in the initial layers are amplified as they propagate through the network, leading to catastrophic failure at the output.

Conclusion and Future Work

The Bit-Flip Attack demonstrates that DNN security requires more than just input-level defenses. While the current BFA requires white-box knowledge of the model, it sets a dangerous precedent for hardware-based AI attacks. Future research must focus on developing "parameter-robust" training methods and hardware-level protections, such as enhanced Error-Correcting Code (ECC) memory, to safeguard the integrity of AI systems in the wild.

Summary updated

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