arXiv(opens in a new tab)cs.CROct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.08739

BARE-AI: Bit-Flip Attack Resilience in AI Hardware through Built-in Performance Monitors

Habibur Rahaman, Swastik Bhattacharya, Sanjay Das, Kanad Basu, Swarup Bhunia

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Habibur Rahaman ID^{ID}, Student Member, IEEE, Swastik Bhattacharya ID^{ID}, Student Member, IEEE, Sanjay Das ID^{ID}, Student Member, IEEE, Kanad Basu ID^{ID}, Senior Member, IEEE Swarup Bhunia ID^{ID}, Fellow, IEEE

Abstract—Deep Neural Networks (DNNs) are now integral to a wide range of safety critical systems, yet they remain highly vulnerable to bit-flip attacks (BFAs), in which a small number of memory level perturbations can drastically degrade model accuracy. Existing defenses often incur significant hardware overhead, depend on retraining, or fail against targeted adversarial flips. We propose BARE-AI, a runtime framework that detects, localizes, and mitigates BFAs during AI inference. BARE-AI introduces AI Performance Counters (APCs), lightweight hardware monitors embedded in the accelerator datapath that capture fine grained per-layer activation statistics such as sparsity, entropy, kurtosis, and spectral shift. These statistics are analyzed by the Predictive Unit for Layer Security Evaluation (PULSE), a compact machine learning detector trained offline as an ensemble of classifiers and realized on-chip as a small neural engine. For explainability and recovery, BARE-AI introduces an Activation Shift Index (ASI) for layer level fault localization and a z-score based statistical repair that resets anomalous weights toward clean layer statistics. Across CNNs, Vision Transformers, and Large Language Models under random, targeted, adaptive, and magnitude based BFAs, BARE-AI achieves up to 98% detection accuracy on vision models and between 74% and 95% on language models, restores near clean accuracy for CNNs and ViTs, and provides partial recovery for LLMs. Synthesized in a 28nm technology node, the monitoring infrastructure incurs less than 3% energy overhead, less than 4% area overhead, and approximately 10% inference latency increase, with a configurable operating point that reduces latency overhead to about 6%. A key property of the design is that its cost is independent of attack strength: unlike error correcting codes, whose redundancy grows with the number of tolerated flips, the monitoring overhead of BARE-AI remains constant regardless of how many bits an adversary flips. These properties make BARE-AI attractive for resource constrained, safety critical edge applications such as autonomous systems, energy, and healthcare.

Index Terms—DNN, AI Performance Counters, Bit-Flip Attack, AI Safety, AI accelerators, hardware security, runtime monitoring.

I. INTRODUCTION

RAPID adoption of AI accelerators across emerging applications, spanning resource constrained edge devices to high performance cloud systems, has raised serious concerns about their security and reliability [1]. Although DNNs are widely deployed in safety critical settings, they are vulnerable to a broad class of adversarial manipulations. While much research has focused on input level threats such as evasion attacks, a more insidious threat lies in the manipulation of the model weights themselves. A particularly damaging class of such threats is the Bit-Flip Attack (BFA), which corrupts parameters stored in memory [2, 3, 4]. By flipping only a few bits in the model weights, an adversary can cause severe accuracy degradation or targeted misclassification [2]. Figure 1 illustrates the impact of a BFA in an autonomous driving system, where misclassification of a stop sign could trigger a catastrophic failure. For example, flipping just 13 bits out of 93 million in a quantized ResNet-18 reduced its top-1 accuracy from 69.8% to 0.1% [2]. Large language models (LLMs) are similarly exposed: single digit numbers of bit flips can collapse the performance of billion parameter models such as Llama-3.2-1B-Instruct [4]. Critically, these attacks leave no visible trace in the weight distribution; the model appears normal until the corruption manifests as failure.

Figure

Fig. 1: Effect of a Bit-Flip Attack (BFA) on DNN models used in safety critical applications. BARE-AI detects the attack at runtime, localizes the affected layers, and repairs corrupted weights using z-score based statistical correction.

Model parameters stored in DRAM or SRAM are vulnerable to diverse fault injection mechanisms, including Rowhammer induced charge leakage [5], laser injection [6], voltage glitching [2], and radiation induced upsets [6, 7]. Variants such as SledgeHammer [8] and RowPress [9] demonstrate that disturbance effects persist even in DDR4 systems, highlighting the fragility of DRAM [10, 11]. DNN accelerator parameters held in DRAM are therefore susceptible to BFAs triggered by these physical fault injection methods [12], a threat intensified by nanoscale variability, reduced noise margins, and limited ECC protection [13]. Attackers exploit these weaknesses with

H. Rahaman and S. Bhunia are with the Department of Electrical and Computer Engineering, University of Florida, Gainesville, FL, 32611, USA. (e-mail:rahaman.habibur@ufl.edu, swarup@ece.ufl.edu).

S. Bhattacharya and S. Das are with the Department of Electrical and Computer Engineering, University of Texas at Dallas, Richardson, TX, 75080, USA. (e-mail: SwastikBimal.Bhattacharya@UTDallas.edu, sanjay.das@UTDallas.edu).

K. Basu is with the Department of Electrical, Computer and Systems Engineering, Rensselaer Polytechnic Institute, Troy, NY, 12180, USA. (e-mail: basuk@rpi.edu).

The authors declare conflict of interest with all faculties from the University of Texas at Dallas, Rensselaer Polytechnic Institute and University of Florida.

deliberate techniques such as voltage or clock faulting and electromagnetic interference [14], often combined with targeted search strategies like Progressive Bit Search [2, 15]. The threat is exacerbated in edge devices, which lack hardware redundancy, and in cloud settings, where Rowhammer can be launched from co-located virtual machines [16]. These attacks exploit an asymmetry of memory level faults: microscopic perturbations propagate across layers into catastrophic misbehavior, motivating lightweight runtime anomaly detection.

Existing defenses against BFAs differ in methodology, merits, and limitations. Hardware methods such as ECC and redundancy mitigate random faults but fail against adversarial flips and incur substantial power, latency, and area cost [15, 17]. Training time defenses such as BFAT [3] improve robustness through weight corruption during retraining, but cannot detect or localize inference time faults and weaken under targeted or adaptive attacks. Software level methods, including weight randomization, memory layout obfuscation [18], and weight reconstruction [19], offer partial protection but require retraining, prior knowledge of attack locations, or system changes, limiting runtime applicability. Alternatives such as binarized networks [20] improve resilience at the cost of accuracy and generality. Most existing defenses suffer from performance, scalability, or deployment limitations [6].

Figure

Fig. 2: BARE-AI framework, showing how APCs and PULSE integrate into an AI accelerator. The APC captures operational traces, which are processed by PULSE; the ASI analyzer identifies the layers with the largest deviation and directs z-score based weight correction.

Given these limitations, a practical defense should provide (i) runtime detection, (ii) attack agnostic applicability, and (iii) low computational overhead whose cost does not grow with attack strength. To address this, we propose BARE-AI, a lightweight runtime defense framework that performs behavioral monitoring of DNNs through dedicated hardware counters. DNN accelerators depend on memory devices such as DDR4 for continuous parameter supply, tightly coupling their performance and security to memory integrity. Figure 2 shows the block diagram of BARE-AI, which integrates an AI Performance Counter (APC) block into an AI accelerator alongside an on-chip lightweight ML based analyzer called PULSE. The APC records low level operational traces of the AI hardware, which PULSE processes for detection. As Figure 2 indicates, DNN weights stored in DRAM are exposed to physical fault injection such as Rowhammer, laser, and electromagnetic interference [12]. Unlike weight inspection or retraining based methods, BARE-AI tracks runtime statistics such as activation sparsity, entropy, kurtosis, and cosine drift to detect malicious deviations.

The key insight behind BARE-AI is that, under normal conditions, each layer of a neural network exhibits statistically consistent activation patterns. Even a single bit flip that does not collapse the model perturbs these activation distributions and inter-layer dependencies. To capture such anomalies, BARE-AI tracks the runtime metrics in Table I and constructs a behavioral signature of model execution. This signature is analyzed by PULSE, which distinguishes clean from tampered models. For explainability, BARE-AI employs the Activation Shift Index (ASI) for layer level attribution of attack effects and applies a z-score based restoration mechanism to recover compromised performance where possible.

The paper makes the following major contributions:

  • We present BARE-AI, a model agnostic, real time defense framework that unifies detection, localization, and mitigation of bit-flip attacks in a single hardware integrated pipeline, using activation level behavioral monitoring without weight inspection, retraining, or architectural modification of the DNN. In contrast to ECC based protection, whose redundancy grows linearly with the number of tolerated flips, the monitoring cost of BARE-AI is constant and independent of attack strength (Section V).

  • We formalize AI Performance Counters (APCs), a set of per-layer activation statistics realized as a configurable hardware counter block inside the accelerator datapath, and present the PULSE detection methodology, in which an offline trained ensemble is realized on-chip as a compact neural engine.

  • We develop the Activation Shift Index (ASI) for layer level fault localization and a z-score based mitigation technique that resets anomalous weights toward clean layer statistics while preserving benign parameters.

  • We evaluate BARE-AI across CNNs, Vision Transformers, and LLMs under random, targeted, adaptive, and magnitude based BFAs, including INT8 quantized settings, and characterize hardware cost through 28nm synthesis. We report both the strengths of the approach (near clean recovery for CNNs and ViTs, high detection rates) and its current limits (partial recovery for deep language models).

The remainder of the paper is structured as follows. Section II covers preliminaries and related work. Section III presents the methodology, including the threat model for the monitoring infrastructure itself. Section IV presents the experimental findings. Section V discusses BARE-AI in relation to existing defenses, and Section VI concludes the paper.

References (45)