Manuscript Offprint

arXiv:2610.30798

Amplifying Latency and Cost of LLM Inference via Rowhammer Attack

Mrityunjay Shukla, Shubham Roy, Biswabandan Panda

Mrityunjay Shukla

Indian Institute of Technology Bombay

Mumbai, India

mryunjay@cse.iitb.ac.in

Shubham Roy

Indian Institute of Technology Bombay

Mumbai, India

royshubham@cse.iitb.ac.in

Biswabandan Panda

Indian Institute of Technology Bombay

Mumbai, India

biswa@cse.iitb.ac.in

Abstract—Large language models (LLMs) achieve high inference efficiency using optimized GPU kernels generated by just-in-time (JIT) compilation frameworks such as Triton. Triton compiles GPU kernels through an MLIR/LLVM-based pipeline. We investigate whether a Rowhammer-induced bit-flip in the CPU's DRAM can degrade GPU-based LLM inference performance while preserving output correctness. We present LLVMhammer, the first Rowhammer attack that causes LLM inference slowdown by inducing a bit-flip in Triton's compilation pipeline. A bit-flip in a performance-critical optimization pass causes Triton to generate a functionally identical but suboptimal GPU kernel. Since Triton caches the generated kernel on disk, a single successful bit-flip causes persistent slowdown across subsequent inference executions. Triton's target-independent stages are shared across GPU vendors, which makes our attack GPU vendor-agnostic. To identify exploitable bit-flip locations without manual inspection, we build Karnage, a tool that isolates useful bit-flip locations in Triton's target-independent compilation pipeline. We evaluate LLVMhammer across a diverse set of LLMs, including Qwen2.5-7B-Instruct, Llama-3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, and Deepseek-llm-7B-chat, across NVIDIA RTX 4090 and AMD RX 7900 XTX GPUs. LLVMhammer increases inference latency of an LLM inference server running on a single GPU by 4-16%, which, in turn, can translate into additional annual operating costs at the scale of multi-GPU deployments. We further show that LLVMhammer can also corrupt LLM outputs across different GPU vendors, reducing BERTScore to as low as 25%, illustrating the broader security implications of bit-flips in Triton's compilation pipeline.

I. INTRODUCTION

Large language models (LLMs) have become ubiquitous across a wide range of applications, from conversational AI and code generation [1] to document summarization [2]. The demand for LLM-powered services continues to grow rapidly [3]. The effectiveness of an LLM deployment depends on both output correctness and inference efficiency. Correctness determines whether the model produces accurate and reliable responses. Inference efficiency is determined by how effectively the deployment utilizes its computational resources and consequently, the throughput it can achieve, measured in terms of the number of tokens generated per second and the number of requests served per second. Lower inference efficiency reduces throughput and increases operational costs. Modern LLMs achieve high inference efficiency by executing optimized GPU kernels for matrix multiplication and attention computations. The GPU software stack generates and manages these kernels and therefore plays a critical role in every production LLM serving system.

Rowhammer [4] is one of the attacks that can affect output correctness. A large body of research investigates accuracy degradation attacks on ML models [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17]. Most attacks target model weights [5], [6], [7], [9], [14], [13], [12], [15] and therefore require multiple bit-flips. Other works demonstrate accuracy degradation attacks under more practical and realistic assumptions using Rowhammer [8], [9], [7], [16], [17]. Some of the recent attacks [17], [18] extend this threat to LLM inference by corrupting GPU code. These attacks primarily target output integrity, causing incorrect predictions or incoherent responses. In contrast, we target inference efficiency, degrading LLM serving performance and thereby increasing deployment costs.

References (95)