Papers
Topics
Authors
Recent
2000 character limit reached

FlipLLM: Scalable Bit-Flip Attack Framework

Updated 17 December 2025
  • The paper introduces FlipLLM, a framework that identifies minimal high-impact bit-flip sets causing catastrophic accuracy drops in large language and vision-language models.
  • It employs a two-phase approach combining sensitivity-guided layer pruning with Q-learning to efficiently navigate vast parameter spaces.
  • Empirical results demonstrate up to 2.5× faster discovery and effective hardware-level mitigation using targeted error correction strategies.

FlipLLM is a scalable, architecture-agnostic framework for identifying minimal, high-impact bit-flip sets capable of inducing catastrophic failure in LLMs and multimodal vision-LLMs (VLMs). FlipLLM formulates the bit-flip attack (BFA) discovery process as a sequential decision-making problem, utilizing sensitivity-guided layer pruning in conjunction with Q-learning. The framework efficiently navigates the vast parameter space and intricate interdependencies within modern foundation models, rapidly isolating vulnerable bits whose corruption can collapse model accuracy. FlipLLM further provides actionable insights into targeted hardware-level defense by localizing critical bit positions for selective error correction, closing the loop between offensive vulnerability discovery and robust deployment of generative AI models (Khalil et al., 10 Dec 2025).

1. Threat Model and Motivation

FlipLLM addresses hardware-level threats that exploit physical memory faults—such as Rowhammer or GPUHammer attacks—on modern foundation models deployed in shared cloud or edge environments. In this setting, an unprivileged co-tenant attacker can inject faults into DRAM or GPU memory containing 8-bit model weights, with no access to internal activations or language tokens. The attacker's objective is to induce maximal test-time performance degradation, subject to a constraint on the number of flipped bits, in order to evade detection. Notably, even an infinitesimal fraction of flipped bits (e.g., 5 out of 6.4×10¹⁰, or approximately 6.2×10⁻⁸%) can reduce the accuracy of an 8B-parameter LLaMA model from 69.9% to 0.2% (Khalil et al., 10 Dec 2025).

2. Algorithmic Framework

FlipLLM decomposes the intractable bit search space into a two-phase pipeline comprising sensitivity-guided pruning and Q-learning-driven refinement.

2.1 Sensitivity-Guided Layer Pruning

For each model layer ℓ, parameters WW^\ell are assigned a hybrid sensitivity score: S=αWN+(1α)WNS^\ell = \alpha\,|\nabla W_N^\ell| + (1-\alpha)\,|W_N^\ell| where WNW_N^\ell and WN\nabla W_N^\ell denote L2-normalized weights and gradients, and α[0,1]\alpha \in [0,1] tunes the balance between parameter magnitude and gradient salience. The most sensitive r% of parameters are identified via this score and subjected to Most Significant Bit (MSB) flipping; the layer \ell^* with the maximal accuracy drop under this perturbation is selected for further refinement (Khalil et al., 10 Dec 2025).

2.2 MDP Formulation and Reinforcement Learning

The search for the critical bit set is framed as a Markov Decision Process:

  • States sts_t: current MSB indices selected for flipping, initialized as s0=Ihybrids_0 = I_{\text{hybrid}} from the pruning phase.
  • Actions at{add,remove,shift}a_t \in \{\text{add}, \text{remove}, \text{shift}\}: respectively, add a new index, remove an existing one, or swap indices within the sensitive pool.
  • Transitions: deterministic application of ata_t to sts_t.
  • Rewards: rt=1acctmax(1,st+1)r_t = -\frac{1 - \text{acc}_t}{\max(1, |s_{t+1}|)} where acct\text{acc}_t is the model accuracy after flipping st+1s_{t+1}, encouraging minimal sets that deliver maximal performance loss.

The agent learns a Q-value function Q(s,a)Q(s,a) via tabular Q-learning over GG episodes, governed by the usual RL learning rate αrl\alpha_{\rm rl} and discount γ\gamma. Final selection is based on the greedy policy over QQ, producing IcriticalI_{\text{critical}}, the minimal catastrophic bit set (Khalil et al., 10 Dec 2025).

3. Implementation Workflow

The FlipLLM algorithm proceeds in three main phases:

  1. Sensitivity Profiling: Each layer is profiled, sensitive subsets are identified, and their effect measured.
  2. Layer Selection and Bit Set Initialization: The most vulnerable layer and its top sensitive bits are passed to the Q-learning component.
  3. RL-Guided Refinement: Actions iteratively refine the bit set using observed test-time accuracy as feedback, maximizing accuracy loss per bit flipped.

A high-level summary is provided in the algorithmic pseudocode:

Phase Description
Sensitivity Profiling Compute SS^\ell and rank parameters in each layer
Layer and Bit Set Selection Select \ell^*; initialize IhybridI_{\text{hybrid}}
RL-based Refinement Q-learning over actions on IhybridI_{\text{hybrid}}

4. Empirical Evaluation

FlipLLM was evaluated on several LLMs and a VLM:

  • GPT-2 Large (774M parameters)
  • DeepSeek-V2 (7B MoE)
  • LLaMA 3.1 8B (dense)
  • LLaVA 1.6 7B (vision+language)

Tested benchmarks include MMLU, MMLU-Pro, VQAv2, and TextVQA. The results demonstrate that a small number of bit-flips can lead to drastic performance drops:

Model Baseline Perf. Final Perf. #Flips GenBFA Time (h) FlipLLM Time (h)
LLaMA 3.1 8B 69.9% 0.21% 5 43 18
DeepSeek V2 71.3% 0.19% 6 42 26
GPT-2 Large 30.5% 0.35% 5 10 4
LLaVA 1.6 78.2% 0.5% 7 48 22

FlipLLM achieves up to 2.5× faster discovery than GenBFA (the prior evolutionary SOTA), and consistently identifies bit sets of comparable or higher impact (Khalil et al., 10 Dec 2025).

5. Insights on Vulnerability Distribution and Defense

Analysis reveals that vulnerabilities are concentrated in attention-projection and normalization layers across both LLMs and VLMs. Critically, protecting only the MSBs at the identified vulnerable locations using ECC Single Error Correction Double Error Detection (SECDED) completely mitigates BFA impact without significant hardware overhead. For example, LLaMA 3.1 performance degrades from 69.9% to 0.21% under BFA, but is restored to 69.8% when SECDED is applied at the critical bit positions only (Khalil et al., 10 Dec 2025).

6. Significance and Future Directions

FlipLLM represents the first scalable and adaptive attack methodology capable of auditing BFA risk in both language and multimodal foundation models. The RL-guided search uncovers synergistic bit effects that are missed by gradient or evolutionary heuristics. The two-stage sensitivity/Q-learning pipeline ensures that discovery cost remains practical even for billion-parameter models, scaling linearly with model size.

Proposed future extensions include:

  • Integration of policy-gradient or actor-critic RL for cross-layer or multi-bit perturbations.
  • Hardware-in-the-loop and pre-silicon model verification with fault sets generated by FlipLLM.
  • Meta-learning approaches to amortize discovery cost across model families (Khalil et al., 10 Dec 2025).

A plausible implication is that principled BFA analysis tools such as FlipLLM will become essential for robust, hardware-aware deployment of foundation models and for guiding efficient, targeted hardware protection strategies.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Whiteboard

Follow Topic

Get notified by email when new papers are published related to FlipLLM.