Abstract
Computing-in-Memory (CiM) architectures based on emerging non-volatile memory (NVM) devices have demonstrated great potential for deep neural network (DNN) acceleration thanks to their high energy efficiency. However, NVM devices suffer from various non-idealities, especially device-to-device variations due to fabrication defects and cycle-to-cycle variations due to the stochastic behavior of devices. As such, the DNN weights actually mapped to NVM devices could deviate significantly from the expected values, leading to large performance degradation. To address this issue, most existing works focus on maximizing average performance under device variations. This objective would work well for general-purpose scenarios. But for safety-critical applications, the worst-case performance must also be considered. Unfortunately, this has been rarely explored in the literature. In this work, we formulate the problem of determining the worst-case performance of CiM DNN accelerators under the impact of device variations. We further propose a method to effectively find the specific combination of device variation in the high-dimensional space that leads to the worst-case performance. We find that even with very small device variations, the accuracy of a DNN can drop drastically, causing concerns when deploying CiM accelerators in safety-critical applications. Finally, we show that surprisingly none of the existing methods used to enhance average DNN performance in CiM accelerators are very effective when extended to enhance the worst-case performance, and further research down the road is needed to address this problem.
Introduction
Computing-In-Memory (CiM) using non-volatile memory (NVM) devices like RRAM or FeFETs represents a paradigm shift in AI hardware, slashing energy costs by performing computations directly within memory arrays. However, these physical devices are inherently imperfect. Fabrication defects and stochastic behaviors lead to "device-to-device" and "cycle-to-cycle" variations, meaning the weight programmed into a chip often deviates from the intended value.
While current research typically evaluates CiM robustness by looking at average performance across thousands of simulated chips, this metric is insufficient for safety-critical applications such as autonomous driving or medical diagnostics. In these fields, the "worst-case" performance is the critical benchmark. If even a single chip in a large deployment fails catastrophically due to a specific combination of hardware variations, the entire system is compromised. This paper addresses the challenge of identifying these rare but disastrous failure modes in high-dimensional weight spaces.
Methodology
Identifying the worst-case configuration among millions of weights is a "needle in a haystack" problem that standard random sampling (Monte Carlo) is mathematically ill-equipped to solve. To address this, the authors propose a formal optimization framework:
- Modeling Perturbation: Weight variations are modeled as additive noise ($\Delta W$) bounded by "write-verify" thresholds—a standard hardware technique used to constrain errors within a specific range (e.g., $\pm 0.03$).
- Differentiable Relaxation: Because finding the exact combination of variations that minimizes accuracy is a non-differentiable problem, the authors relax the objective into a differentiable, margin-based loss function.
- Gradient-Based Search: Instead of random guessing, the framework uses gradient descent to "attack" the weights. This systematically searches for the specific perturbation $\Delta W$ that causes the maximum accuracy drop while remaining within physical hardware bounds.
- Remedy Evaluation: The study tests whether existing robustness techniques—such as variation-aware training or adversarial training—can mitigate these worst-case failures.
Experimental Setup
The study evaluates several standard image classification benchmarks across diverse architectures to ensure the findings are robust:
- MNIST: LeNet architecture.
- CIFAR-10: Custom ConvNet and ResNet-18.
- Tiny ImageNet: ResNet-18.
- ImageNet: ResNet-18 and VGG-16.
Key Insights
The Failure of Monte Carlo
The most striking finding is the inadequacy of traditional testing. For a ResNet-18 model on CIFAR-10, 100,000 Monte Carlo runs suggested a worst-case accuracy of approximately 88%. However, the proposed gradient-based method identified a configuration within the same variation bounds that resulted in 0% accuracy. This demonstrates that standard simulations can provide a false sense of security.
"Confidently Wrong" Models
When a chip encounters a worst-case variation, it does not merely become uncertain; it becomes highly confident in its errors. In tests with LeNet, the worst-case configuration exhibited an average confidence of 0.90 on misclassified inputs, compared to only 0.47 on correct ones. This behavior is particularly dangerous for safety systems that rely on confidence scores to trigger fail-safes.
Structural Vulnerabilities
- Layer Sensitivity: Variations in convolutional layers and the final fully connected layer are significantly more likely to degrade accuracy than intermediate layers.
- Depth and Vulnerability: Deeper networks like ResNet are more susceptible than shallower architectures like LeNet. Small errors accumulate as they propagate through successive layers, leading to total accuracy collapse in complex models.
Results and Discussion
Accuracy Collapse
Under a standard variation bound of 0.03, the proposed search method drove the accuracy of ResNet-18 (CIFAR-10) and VGG-16 (ImageNet) to 0.00% and 0.06% respectively, despite original accuracies of 95% and 71%. This confirms that even tiny, industry-standard device variations can be disastrous.
Ineffectiveness of Current Remedies
Existing solutions proved insufficient for worst-case scenarios:
- Hardware Verification: To maintain an accuracy drop of less than 5% using only write-verify cycles, the programming time required would be commercially and practically prohibitive.
- Adversarial Training: While effective for simpler models like LeNet, it failed to protect complex models. For ResNet-18 on Tiny ImageNet, adversarial training only recovered a worst-case accuracy of 7.41%.
Search Efficiency
The proposed gradient-based search is orders of magnitude faster than simulation. For ResNet-18 on ImageNet, the search took approximately 48 hours, whereas 100,000 Monte Carlo runs would have required roughly 160 days of computation.
Conclusion
This research highlights a significant "remedy gap" in CiM development. Current software and hardware techniques optimized for average-case robustness are inadequate for the stringent requirements of safety-critical systems. Future work must focus on developing training algorithms that flatten the loss landscape relative to weight perturbations and exploring individual chip screening processes to ensure safety in high-stakes deployments.
Summary updated