We show that quantization asymmetry concentrates bit-flip vulnerability in small tensors retained at high precision. CoarseHammer targets these tensors and accepts flips at any bit, without parameter values, gradients, or data. It remains effective under continued fine-tuning. Under ideal placement, CoarseHammer reaches chance accuracy in at least 81.5% of runs on each of ten evaluated models, including four large language models, with median successful runs requiring at most 24 flips. On simulated DRAM with 0.01 flippable bits per million, it outperforms three prior attacks on every evaluated convolutional network, succeeding in up to 83.6% of runs while they never succeed. On a real system, CoarseHammer steers heap-allocated tensors onto vulnerable frames despite address space layout randomization, without accessing the model file. With 16 templated frames, median accuracy reaches chance for all four language models and approximately chance for four convolutional networks.
Figures & tables
TABLE I: CoarseHammer against prior BFAs. : yes, : partially, : no. † marks attacks on code, the rest attack parameters.
Model
Dataset
Params
Accuracy (%)
ResNet8 [ 68 ]
CIFAR-10 [ 69 ]
77.7 k
78.0
ResNet18
CIFAR-10
11.2 M
95.9
ResNet50
CIFAR-10
23.5 M
96.1
DenseNet121 [ 70 ]
CIFAR-10
7.2 M
82.2
MobileNetV1 [ 71 ]
Visual Wake Words [ 72 ]
211 k
85.4
DS-CNN [ 73 ]
Speech Commands [ 74 ]
22.6 k
92.0
TABLE II: The ten models we evaluate CoarseHammer against, their datasets, parameter counts, and pristine accuracy.
Fig. 1: Activation Change Coverage (ACC) at τ=10% against degradation under random bit flips, showing the accuracy drop in points for four CNNs (top), and the perplexity increase on WikiText for four LLMs (bottom). Each point is one fault trial with a single bit flip, injected into the high-precision tensors (red) or into the quantized tensors (blue).
Fig. 2: Overview of CoarseHammer on ResNet8. Offline, architecture recovery yields the operator graph with bit widths, shapes and allocation order (1). A flip in a bias T spreads through every later operator to the logits (2). Templating DRAM finds frames with flippable cells (3). Online, a planter thread pushes a templated frame Fi and then n−1 filler frames onto the page frame cache (PFC) list, which is last-in, first-out, so the fillers occupy the victim’s next n−1 faulted pages and Fi occupies the n -th, which is the target page (4). The attacker then hammers the aggressor rows of Fi (5) until accuracy reaches chance (6), shown as the mean of 1000 runs.
Fig. 3: Fraction of runs that have reached chance accuracy by each number of flips, over 1000 runs per CNN and 200 runs per LLM. The value at the flip limit, 32 for a CNN and 64 for an LLM, is the attack success rate. Each panel gives CoarseHammer’s median flips to chance among its successful runs, and the gray percentage beside each model name is its pristine accuracy from Table II . Bands are 95% Wilson intervals.
Fig. 4: Placement probability with 1 GiB templated. Red curves give Pany for each of the six models, and black curves give Pexact for r exact bits. The gray band marks the DRAM vulnerabilities of Figure 5 , 0.01 to 10 flippable bits per million.
Fig. 5: The four attacks on the same simulated templates of 1 GiB, one column per model. Top: percentage of runs at chance accuracy after their last flip, over 400 templates per point. Bottom: median number of flips that land, at most 32 .
Target pages on the frames, S
Landed flips per load
Median accuracy
Victim
Pages
N=4
N=16
N=64
N=128
N=4
N=16
N=64
N=128
N=16
ResNet8
9.0
1.5
4.6
8.5
8.6
1.4
2.7
2.8
3.1
10.5%
ResNet18
18.5
3.8
10.4
17.2
17.6
3.5
11.7
11.0
13.7
9.3%
ResNet50
50.4
3.8
15.2
41.7
48.3
7.3
9.7
11.2
17.2
21.6%
MobileNetV1
22.4
3.4
9.7
19.5
21.8
1.3
3.9
5.3
6.0
52.8%
DS-CNN
10.5
2.5
7.1
10.0
9.7
1.8
2.8
2.6
2.9
9.9%
TABLE III: End-to-end attack on the desktop. Pages is the mean number of target pages per load. S is the mean number of target pages on the attacker’s N frames. Landed flips are means over loads, with 1 GiB of the desktop’s DRAM templated. The last column is the median accuracy models reach after CoarseHammer for N=16 .
Model
Quantization
Pristine
Success
ResNet8
W6A6
80.0%
98.1%
W4A4
78.9%
98.7%
ResNet18
W6A6
82.4%
97.1%
W4A4
81.7%
94.6%
Llama-3.2-3B
Q6_K
63%
96%
Q4_K_M
62%
96%
TABLE IV: Attack success rates for weights quantized below 8 bits. ResNet rates are on CIFAR-10 with DoReFa-Net [ 81 ] . Llama-3.2-3B uses K-quant [ 82 ] checkpoints, 1000 runs each, where success means MMLU accuracy at chance ( 25% ) or worse.
Fig. 6: Accuracy while the victim fine-tunes for 50 epochs and CoarseHammer flips 0 to 4 bits at the start of each epoch. Red lines give the mean over 50 runs. Blue lines give the mean of five fine-tuning runs without flips, and dashed lines mark chance accuracy. The gray percentage beside each model name is its accuracy before fine-tuning.
LLM quantization has become essential for memory-efficient deployment. Recent work has shown that quantization schemes can pose critical security risks: an adversary may release a model that appears benign in full precision but exhibits malicious behavior once quantized by users. However, existing quantization-conditioned attacks have been limited to relatively simple quantization methods, where the attacker can estimate weight regions that remain invariant under the target quantization. Notably, prior attacks have consistently failed to compromise more popular and sophisticated schemes, limiting their practical impact. In this work, we introduce the first quantization-conditioned attack that consistently induces malicious behavior that can be triggered by a broad range of advanced quantization techniques, including AWQ, GPTQ, and GGUF I-quants. Our attack exploits a simple property shared by many modern quantization methods: large outliers can cause other weights to be rounded to zero. Consequently, by injecting outliers into specific weight blocks, an adversary can induce a targeted, predictable weight collapse in the model. This effect can be used to craft seemingly benign full-precision models that exhibit a wide range of malicious behaviors after quantization. Through extensive evaluation across three attack scenarios and LLMs, we show that our attack achieves high success rates against a broad range of quantization methods on which prior attacks fail. Our results demonstrate, for the first time, that the security risks of quantization are not restricted to simpler schemes but are broadly relevant across complex, widely-used quantization methods.
Large language models (LLMs) are increasingly deployed in safety and security critical applications, raising concerns about their robustness to model parameter fault injection attacks. Recent studies have shown that bit-flip attacks (BFAs), which exploit computer main memory (i.e., DRAM) vulnerabilities to flip a small number of bits in model weights, can severely disrupt LLM behavior. However, existing BFA on LLM largely induce un-targeted failure or general performance degradation, offering limited control over manipulating specific or targeted outputs. In this paper, we present TFL, a novel targeted bit-flip attack framework that enables precise manipulation of LLM outputs for selected prompts while maintaining almost no or minor degradation on unrelated inputs. Within our TFL framework, we propose a novel keyword-focused attack loss to promote attacker-specified target tokens in generative outputs, together with an auxiliary utility score that balances attack effectiveness against collateral performance impact on benign data. We evaluate TFL on multiple LLMs (Qwen, DeepSeek, Llama) and benchmarks (DROP, GSM8K, and TriviaQA). The experiments show that TFL achieves successful targeted LLM output manipulations with less than 50 bit flips and significantly reduced effect on unrelated queries compared to prior BFA approaches. This demonstrates the effectiveness of TFL and positions it as a new class of stealthy and targeted LLM model attack.
Jingkai Guo, Chaitali Chakrabarti, Deliang Fan
School of Electrical, Computer and Energy Engineering, Arizona State University, Tempe, AZ, USA
Low-bit quantization reduces the memory footprint of large language models, but preserving accuracy with efficient training remains challenging. Scalar quantization encodes weights independently, while explicit-codebook vector quantization introduces costly search during training. We propose E8-QAT, a 2-bit quantization-aware training framework that uses the E8 lattice as an implicit eight-dimensional codebook. It jointly quantizes weight groups through arithmetic projection without storing or searching an explicit codebook during the training forward pass. A 2-bit core encoding and sparse extension preserve the selected lattice points exactly, adding less than 0.1% to core index storage. On Qwen3.6-35B-A3B, E8-QAT matches the performance of the full-precision model in terms of the average score across the four tasks. E8-QAT improves over the state-of-the-art baseline by 2.03% on IFEval and by 1.51% on LiveCodeBench, under the same data, schedule, and bit width. The 2-bit representation reduces peak memory by 80% and supports a 4× larger batch. At each representation's largest feasible batch, E8-QAT reaches 1.97× the decoding throughput of BF16.
Xinyu Lei, Hong Huang, Jiebin Zhang +6
Peking University · City University of Hong Kong · Tencent