---
title: "Bit-Flip Attack — paper by Rakin et al. (2019)"
description: "How Bit-Flip Attack finds vulnerable weight bits, why quantized networks can fail after few changes, and what the experiments establish."
canonical: "https://research.elamur.ai/free/en/papers/rakin-2019-bit-flip-attack-crushing-neural/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/rakin-2019-bit-flip-attack-crushing-neural/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2019](https://md.research.elamur.ai/free/en/papers/2019/) / Bit-Flip Attack: Crushing Neural Network With Progressive Bit Search

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

Paper · 2019 · Adnan Siraj Rakin, Zhezhi He and Deliang Fan

**Authors:** Adnan Siraj Rakin, Zhezhi He and Deliang Fan · **Year:** 2019 · **Venue:** IEEE/CVF International Conference on Computer Vision (ICCV) · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**268** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2981860227) · [IEEE/CVF International Conference on Computer Vision (ICCV)](https://openalex.org/S4363607764) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1903.12269)
- [DOI 10.1109/iccv.2019.00130](https://doi.org/10.1109/iccv.2019.00130)
- [arXiv 1903.12269](https://arxiv.org/abs/1903.12269)
- [OpenAlex](https://openalex.org/W2981860227)

Citations: OpenAlex, 2026-10-14.

## Deep dive: Bit-Flip Attack: Crushing Neural Network With Progressive Bit Search

How Bit-Flip Attack finds vulnerable weight bits, why quantized networks can fail after few changes, and what the experiments establish. · about 33 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

A neural network can keep receiving ordinary inputs while the stored values that govern its computation are quietly changed. This paper investigates that form of failure. Its focus is the integrity of network weights: the learned numerical parameters held in memory during inference. Instead of modifying an image to make it misleading, the attacker changes selected binary digits in the network itself. The resulting damage can affect classification across the evaluation dataset, rather than being confined to a specially constructed input.

The authors introduce Bit-Flip Attack, or BFA, and a search procedure called Progressive Bit Search, or PBS. The search combines gradients, which estimate how changes would affect a loss, with temporary experiments that measure the consequences of candidate changes. It first identifies promising bits within each layer, then compares the resulting damage across layers. The strongest candidate is retained, and the search continues from the altered network. The default procedure commits a single bit change in each iteration.

The central result concerns quantized networks, whose weights occupy a bounded range of fixed-point values. These are a more demanding target than floating-point networks because a flipped bit cannot produce the enormous numerical jump associated with an exponent change. Nevertheless, on ImageNet, the authors report that changing 13 weight bits in ResNet-18 takes top-1 accuracy from 69.8% to 0.1%. The network contains 93 million stored weight bits. Randomly changing 100 bits in its quantized weights produces less than 1% accuracy degradation in the reported comparison. The difference shows why deliberate selection matters: resistance to scattered accidental errors does not establish resistance to carefully chosen ones.

The experiments extend across image-classification architectures, datasets, weight precisions, and attack sample sizes. The attacker uses a small collection of images and the clean network’s outputs, rather than the training data or ground-truth labels. However, the attack assumes access to the network’s weights and gradients. The paper motivates the possibility of memory corruption through Row-Hammer, but its main contribution is an algorithm for choosing destructive changes, supported by simulated bit-flip experiments. It does not establish that an attacker can reproduce every chosen change on an arbitrary physical device.

The broader lesson is about the difference between numerical robustness and storage integrity. Quantization makes random corruption substantially less destructive in the authors’ experiments, yet it leaves a small set of highly consequential changes discoverable through search. The findings therefore support a specific conclusion: bounded weight values and strong clean accuracy do not, by themselves, protect a network against an informed adversary who can alter its stored parameters.

### Ideas worth borrowing

Gradient proposals, measured decisions. PBS uses gradients to narrow the search, then evaluates candidate changes through actual inference. This division is useful whenever a derivative provides a local approximation but the available intervention is discrete and potentially large. A bit cannot move an arbitrarily small distance; it must change to its other valid state. Measuring the resulting loss catches consequences that a local estimate may miss. The same pattern could guide experiments on discrete representations or constrained parameter edits: use a cheap sensitivity signal to propose candidates, then use the real objective to decide which proposal deserves commitment.

Search locally before comparing globally. The method separates the problem of finding a promising intervention inside a layer from the problem of choosing which layer to modify. This creates a manageable set of candidates without assuming that every layer behaves alike. The transferable idea is to respect a system’s internal grouping during candidate generation while preserving a common measurement for the final comparison. Researchers examining structured numerical systems could use an analogous arrangement to compare interventions across components that differ in size, scale, or function.

Distinguish operations from final damage. The paper reports both the number of performed flips and the Hamming distance between the final and original weight representations. These quantities answer different questions. An attack can revisit a bit and undo an earlier change, so the intervention history need not equal the final number of differing positions. This distinction is useful in any iterative editing procedure that permits reversals. Recording both quantities makes it possible to separate the cost of reaching a state from the amount of persistent alteration in that state.

Test informed corruption alongside random faults. Random bit changes provide a meaningful baseline, but they examine a different distribution of disturbances from an adversarial search. The paper’s quantized ResNet-18 comparison makes that distinction concrete: many randomly chosen changes can have little effect while a much smaller selected set causes widespread failure. Engineers can borrow the evaluation principle without adopting the attack itself. A reliability assessment should ask both how the system handles ordinary faults and how it handles changes concentrated on its most sensitive locations.

Evaluate damage beyond the search sample. PBS chooses changes using a small attack sample, while the experiments assess classification on the full evaluation dataset. This checks whether the selected corruption affects the network broadly rather than merely increasing loss on the examples used to find it. The general experimental pattern is valuable whenever a small collection of observations guides a system-level intervention. The search objective and the evaluation objective should be distinguished clearly, including any overlap between the data used for each.

Treat encoding as part of behavior. A stored parameter is not merely an abstract real number. Its representation determines which changes are physically expressible and how strongly each bit affects the decoded value. The paper makes this explicit by working through uniform quantization and two’s-complement encoding before defining the attack. That habit is useful in work on compression, deployment, and numerical reliability. Claims about parameter sensitivity become more informative when they account for the actual storage representation rather than assuming that all numerical perturbations have comparable meaning.

### How Mova uses it

For Mova, the small transparent language system written in Rust, the useful connection is an engineering question about stored numerical state. If a component relies on learned weights, lookup values, or another numerical representation, how much can behavior change when a small part of that representation is corrupted? The paper offers a way to think about that question precisely. It separates the allowed storage change, the method used to select it, and the behavioral measurement used to judge the consequence.

A possible Mova application would be controlled integrity testing of any quantized learned component it contains or later adopts. Such an experiment would need to state the storage format first, identify which bits belong to numerical parameters, and measure the effect of permitted changes on language-system behavior. The paper’s image-classification outcomes would not supply that measurement automatically. A language component would require an evaluation appropriate to its own function. This is a proposed use of the paper’s reasoning, not a claim that Mova already implements PBS or has reproduced BFA.

Transparency would be valuable in documenting the intervention. An experimental record could distinguish the original parameter representation, the positions changed, the decoded numerical consequences, and the resulting behavior. That would make a failure inspectable at both the storage and application levels. The paper’s distinction between flip count and final Hamming distance is particularly relevant here: a record of attempted changes should remain separate from a comparison of the initial and final states.

Rust is part of Mova’s implementation context, but this paper gives no basis for treating a programming language as protection against physical memory corruption. The failure under investigation occurs when stored parameter bits take different values. The relevant questions concern what numerical data the system trusts, which changes the evaluation permits, and how corruption is detected or reflected in behavior. No robustness claim for Mova follows merely from its implementation language or its small size.

The gradient-based part of PBS would apply only where a differentiable learned component supplies the necessary sensitivity information. It cannot simply be assigned to every transparent or symbolic component. The broader principle survives that boundary: concentrate testing on consequential internal changes, and verify their actual effects. If Mova uses components without suitable gradients, a different candidate-selection procedure would be needed, and the result should not be presented as the paper’s method.

The most useful adoption would therefore be a carefully bounded testing practice. Random fault injection could establish an ordinary-corruption baseline; an informed search could examine whether a few sensitive locations dominate the risk; and evaluation could reveal whether damage spreads beyond the examples used during search. None of those steps is established here as an existing Mova feature. They are concrete directions suggested by the paper, with applicability depending on Mova’s actual numerical components and evaluation tasks.

### The problem and its context

#### An attack on the computation’s stored rules

Much of the security discussion described by the authors concerns adversarial examples. An attacker changes an input by a constrained amount so that a network returns an incorrect answer. The learned weights remain intact. The paper instead asks what happens when the attacker changes those weights while leaving the incoming data ordinary.

The distinction matters because weights participate in many successive computations. They define how features are combined, how intermediate representations are transformed, and ultimately how a classification is produced. A persistent parameter change can therefore influence many inputs. The attack does not need to manufacture a separate distorted image for every evaluation example.

This is a security question within [machine learning](https://md.research.elamur.ai/free/en/concepts/machine-learning/), but it also depends on the computing system that stores and executes the network. The authors argue that parameter integrity had received less attention than input manipulation. They suggest that neural networks were often regarded as tolerant of parameter variation, while the computing platforms used to run them commonly included mechanisms intended to preserve data integrity. Those assumptions made weight corruption appear either unlikely or mainly a systems-security concern.

The deployment setting described in the paper challenges that separation. Compression and compact architectures allow neural networks to run on devices with tighter resource constraints. The authors associate those settings with weaker integrity checking and greater exposure to fault-injection techniques. Their concern is therefore not simply whether a mathematical function is stable under noise. It is whether the stored numerical description of that function can be altered in a damaging way.

#### From input perturbations to parameter perturbations

The paper draws on [Explaining and Harnessing Adversarial Examples](https://md.research.elamur.ai/free/en/papers/goodfellow-2014-explaining-harnessing-adversarial-examples/), especially the idea of using a loss gradient to choose a harmful direction. In an input attack, that direction guides changes to the example. In BFA, it guides changes to bits encoding the learned weights.

This borrowing does not make the objectives identical. An input-specific adversary can tailor a disturbance to a particular image. BFA applies a common altered parameter set across images. Its main experimental goal is broad classification collapse, not a separately optimized error for each input. That difference later explains why the authors use accuracy near the random-guess reference as their stopping criterion.

The paper also discusses defenses associated with [Towards Deep Learning Models Resistant to Adversarial Attacks](https://md.research.elamur.ai/free/en/papers/madry-2017-towards-deep-learning-models-resistant/). The connection is methodological: a training procedure can attempt to improve robustness by exposing the network to harmful perturbations. The authors investigate whether a related idea helps against weight-bit changes. Their negative observation is specific to the scheme they describe, rather than a demonstration that every possible robustness-oriented training procedure must fail.

#### Why stored bits are a plausible concern

Row-Hammer supplies the paper’s principal hardware motivation. As the authors describe earlier work, repeated memory accesses can disturb DRAM cells and induce bit changes. They cite research on profiling such behavior and directing it toward selected stored data. They also refer to attacks on defenses involving error correction and protected execution.

Those references establish the motivation for considering memory corruption an adversarial capability. They do not eliminate the distinction between finding a damaging mathematical intervention and realizing it physically. PBS addresses the former: given access to weights and gradients, which bit changes should an attacker prefer?

Earlier parameter attacks discussed in the paper include hardware trojans, attacks on bias terms, and faults affecting activation functions. A trojan may require hardware modification and a triggering input pattern. A bias attack changes a particular numerical term. An activation fault intervenes at another point in the computation. BFA’s emphasis is different: select changes in the binary storage of quantized weights to degrade the network’s general classification behavior.

The authors regard floating-point storage as an insufficiently demanding setting for this search problem. A floating-point value includes an exponent, and altering a high-significance exponent bit can radically change the represented magnitude. A resulting failure may therefore be explained by an enormous numerical excursion rather than by a subtle discovery about which bounded parameter changes matter.

Their own simulation makes this concern concrete. For floating-point ResNet-18 on ImageNet, they report that a single change to a highly significant exponent bit in a randomly selected weight can disable useful classification. That observation motivates a more constrained experiment rather than serving as the main achievement.

#### Quantization changes the question

Quantization maps weights onto a finite set of representable values. Here the storage uses signed integers with a shared scale for each layer. The magnitude of a decoded weight remains bounded by that representation, even after an individual stored bit changes.

The paper’s relationship to [DoReFa-Net](https://md.research.elamur.ai/free/en/papers/zhou-2016-dorefa-net-training-low-bitwidth/) concerns training with low-precision numerical representations and handling the nondifferentiable quantization operation. BFA adopts a uniform weight quantizer and uses a straight-through estimator during quantized training where retraining is performed.

With bounded values, a random bit change no longer has the exponent-based mechanism available in floating-point storage. The authors find that random changes in quantized ResNet-18 have comparatively little effect. This creates the central research question: can an informed search still locate a very small set of bounded changes that destroys classification?

Residual architectures provide an important experimental setting. The paper uses networks associated with [Deep Residual Learning for Image Recognition](https://md.research.elamur.ai/free/en/papers/he-2015-deep-residual-learning-image-recognition/) on both CIFAR-10 and ImageNet. It also evaluates AlexNet and discusses VGG16. These choices let the authors examine whether their attack is tied to a single architecture, although they do not constitute a comprehensive survey of possible network designs.

The contribution is thus best understood as a change in the unit of analysis. Rather than ask whether weights tolerate generic numerical noise, the paper asks whether the binary representation contains discoverable points of exceptional sensitivity. PBS is the proposed instrument for finding them.

### The method, step by step

#### Begin with a clean, quantized network

The starting point is an already functional image classifier whose weights have been quantized. The attack does not train a replacement classifier, change the task, or construct distorted evaluation images. It changes selected bits in the numerical representation used by the existing classifier.

The attacker obtains a small sample of images and records the clean network’s outputs for them. Those outputs become the targets used in the attack loss. This detail is important: the targets in the optimization are not the images’ ground-truth class labels. The search can therefore work without knowing the correct category of each sampled image.

The threat assumptions are nonetheless strong. The attacker can inspect the architecture and stored weights and calculate the required gradients. The paper classifies BFA as a white-box attack for this reason. Lack of access to training data does not turn it into a black-box procedure.

The overall search has a repeated proposal-and-evaluation structure:

Finding and committing destructive weight-bit changes The steps in order.

The distinction between a trial and a committed change is essential. During a search iteration, the procedure temporarily changes candidates in different layers. Each trial is evaluated and then undone. Only the winning layer’s selected changes persist into the next iteration.

#### State what is being maximized

The paper formulates the attack as an increase in inference loss relative to the original network:

```
maximize over {B̂ₗ}: ℒ(f(x; {B̂ₗ}ₗ₌₁ᴸ), t) − ℒ(f(x; {Bₗ}ₗ₌₁ᴸ), t)
```

Here x is the input, and t is the target obtained from the clean network. The function f denotes the network’s computation. The symbol ℒ is the loss comparing its output with t. Bₗ is the clean binary weight representation for layer l, while B̂ₗ is the perturbed version. L is the number of convolutional or fully connected layers considered by the attack. The expression asks for altered stored weights that increase loss as much as possible.

The permitted alteration is constrained by a bit budget:

```
Σₗ₌₁ᴸ D(B̂ₗ, Bₗ) ∈ {0, 1, …, N_b}
```

The function D measures Hamming distance: how many corresponding bit positions differ between the perturbed and clean representations. N_b is the maximum allowed distance across the network. The summation collects differences from every attacked layer.

This constraint concerns the final representation, while an iterative algorithm also has a history of operations. A bit can change and later return to its initial value. The paper therefore reports a separate count of performed flips in its experiments. Keeping the mathematical budget distinct from the operational count prevents a misleading interpretation of how much persistent corruption remains.

For a fixed input and target, the clean-network loss in the objective is a reference value. The search acts through the perturbed network. Its practical task is not to inspect every permitted combination, which would be an enormous discrete search, but to find highly damaging combinations efficiently.

#### Convert weights into a bounded representation

The authors use a uniform quantizer independently for each layer. The stated step-size expression is:

```
Δwₗ = max(Wₗᶠᵖ) / (2^(N_q − 1) − 1)
```

Wₗᶠᵖ is the layer’s floating-point weight tensor. N_q is the weight bit-width, and Δwₗ is the spacing between neighboring quantization values. The maximum operation is applied to the original layer weights as written in the paper. The scale is shared by the weights in that layer.

The quantized numerical weights are then expressed as:

```
Wₗ = round(Wₗᶠᵖ / Δwₗ) · Δwₗ
```

Wₗ denotes the quantized weights after restoring the layer’s scale. The round operation chooses a nearby integer after division by Δwₗ. Multiplying by the scale maps that integer back into the numerical range used for computation.

The authors describe symmetric quantization with a number of levels determined by the selected precision:

```
number of quantization levels = 2^N_q − 1
```

N_q again denotes the number of stored bits per weight. This expression describes the quantizer’s stated set of levels. It should be distinguished from the full set of binary patterns available in a signed storage word.

The memory representation stores the integer part associated with each weight, while the layer uses its common scale to recover numerical values. As a consequence, the attacker’s direct objects are the integer-encoding bits, not independent floating-point values with separately adjustable exponents.

Rounding produces a staircase-shaped mapping instead of an ordinarily differentiable function. For training the quantized networks, the paper uses a straight-through estimator, following earlier low-precision work. Its role is to allow gradient-based training despite that discontinuity. The attack’s gradient calculation is discussed separately: the authors say that inference uses the quantized weights directly after training.

#### Understand what a stored bit means

The signed integers use two’s-complement encoding. For an individual weight, the paper writes the decoded integer as:

```
w / Δw = g(b) = −2^(N_q − 1) · b_(N_q−1) + Σᵢ₌₀^(N_q−2) 2^i · b_i
```

The symbol w denotes the weight’s numerical value, and Δw is its layer’s scale. The vector b contains its stored bits. The bit b_(N_q−1) is the highest-significance position and carries the negative coefficient. Each b_i in the summation has a positive coefficient determined by its position. The function g converts the binary representation into the signed integer associated with the weight.

This equation explains why the storage format belongs inside the attack definition. Different bit positions have different numerical influence. A high-significance position can cause a larger decoded change than a low-significance one. The sign-bearing position also has a different algebraic role from the others.

Yet bit significance is not the whole vulnerability measure. A numerically large change in an unimportant weight may have less effect than another change in a sensitive part of the computation. PBS combines the representation’s numerical consequences with the network’s current loss sensitivity.

The bounded format also clarifies what the attack does not require. It need not create an unbounded weight, manipulate a floating-point exponent, or introduce a value outside the representable signed-integer word. Destructive behavior can arise from valid encoded values.

#### Calculate a direction for each bit

The attack obtains gradients with respect to the binary weight variables:

```
∇ᵦℒ = [∂ℒ/∂b_(N_q−1), …, ∂ℒ/∂b_0]
```

The vector ∇ᵦℒ contains the loss derivative associated with each bit position in b. A positive derivative indicates a locally loss-increasing direction toward a larger bit value; a negative derivative indicates the opposite direction.

This is a local approximation to the network’s response. A derivative describes sensitivity around the present numerical state, while an actual bit flip is a discrete intervention. The later trial evaluation is therefore important: it measures what the proposed change really does.

A direct adaptation of a gradient-sign update would be:

```
b̂ = b + sign(∇ᵦℒ)
```

The symbol b̂ denotes a proposed changed bit vector. The sign function returns the direction of each gradient. This equation is presented in the paper as a naive update, not the valid final operation.

The problem is that a bit has only its binary states. Adding a positive direction to a bit that is already set cannot produce another valid bit through ordinary addition. Likewise, subtracting from a cleared bit leaves the permitted range. The procedure must take the present state into account.

#### Use a mask to preserve valid binary values

The authors define a mask that compares the current state with the state favored by the gradient sign:

```
m = b ⊕ (sign(∇ᵦℒ) / 2 + 0.5)
```

The symbol m is a binary mask, and ⊕ denotes bitwise exclusive-or. The arithmetic expression converts the gradient sign into a preferred binary state. Exclusive-or then indicates whether the current bit differs from that preferred state.

The actual change is:

```
b̂ = b ⊕ m
```

The resulting b̂ remains a valid binary vector. A selected position changes only when its current state permits movement in the loss-increasing direction indicated by the gradient.

For a positive derivative, a cleared bit can be set. If that bit is already set, the operation leaves it alone. For a negative derivative, a set bit can be cleared, while an already cleared bit remains unchanged. This accounts for both direction and feasibility.

The mask should not be confused with the candidate-selection mechanism. Ranking decides which positions the procedure considers. Masking decides whether the proposed direction corresponds to a valid change at those positions. Together, they turn a continuous sensitivity signal into an admissible discrete intervention.

#### Search for candidates inside a layer

At each iteration, PBS computes gradients for the current perturbed network. The default number of candidate bits is denoted n_b and is set to 1. More generally, the paper describes selecting n_b positions within a layer.

The candidate-selection expression is:

```
v̂ₗ^(k−1) = Top_(n_b)(|∇_(B̂ₗ^(k−1)) ℒ(f(x; {B̂ᵣ^(k−1)}ᵣ₌₁ᴸ), t)|)
```

The index k denotes the attack iteration. B̂ₗ^(k−1) is the stored representation of layer l before that iteration’s committed change. The index r ranges over all layers inside the network evaluation. Absolute-value bars indicate gradient magnitude. Top_(n_b) returns the locations of the highest-ranked candidate bits, and v̂ₗ^(k−1) identifies those selected positions.

The location interpretation matters. This operation does not replace stored weights with gradient values. It identifies addresses within the weight representation where the bit operation will be tried.

Ranking by absolute gradient seeks positions with strong local sensitivity regardless of whether the damaging direction is towards a set or cleared bit. The mask then handles that direction. This separation allows both kinds of state change to participate in the search.

The selected positions are temporarily altered:

```
v̂ₗ^k = v̂ₗ^(k−1) ⊕ m
```

Here v̂ₗ^k refers to the trial state of the selected layer positions, and m is the feasible-change mask. The rest of the network stays at the current iteration’s starting state.

The procedure evaluates the trial through inference:

```
ℒₗ^k = ℒ(f(x; B̂ₗ^k, {B̂ᵣ^(k−1)}ᵣ≠ₗ), t)
```

The value ℒₗ^k is the loss obtained when only layer l carries that candidate intervention. The notation makes explicit that all other layers retain their previous states. This is the measured outcome used in the subsequent comparison.

After recording the loss, the procedure restores the trial bits. Restoration ensures that another layer’s candidate is tested from the same starting network. Without this step, the comparisons would mix different accumulated changes and would no longer isolate the effect of each layer’s proposal.

#### Compare layers and retain the strongest trial

Once every layer has supplied a candidate and a measured loss, PBS selects the layer associated with the largest loss:

```
j = argmaxₗ {ℒₗ^k}ₗ₌₁ᴸ
```

The symbol j is the winning layer index. The argmax operation returns the index of the largest recorded trial loss. Because every trial starts from the same network state, this comparison also identifies the largest measured increase among those candidates.

The winning intervention is then applied again and retained:

```
v̂ⱼ^k = v̂ⱼ^(k−1) ⊕ m
```

The symbols refer to the chosen positions in layer j. Unlike the earlier trial, this change is not immediately restored. It becomes part of the state used for the next iteration.

The network is now different, so the next search recalculates its sensitivities. This progressive adaptation is a central feature of PBS. The procedure does not select a fixed list of vulnerable bits once and then assume that their importance remains unchanged.

The search stops when it reaches the specified attack condition or iteration limit. In the main evaluations, the relevant condition is classification accuracy close to the dataset’s random-guess reference. The loss drives the search; evaluation accuracy determines whether the intended broad failure has occurred.

This method is a greedy, structured search rather than a solution guaranteed to find the globally best combination under the bit budget. Its empirical claim is that the combination of local ranking, measured cross-layer comparison, and repeated recalculation discovers highly destructive changes with very few committed flips.

### Experiments and results

#### What is measured

The experiments evaluate image classification on CIFAR-10 and ImageNet. Top-1 accuracy measures how often the highest-ranked predicted category is correct. The paper also presents top-5 accuracy and loss trajectories in its ImageNet figures. Its principal attack-efficiency measure is the number of bit flips required to reduce top-1 accuracy to a specified low threshold.

The attack targets the clean network’s outputs on a sampled collection of images, but the reported classification evaluation uses the dataset’s ground-truth categories. These are separate roles. The attacker need not receive the correct labels merely because the researchers use them to measure the consequences.

The paper runs each experimental configuration with 5 trials to account for randomness in choosing attack images. For the ImageNet table, it explicitly describes the reported flip count as the median across those trials. The evolution figures include shaded variability bands, but the text does not supply all the numerical values underlying those curves.

An additional metric compares the final binary representation with the original:

```
D_B = Σₗ₌₁ᴸ D(B̂ₗ, Bₗ)
```

D_B is the total Hamming distance. The function D counts differing bit positions within a layer, B̂ₗ and Bₗ are the perturbed and clean representations, and L is the number of considered layers.

The operational flip count, called N_flip, can exceed this final distance when a position is revisited. The paper says such reversals are uncommon in its experiments. For the ImageNet evolution curves it describes, no position is changed repeatedly, so the operational count and final distance coincide.

#### Datasets and preparation

CIFAR-10 contains 60K color images, each with spatial dimensions of 32×32. The authors use 50K images for training and 10K for testing. Its examples are evenly distributed across 10 categories. The default attack sample contains 128 images drawn from the testing portion.

For ImageNet, the paper describes 1.2M training images across 1000 categories. The default attack sample contains 256 validation images. The authors say their data augmentation follows the residual-network work they cite.

The experiments use different quantization preparation procedures for the datasets. On CIFAR-10, the authors retrain quantized residual networks. On ImageNet, they directly quantize pretrained networks to 8-bit weights without retraining. They justify the latter choice by the small observed accuracy reduction at that precision and by the practical aim of evaluating several architectures quickly.

These procedures matter when interpreting comparisons. CIFAR-10 results concern networks trained with their low-precision representation taken into account. ImageNet results concern directly quantized pretrained networks. The attack works in both reported settings, but the experiments do not hold training procedure constant across datasets.

The attacker is assumed not to know the training collection, training algorithm, or training hyper-parameters. However, it can calculate gradients through the deployed network and inspect its parameters. The experiments therefore test a relatively limited data requirement inside a comparatively powerful access assumption.

#### CIFAR-10: failure across precisions and depths

The CIFAR-10 evaluation uses ResNet-20, ResNet-32, ResNet-44, and ResNet-56. Each is considered with 4/6/8-bit weight quantization. The authors report that quantization by itself causes little accuracy loss, and in some cases the quantized network performs better than its floating-point counterpart.

Their suggested explanation is regularization from quantization noise when the original training is prone to overfitting. That is an interpretation of the clean-accuracy behavior, not an independently isolated causal finding.

For the attack, the stopping threshold is top-1 test accuracy below 11%. The random-guess reference for CIFAR-10 is 10%. The slightly higher stopping threshold provides an operational definition of near-chance classification rather than requiring the search to land at an exact accuracy value.

The authors report that the required number of flips is generally below 20 across the tested architectures and precisions. The available discussion does not provide every individual table entry, so it supports that overall observation without permitting a detailed numerical ranking of all settings.

They also find no clear relationship between quantization bit-width and the number of changes needed for collapse. This is distinct from their comparison of random corruption in floating-point and fixed-point storage. Quantization can remove the easy exponent-based failure mechanism without producing a simple ordering of resistance to informed attacks among the tested fixed-point precisions.

The CIFAR-10 results therefore support breadth within a defined family of experiments. BFA is not effective only at a particular tested precision or residual-network depth. They do not establish that every architecture or every quantization scheme has the same vulnerability.

#### ImageNet: selected changes versus a large storage representation

The ImageNet evaluation includes AlexNet, ResNet-18, ResNet-34, and ResNet-50. The reported quantization-related reduction in top-1 accuracy is approximately 0.1-0.4 %. Thus the networks remain useful classifiers before the attack.

For ImageNet, the operational attack threshold is accuracy below 0.2%. The random-guess reference is 0.1%, reflecting the dataset’s 1000 categories. As with CIFAR-10, the threshold defines a practical endpoint near that reference.

ResNet-18 supplies the paper’s clearest before-and-after example:

ResNet-18 on ImageNet, top-1 accuracy before and after attack Selected weight-bit changes reduce classification accuracy to the random-guess reference.

**The numbers**

| System or setting | top-1 accuracy % |
| --- | --- |
| Before attack | 69.8 |
| Bit-Flip Attack (this paper) | 0.1 |

The lower direction in this chart describes the attacker’s objective. For ordinary classification use, the clean network’s higher accuracy is the desirable behavior.

The authors attribute this collapse to 13 selected bit changes in a representation containing 93 million weight bits. The result demonstrates that the fraction of storage left unchanged is an inadequate measure of functional similarity. A representation can remain almost entirely identical at the bit level while its classification behavior changes radically.

AlexNet requires 17 flips in the reported median across 5 trials, from a weight representation described as 480 Million bits. For ResNet-50, the authors report failure after 11 changes among 200 Million bits. These examples show that larger total storage does not necessarily imply a larger required intervention count.

The authors also describe the residual networks’ accuracy curves as falling more sharply than AlexNet’s. They suggest that architectural differences, including residual connections, may contribute to the response. The evidence establishes a difference among the tested networks; it does not isolate residual connections as the sole cause.

Within their residual-network observations, the authors report that increasing parameter count accompanies fewer required changes. This is a pattern in the evaluated settings, not a general scaling law. Architecture, training, and parameter count are not independently controlled well enough to turn that pattern into a universal prediction.

#### Why random changes are the decisive baseline

The most revealing baseline changes bits without the informed search. For 8-bit ResNet-18 on ImageNet, the paper reports that even 100 random changes cause less than 1% top-1 accuracy degradation. An earlier discussion gives 0.6% for the random-corruption comparison.

These statements show the small effect of that baseline without supplying a complete numerical curve. They should not be treated as enough information to reconstruct every intermediate accuracy value.

Against that baseline, the 13-change BFA result demonstrates the value of selection. The destructive outcome is not explained simply by a fixed-point network being unable to tolerate any alteration. Many randomly chosen changes leave it mostly functional. PBS instead identifies a sequence that concentrates damage.

The floating-point comparison answers a separate question. A randomly selected weight can become disastrous if the change is directed at a highly significant exponent position. That experiment shows why the authors avoid presenting arbitrary floating-point corruption as the difficult search task. Its mechanism differs from the bounded changes that define the main study.

The main numerical conclusion is therefore conditional but strong: in these quantized image classifiers, a search informed by internal sensitivity can find interventions that are dramatically more damaging than the reported random baseline. The experiments do not require a claim that all small disturbances are dangerous, nor do they show that any attacker can locate the same changes without internal access.

### What the ablations show

#### Attack sample size has a nonmonotonic effect

The sample-size study uses ResNet-18 on ImageNet and examines attack samples of 16/32/64/128/256 images. The authors track both classification accuracy and loss, distinguishing quantities measured on the attack sample from those measured during validation.

Their reported ordering places the sample size of 128 first, followed by 32, then 256, then 64, and finally 16. In that comparison, stronger performance means more effective degradation during the attack, rather than better classification.

This ordering rules out a simple interpretation that providing more attack images always improves the search. The largest tested sample is not the strongest setting. Nor does the smallest sample produce the best result merely because it is easier to optimize.

The paper notes that the sample size of 128 requires the fewest flips to reach 10% accuracy in this analysis. That intermediate accuracy target should be kept distinct from the below-0.2% endpoint used for the main ImageNet attack reporting. A statement about reaching the former does not automatically provide the exact count needed for the latter.

The authors propose a balance between representativeness and optimization difficulty. A very small sample may fail to reflect the broader evaluation set. A large collection may make it harder for a discrete intervention to raise the loss effectively across its examples. These explanations are plausible readings of the observed curves, but the experiment does not separately manipulate or measure those proposed mechanisms.

The most secure conclusion is narrower: sample size matters, yet the attack remains effective across the tested range, and its behavior is not monotonically improved by adding more images. This supports the claim that a modest amount of unlabeled input data can guide damaging changes under the stated white-box assumptions.

#### Quantization helps against random corruption without defeating search

The random-bit experiment separates representation effects from selection effects. Floating-point storage admits exponent changes that can create extreme numerical values. Fixed-point storage constrains that mechanism. In the authors’ comparison, this makes random corruption much less destructive.

However, fixed-point storage does not neutralize informed selection. PBS remains effective against the quantized network. The study therefore exposes a gap between two forms of robustness: tolerating broadly scattered disturbances and resisting an adversary who concentrates on sensitive locations.

The precision comparison on CIFAR-10 adds another qualification. Across the tested 4/6/8-bit settings, the authors find no obvious ordering between bit-width and the attack’s required flip count. Reducing precision is therefore not demonstrated to provide a dependable defense against PBS.

This does not mean that numerical representation is irrelevant. Representation is crucial to the attack’s mechanics and to the dramatic floating-point versus fixed-point difference under random changes. It means that the tested fixed-point precisions do not produce a straightforward robustness rule for deliberate changes.

#### Layer restrictions probe where damage enters

The discussion includes an experiment on VGG16, associated with [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://md.research.elamur.ai/free/en/papers/simonyan-2014-very-deep-convolutional-networks-large/). The authors restrict the attacker so that only the initial layer can change, then perform the complementary experiment in which only the final layer is accessible.

They report that access to the initial layer produces a stronger attack. This supports their suggestion that disturbances introduced early can influence later computation as they propagate through the network.

A related observation concerns the unrestricted VGG16 attack on CIFAR-10. Of the 15 changes required to reach 10 percent accuracy, 9 occur within the first six layers. That concentration is consistent with the restricted-layer experiment.

The explanation remains architecture-dependent. The authors explicitly caution that a simple propagation account may not explain every network. They observe that changes in residual networks are distributed more evenly across layers. Thus “attack the earliest layer” is not established as a universal replacement for search.

The useful contribution of this analysis is to connect the discovered bits with network structure. It moves beyond reporting an endpoint and asks whether the locations of destructive changes reveal a pattern. The evidence suggests such a pattern for VGG16 while also showing why architectural generalization requires care.

#### Gradient handling is examined, but not exhaustively ablated

The authors discuss gradient obfuscation, where an attack’s gradient becomes an unreliable guide and apparent robustness can be misleading. Their quantized training uses an estimator through rounding, but they state that the attack computes sensitivity with respect to the quantized weights used directly in inference.

They argue that this avoids the particular difficulty associated with differentiating through the training quantizer. The successful attacks across the tested precisions provide practical evidence that their gradient signal remains useful in those settings.

That observation is not an exhaustive analysis of every possible source of misleading gradients. It supports the working effectiveness of PBS on the evaluated networks. It does not prove that any future quantized implementation would present equally informative gradients.

The paper also does not report a complete component-removal study separating every contribution of ranking, temporary loss evaluation, and cross-layer selection. Its strongest direct baseline is random bit selection. As a result, the evidence establishes the value of the combined search more clearly than the individual numerical contribution of each internal stage.

#### The attempted training defense does not solve the problem

The authors try a training scheme inspired by adversarial training. For each batch, they consider the original network and a version with a bit changed using BFA, then seek to reduce losses associated with both.

They report that this does not improve robustness against their attack. Their proposed explanation is the large set of possible bit locations: preparing for some harmful changes may leave other vulnerable positions available to a renewed search.

The result is informative because the defense engages the parameter-corruption threat rather than merely reusing an input-oriented evaluation. However, the paper does not provide enough detailed numerical reporting to compare alternative versions of such training or assess how sensitive the outcome is to its settings.

It is therefore evidence against the particular attempted defense, not a proof that robustness training cannot help. The same restraint applies to the precision analysis. The reported settings fail to establish a successful defense, but the space of possible defensive designs remains larger than the experiments.

### Limitations

#### The authors identify architectural and explanatory boundaries

The authors acknowledge that their explanation based on propagation and linearity may be too simple for complex network behavior. Their VGG16 observations favor early-layer sensitivity, while the distribution of changes in residual networks is less concentrated. They do not present a single theory that predicts vulnerable locations across architectures.

This matters because PBS is empirically effective even where the explanatory account remains incomplete. A search procedure can find destructive changes without providing a full causal theory of why those changes dominate. The paper demonstrates the phenomenon more firmly than it explains every architectural difference.

The authors also frame their defensive investigation as an unsuccessful attempt rather than a completed solution. Their discussion of training and precision motivates further work, but it does not supply a demonstrated general defense.

Another boundary they discuss concerns the attack endpoint. BFA changes the network once for many inputs, whereas an input-specific adversary can optimize a separate disturbance for each example. The authors therefore treat near-random accuracy as the relevant collapse condition. This distinction explains their evaluation choice; it should not be elevated into a mathematical lower bound on every possible parameter attack.

#### White-box access is a substantial assumption

A limitation visible in the experimental setup is the requirement for weight and gradient access. The attack does not show that an adversary restricted to ordinary input-output queries can recover the same vulnerable bits.

The lack of training-data access is meaningful, but it is only part of the threat description. The attacker still observes the deployed numerical system in enough detail to calculate sensitivities and test internal modifications. A reader should assess the result against that combined access profile.

Likewise, using clean outputs as targets removes dependence on ground-truth attack labels, but it does not remove dependence on representative inputs. The sample-size study shows that the chosen images influence search behavior. It does not establish that arbitrary inputs unrelated to the deployment distribution would work equally well.

The paper’s strongest claims therefore apply to an informed attacker with a small amount of relevant input data and extensive internal access. Broader attack settings would require separate evidence.

#### Search success and physical execution are different achievements

A further limitation follows from the relationship between PBS and Row-Hammer. The search identifies bit positions whose alteration would be damaging. A physical attack must also be able to induce the required changes in the actual memory arrangement.

The experiments described in the paper do not provide a complete hardware realization demonstrating that every selected transition can be caused on a deployed device. They do not report the physical effort required to place weights at suitable locations, induce each desired transition, or handle unsuccessful corruption attempts.

This does not weaken the mathematical observation that the stored representation has sensitive locations. It limits the operational conclusion. The paper establishes a vulnerability under a bit-alteration capability; it does not fully measure the difficulty of obtaining that capability in every practical environment.

The same distinction applies to earlier work on memory defenses cited by the authors. Those citations motivate concern about relying on general integrity mechanisms, but BFA’s experiments do not independently evaluate every such mechanism under the proposed search.

#### Near-chance accuracy does not specify the entire output behavior

The authors repeatedly describe successful attacks as making the network behave like a random output generator. The numerical support is classification accuracy close to a random-guess reference.

A careful reader should separate that metric from a claim about the full output distribution. Low accuracy alone does not establish that predictions are uniformly distributed across categories, independent across inputs, or generated by a random process. Different pathological behaviors can yield similarly poor aggregate accuracy.

The experiments show that useful classification has collapsed according to the reported metric. They do not characterize every statistical property of the damaged network’s predictions.

Nor do they demonstrate a targeted replacement behavior. The main objective is general degradation. The paper does not show that the same procedure can make selected inputs receive a chosen category while preserving ordinary accuracy elsewhere.

#### The evaluation overlap limits the generalization claim

The authors evaluate on the full test or validation set, including the images used to guide the attack. They explicitly explain this choice by the small size of the attack sample relative to the full evaluation collection.

The resulting measurement is broader than attack-sample loss alone, and the severe overall collapse is informative. Nonetheless, it is not evaluation on a completely disjoint set of images. That is a methodological limit visible in the setup.

A stricter separation could ask how well selected changes transfer to an untouched evaluation collection. The paper’s design does not supply that fully separated estimate, so its generalization claim should remain tied to the reported evaluation procedure.

The use of 5 trials also provides only a limited view of variability. It is enough to show repeated experiments and permit the reported median, but it does not characterize all possible image samples or every possible search trajectory.

#### The experiments cover a defined technical setting

The study concerns image classifiers with the specified weight encodings and quantization procedures. Its success across several architectures supports more than a single-network anecdote, yet it does not demonstrate identical behavior in every learned system.

In particular, the paper supplies no direct experiment on language processing, Mova, or arbitrary symbolic components. Applying its method elsewhere would require a compatible numerical representation, an accessible objective, and an appropriate behavioral evaluation.

The CIFAR-10 and ImageNet preparation procedures also differ. Retraining accompanies quantization in the former, while direct quantization is used in the latter. This makes the study practically broad but limits causal comparisons across datasets.

The search itself is greedy. It selects candidates from current gradients and retains the strongest measured layer trial. The experiments do not establish that the resulting sequence is globally minimal in flip count or optimal for a fixed Hamming budget.

Finally, the paper gives limited information about search cost relative to attack outcome. Very few committed changes can coexist with substantial computation spent testing candidates across layers. The reported efficiency is primarily efficiency in destructive bit changes, not a complete accounting of elapsed search time or physical attack effort.

### What came after

The paper ends by calling for further investigation of both parameter attacks and defenses. Its proposed research agenda follows directly from the experiments: determine which stored changes are dangerous, explain how their effects depend on architecture and representation, and find ways to preserve useful behavior under informed corruption.

No subsequent study is available in the later-work record associated with this article. There is therefore no supported basis for attributing a particular extension, defense, hardware realization, or later result to a named successor.

The contribution that remains clear is the experimental distinction BFA establishes. Random-fault tolerance does not settle the security of a learned parameter representation. A meaningful assessment must also consider whether an informed search can find a small, consequential set of changes—and must keep that algorithmic question separate from the physical feasibility of causing them.

## Cite

Cite as Adnan Siraj Rakin, Zhezhi He and Deliang Fan. 2019. Bit-Flip Attack: Crushing Neural Network With Progressive Bit Search. IEEE/CVF International Conference on Computer Vision (ICCV).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1109/iccv.2019.00130](https://doi.org/10.1109/iccv.2019.00130) · [arXiv 1903.12269](https://arxiv.org/abs/1903.12269)

```bibtex
@inproceedings{rakin2019bit,
  title = {{Bit-Flip Attack: Crushing Neural Network With Progressive Bit Search}},
  author = {Adnan Siraj Rakin, Zhezhi He and Deliang Fan},
  booktitle = {IEEE/CVF International Conference on Computer Vision (ICCV)},
  year = {2019},
  doi = {10.1109/iccv.2019.00130},
  eprint = {1903.12269},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/iccv.2019.00130}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
