Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

CacheTrap: Unveiling a Stealthier Gray-Box Trojan against LLMs

About

The rapid advancement of large language models (LLMs) has sparked growing interest in understanding their security vulnerabilities, particularly Trojan attacks that enable stealthy manipulation of model behavior. Traditional Trojan methods typically alter inputs and/or model weights, relying on white-box assumptions that require access to data or model internal parameters. In this work, we present CacheTrap, the first gray-box Trojan attack targeting the Key-Value (KV) cache of LLMs. This method induces a single-bit flip in the KV cache, serving as a transient trigger. When activated, this trigger causes the model to exhibit targeted actions without changing inputs or model weights. CacheTrap introduces an efficient search algorithm to locate vulnerable positions in the KV cache, independent of model weights or datasets. Extensive experiments on five open-source LLMs show a remarkable 100% attack success rate (with the trigger) while preserving benign accuracy (without the trigger) by flipping just one bit in the KV cache.

Mohaiminul Al Nahian, Abeer Matar A. Almalky, Gamana Aragonda, Ranyang Zhou, Sabbir Ahmed, Dmitry Ponomarev, Li Yang, Shaahin Angizi, Adnan Siraj Rakin (1) __INSTITUTION_9__ SUNY Binghamton, (2) New Jersey Institute of Technology, (3) UNC Charlotte)• 2025

Related benchmarks

TaskDatasetResultRank
Question AnsweringARC Easy
Accuracy (After Attack)93.01
44
Question AnsweringARC Challenge
Attack Success Rate (ASR)97.95
20
Question AnsweringOpenBookQA
Attack Success Rate (ASR)100
20
Sentiment AnalysisSST2
Attack Success Rate (ASR)95.3
17
Question ClassificationTREC
Attack Success Rate (ASR)0.938
13
Showing 5 of 5 rows

Other info

Follow for update