On the Intrinsic Robustness of NVM Crossbars Against Adversarial Attacks

Deboleena Roy, Indranil Chakraborty, Timur Ibrayev, Kaushik Roy

TL;DR

Researchers have discovered that the hardware "noise" inherent in analog Non-Volatile Memory (NVM) crossbars—usually considered a drawback for accuracy—actually acts as a natural shield against adversarial attacks. By inherently obfuscating gradients, these energy-efficient AI accelerators provide significant "intrinsic robustness" without the computational overhead of traditional software-based defenses.

What Problem Does This Paper Address?

As deep learning scales, traditional digital hardware hits the "von Neumann bottleneck," where moving data between memory and processors consumes massive amounts of energy. NVM crossbars (using technologies like RRAM or PCRAM) solve this by performing Matrix-Vector Multiplication (MVM) directly in memory using analog signals.

However, analog computing is messy. Factors like parasitic resistances and device variations introduce errors, causing the hardware's output to deviate from ideal mathematical values. While researchers usually focus on minimizing these "non-idealities" to preserve clean accuracy, this paper asks a provocative question: Can these hardware imperfections actually make neural networks harder to hack?

Methods

The authors evaluated Deep Neural Networks (DNNs) implemented on the PUMA architecture, a spatial NVM crossbar accelerator. To accurately simulate the messy reality of analog hardware, they used GENIEx, a machine-learning-based modeling technique that predicts crossbar output current based on non-ideal factors like wire resistance ($R_{wire}$) and source/sink resistance ($R_{source}$, $R_{sink}$).

Fig. 1: Illustration of NVM crossbar with various peripheral and parasitic resistances, which produces output current Ij, as a dot- product of voltage, Vi and device conductance, Gij

They tested the system against two main types of adversarial attacks:

  1. Projected Gradient Descent (PGD): A powerful gradient-based attack that requires knowing the model's internal "direction" of maximum error.
  2. Square Attack: A "black-box" attack that doesn't use gradients, instead relying on random search to find perturbations that fool the model.

They compared NVM's intrinsic robustness against standard defenses like Input Bit-Width Reduction and Stochastic Activation Pruning (SAP).

Datasets

The study utilized three standard image recognition benchmarks:

  • CIFAR-10: Evaluated using a ResNet-20 model.
  • CIFAR-100: Evaluated using a ResNet-32 model.
  • ImageNet: Evaluated using a ResNet-18 model (on a reduced set of 1000 images).

Key Insights and Ideas

  • Gradient Obfuscation by Default: Adversarial attacks rely on precise gradients to craft "perfect" perturbations. Because NVM non-idealities are non-linear and hard to model, they effectively "hide" the true gradients from the attacker, a phenomenon known as gradient obfuscation.
  • The "Push-Pull" Effect: There is a trade-off. Increasing the Non-ideality Factor (NF)—essentially making the hardware "noisier"—decreases the accuracy on clean images but significantly increases resilience against attacks.
  • Hardware Mismatch as a Defense: Even in "Hardware-in-Loop" adaptive attacks (where the attacker knows NVM is being used), the attack's effectiveness drops sharply if the attacker’s hardware model doesn't perfectly match the target's specific hardware parameters (like crossbar size or device resistance).
  • Zero-Cost Robustness: Unlike software defenses that require extra computations or specialized training, this robustness is a "free" byproduct of the physical hardware implementation.

Key Results

The study found that NVM crossbars offer substantial protection, especially in white-box scenarios where the attacker knows the model weights but not the hardware specifics.

  • White-Box PGD Attack: For CIFAR-10, the most non-ideal NVM model (64x64 crossbar, 100kΩ resistance) improved adversarial accuracy by 35.34% over ideal digital hardware at an epsilon of 1/255.
  • Resilience to Gradient-Free Attacks: The analog hardware showed its highest resilience against the Square Attack. For CIFAR-10, the robustness gain reached up to 64.50% compared to the baseline.
  • Scaling Robustness: As shown in the researchers' analysis, the absolute gain in adversarial accuracy generally increases with the Non-Ideality Factor (NF), though it eventually tapers off as the errors become too destructive to the underlying model performance.
Absolute Gain in Adversarial Accuracy vs. Non-Ideality Factor

Limitations and Future Work

The primary limitation is the clean accuracy drop. For example, on CIFAR-100, clean accuracy fell from 71.42% (digital) to 55.48% on the most robust NVM model. Finding the "sweet spot" where robustness is high but clean accuracy remains acceptable is a key challenge.

Future work could explore:

  • Technology-specific variations: How do different NVM types (like Spintronics) compare in terms of robustness?
  • Chip-to-chip variations: Can the unique physical "fingerprint" of each individual chip be used to make universal adversarial attacks even more difficult?
  • Hybrid Defenses: Combining these intrinsic hardware properties with existing algorithmic defenses for multi-layered security.

Summary updated

BibTeX
@inproceedings{roy2021intrinsic,
  author = {Deboleena Roy and Indranil Chakraborty and Timur Ibrayev and Kaushik Roy},
  title = {{On the Intrinsic Robustness of NVM Crossbars Against Adversarial Attacks}},
  booktitle = {DAC},
  year = {2021},
  doi = {10.1109/dac18074.2021.9586202},
}
Figure