原始采集文本
CacheSolidarity: Preventing Prefix Caching Side Channels in Multi-Tenant LLM Serving Systems
Conference: 27th ACM/IFIP International Middleware Conference; December 2026; Tarragona, Spain27th ACM/IFIP International Middleware Conference (Middleware ’26), December 2026, Tarragona, SpainDOI: 10.1145/XXXXXXX.XXXXXXXISBN: 979-8-XXXX-XXXX-X/26/12Conference: 27th International Middleware Conference; December 14–18, 2026; Tarragona, Spain27th International Middleware Conference (Middleware ’26), December 14–18, 2026, Tarragona, SpainDOI: 10.1145/3801927.3858638ISBN: 979-8-4007-2621-7/2026/12CCS: Security and privacy Side-channel analysis and countermeasuresCCS: Computing methodologies Machine learning
Panagiotis Georgios Pennas
Affiliation: IMDEA Software Institute, Universidad Politécnica de Madrid, Madrid, Spain
email: panagiotis.pennas@imdea.org
,
Konstantinos Papaioannou
Affiliation: IMDEA Software Institute, Universidad Politécnica de Madrid, Madrid, Spain
email: konstantinos.papaioannou@imdea.org
,
Marco Guarnieri
Affiliation: IMDEA Software Institute, Madrid, Spain
email: marco.guarnieri@imdea.org
and
Thaleia Dimitra Doudali
Affiliation: IMDEA Software Institute, Madrid, Spain
email: thaleia.doudali@imdea.org
© cc
Abstract.
Large Language Models (LLMs) rely on optimizations like Automatic Prefix Caching (APC) to accelerate inference.
APC works by reusing previously computed states for the beginning part of a request (prefix), when another request starts with the same text.
While APC improves throughput, it introduces timing side channels: cache hits are faster than misses, creating observable latency differences.
In multi-tenant systems, attackers can exploit these differences to infer sensitive information, e.g., by incrementally reconstructing another user’s request by observing hit/miss patterns.
Current defenses take a sledgehammer approach: they disable APC and cache sharing, isolating users, and sacrificing efficiency for regular users.
This paper presents CacheSolidarity, a system that secures multi-tenant LLM serving systems against APC side channels without sacrificing performance and efficiency.
CacheSolidarity monitors cache reuse across users, flags suspicious sharing, and selectively isolates prefixes, restricting their reuse only when necessary.
Evaluation shows that CacheSolidarity enables up to 70% higher cache reuse and 30% lower inference latency compared to existing user-isolation defenses. CacheSolidarity’s lightweight design demonstrates how LLM serving can be secured without sacrificing performance or incurring unbearable overheads.
Keywords: LLM Inference Serving, Automatic Prefix Caching, KV Cache, Timing Side Channels, Multi-Tenant Systems, Selective Isolation, Prefix Isolation, Security-Performance Trade-Off
††cc-license: by
1. Introduction
Large Language Models (LLMs) now power applications such as conversational assistants, code generation, and enterprise analytics (Brown et al., 2020). These services operate at massive scale under strict latency and throughput requirements, making inference serving a critical systems challenge (Zhong et al., 2024). Modern serving systems employ system-level optimizations such as cache management (Kwon et al., 2023; Lee et al., 2024; Sun et al., 2024) and scheduling (Agrawal et al., 2023; Agrawal et al., 2024b; Holmes et al., 2024) to accelerate LLM inference. Among them, prefix sharing (Juravsky et al., 2024; Ye et al., 2024; Bang, 2023), or Automatic Prefix Caching (APC), is widely used by state-of-the-art frameworks and commercial APIs, such as OpenAI (OpenAI, 2024), DeepSeek (DeepSeek, 2024), Google Gemini (DeepMind, 2025), MoonShot Kimi (Qin et al., 2025), vLLM (Kwon et al., 2023), and SGLang (Zheng et al., 2024a).
APC accelerates inference by caching and reusing previously computed model states for the beginning part of a request (the request’s prefix) whenever another request starts with the same text. This avoids redundant computation and significantly reduces latency for long prompts and multi-turn conversations (Juravsky et al., 2024; Ye et al., 2024).
While APC improves performance, it introduces security risks similar to other caching optimizations (Yarom and Falkner, 2014; Dahlberg and Pulls, 2023; Gruss et al., 2019; Bortz and Boneh, 2007). APC creates observable inference latency differences between cache hits and misses, resulting in a timing side channel that can reveal sensitive information. In multi-tenant deployments where prefix caches are shared across users, attackers can exploit these differences to infer private data. For example, by sending crafted requests and measuring time-to-first-token (TTFT), an attacker can determine whether their input matches cached prefixes from another user’s request. Repeated probing enables prompt-stealing attacks that reconstruct sensitive content from other users (Song et al., 2025; Gu et al., 2025).
To prevent these attacks, prior work proposes three main defenses against APC timing leaks: (i) full user-level isolation, which disables prefix sharing entirely (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025); (ii) timing obfuscation, which injects noise to mask latency differences (Carlini and Nasr, 2024); and (iii) selective isolation of secret-dependent prompts based on LLM-aided semantic analysis (Chu et al., 2026).
While effective in theory, all these defenses suffer from a critical drawback: they introduce significant overhead, often unnecessarily, e.g., for prompts that are not involved in attacks or for situations where the timing side channel is not exploitable in practice. Thus, these solutions erase APC’s performance benefits and penalize regular, benign users; thereby limiting their applicability in realistic, high-performance multi-tenant environments.
To address the shortcomings of current defenses, we introduce CacheSolidarity, a system-level solution that secures multi-tenant LLM serving against timing side channels caused by APC, while preserving its performance benefits. CacheSolidarity is based on the key insight that isolating entire users (as done in (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025)) is not necessary to prevent attacks; rather it is sufficient to protect the shared prefixes that might lead to attacks. Building on this insight, CacheSolidarity (1) continuously monitors prefix reuse across users, (2) flags prefixes that are suspiciously reused by multiple users, and (3) prevents further reuse of flagged prefixes in follow-up requests. This approach embodies the principle of cooperative efficiency: benign users benefit from shared caching through solidarity, where common prefixes remain accessible to all. When suspicious behavior threatens this solidarity, CacheSolidarity intervenes by isolating only the flagged prefixes instead of penalizing all users.
CacheSolidarity consists of lightweight components that work together to secure prefix caching without sacrificing efficiency. First, CacheSolidarity extends the prefix cache with minimal metadata to track ownership and flag suspicious reuse. Second, the Detector monitors cache hits and isolates flagged prefixes shared across users. Finally, the Activator enables isolation only when timing side channels are exploitable, based on the distinguishability of cache-hit and cache-miss latencies. This depends on factors such as hardware, LLM model size, system load, and request length, as shown in Section 2. Together, CacheSolidarity’s system components interact seamlessly: the cache extension provides metadata, the Detector enforces selective isolation and the Activator optimizes the security-performance trade-off.
CacheSolidarity is implemented on top of the state-of-the-art LLM serving system vLLM (vLLM Team, 2024). Extensive evaluation across workloads and LLM model families and sizes shows that CacheSolidarity achieves up to 70% higher cache reuse and 30% lower inference latency than user-level isolation defenses, with negligible runtime and memory overhead. We further characterize CacheSolidarity’s security guarantees through a detailed analysis, complemented by empirical validation demonstrating its effectiveness against APC timing side channels across users.
Figure 1. Timing side-channel leakage in prefix-sharing LLM inference. The attacker sends crafted prompts and measures time-to-first-token (TTFT) to detect cache hits or misses caused by Automatic Prefix Caching (APC) and steal the sensitive information in the victim’s prompt.
The specific paper contributions are:
∙\bullet
An analysis of APC timing side channels in multi-tenant LLM serving systems, identifying the workload and system conditions affecting their exploitability (Section 2).
∙\bullet
The design of CacheSolidarity, a lightweight system that prevents timing attacks by selectively isolating suspicious prefixes rather than entire users, preserving caching benefits (Section 3). The code is open-sourced.11
1
https://github.com/muse-research-lab/CacheSolidarity
∙\bullet
A security analysis of CacheSolidarity’s guarantees and limitations, complemented by empirical validation against prompt-stealing attacks (Section 4).
∙\bullet
An extensive evaluation of the performance of CacheSolidarity across diverse workloads and state-of-the-art LLM models, alongside a sensitivity analysis (Section 5).
2. Background and Motivation
In this section, we provide background and motivation for CacheSolidarity.
We start by introducing background on LLM serving systems and, in particular, on the APC optimization (2.1).
We then characterize the parameters that influence the exploitability of timing side channels due to APC (Section 2.2).
Then, we illustrate how attackers can exploit APC through timing leaks to learn sensitive prompts (2.3).
Next, we overview current defenses for APC timing leaks and discuss their limitations (2.4).
2.1. Caching in LLM Serving Systems
Large Language Models (LLMs), such as GPT (Brown et al., 2020) and LlaMA (Touvron and others, 2023), are the backbone of modern AI services.
Integrating them in modern IT systems requires serving systems that deliver inference with low latency and high throughput under multi-user workloads.
Inference happens in two stages: prefill and decode.
During prefill, the entire input prompt (also called a request) is processed in a single forward pass, generating key-value (KV) tensors for each token.
In the decode phase, tokens are produced autoregressively; for each new token, the model computes a new key-value tensor using all previously generated tensors.
Without caching, every decode step would recompute all KV tensors for both prefill and prior decode tokens, incurring quadratic cost.
To avoid this, current LLM serving systems employ a KV cache that stores tensors generated during the prefill and previous decoding steps for reuse. To further accelerate inference, several commercial frameworks such as OpenAI (OpenAI, 2024), DeepSeek (DeepSeek, 2024), Google Gemini (DeepMind, 2025), MoonShot Kimi (Qin et al., 2025), vLLM (Kwon et al., 2023), and SGLang (Zheng et al., 2024a) implement Automatic Prefix Caching (APC). APC reduces redundant computation by reusing cached KV tensors whenever a new request shares a prefix with an earlier one. This optimization is particularly effective for scenarios such as long-document queries or multi-round conversations (vLLM Team, 2025), where repeated processing of the same prefix would otherwise incur significant overhead.
When serving systems apply APC, a prompt can be viewed as a sequence of prefixes, each mapped to a cache entry in the KV/prefix cache. Requests may experience partial cache hits, starting from the beginning of the prompt and reusing some cached prefixes while recomputing others. The leftmost example in Figure 5 illustrates this process, where each node corresponds to a cache entry for that particular prefix/part of the prompt sentence.
(a) RPS = 10
(b) RPS = 40
(c) LLava-0.5B (A100)
(d) Llama2-7B (A100)
(e) Llama2-7B (H100)
(f) Llama3-70B (H100)
Figure 2. TTFT of cache hits (red) and misses (blue).
2.2. Timing Differences due to APC
Although the use of the prefix cache accelerates inference, it introduces observable latency differences between cache hits and misses, particularly in the time-to-first-token (TTFT). These variations create a timing side channel, an unintended information leak where execution time reveals whether a request shares prefixes with cached prompts. In multi-tenant environments, such leaks can be exploited by attackers to infer sensitive information. In the following examples, we illustrate how APC-induced timing differences manifest and we identify the key parameters that influence the strength and exploitability of the side channel.
Example 2.1.
To illustrate APC’s impact on latency, recall that a prompt is processed as a sequence of prefixes mapped to cache entries. With APC, prefixes may either hit or miss the cache; an early miss forces recomputation of all subsequent prefixes, leading to observable differences in time-to-first-token (TTFT) between full-reuse and recomputation cases.
Figures 2(c)-2(f) reports TTFT comparisons across LLMs of increasing size (0.5B, 7B, 70B) and varying prompt lengths, with requests sent at a constant rate (RPS = 1). TTFT for cache hits is shown in red, while misses are shown in blue. Llama3-70, due to its parameter count, is configured to run across 2 H100 GPUs with tensor parallelism TP = 2. For all models except the smallest one (i.e., LLava-0.5B), we highlight the following:
∙\bullet
The TTFT gap between cache hits and misses become noticeable after a certain prefix length for each model.
∙\bullet
The TTFT gap grows as the shared prefix length increases.
∙\bullet
For a given prefix length, larger LLMs exhibit greater TTFT gaps.
∙\bullet
Larger LLMs show distinguishable gaps even at shorter prefixes.
For LLava-0.5B, TTFT differences between hits and misses are negligible because the model is small and the recomputation latency for the misses is minimal.
Observation 1: TTFT reveals whether a request reuses cached prefixes (hits) or recomputes them (misses), and the difference becomes more pronounced with larger models and longer prefixes that are reused across users.
Figure 3. Effect of the LLM model size, prefix/prompt length, system load (requests per second) and GPU hardware on the distinguishability of the APC timing differences, captured by the KDE overlap between cache hits and misses.
Example 2.2.
Next, we examine how system load influences these timing differences using the same setup as before with the Llama-13B model. Figures 2(a), 2(b) show TTFT measurements under increasing request-per-second (RPS) rates for prompts with prefixes of up to 500 tokens. We observe that as the request-per-second (RPS) rate increases, the latency gap between cache hits and misses progressively collapses, making them hard to distinguish. This happens because higher RPS introduces resource contention and head-of-line blocking in the LLM serving pipeline (Agrawal et al., 2023; Agrawal et al., 2024b; Zhong et al., 2024; Papaioannou and Doudali, 2024). Under these conditions, batching and queuing delays dominate latency, overshadowing the computational savings of prefix reuse. Thus, cache hits appear as slow as misses, effectively eliminating any timing gaps.
Observation 2: As system load increases, TTFT differences between prefix cache hits and misses disappear because batching and queuing delays dominate latency, masking cache-related timing variations.
Example 2.3.
Next, we evaluate the impact of the underlying GPU hardware by running the same Llama-7B model on a single A100 vs. H100 GPU. Figures 2(d), 2(e) show that cache misses (model inference) are served significantly faster on the H100 due to its higher throughput and improved architecture, significantly reducing timing gap compared to that of the A100.
Observation 3: Higher-throughput GPUs accelerate inference and speed up cache misses, thereby reducing the time gap.
To further validate the above observations across conditions, Figure 3 shows the KDE overlap between the TTFT distributions of cache hits and misses across models of varying size, prefix length, system load (RPS), and GPU hardware. All models execute on a single A100 GPU (unless otherwise noted) and Llama3-70B across 2 H100 GPUs.
KDE overlap is a statistical measure of similarity between two probability distributions, computed as the integral of the minimum of their density functions (Inman and Bradley, 1989). Higher values indicate harder to distinguish cache hit vs. miss latency, while lower values indicate clear separation, thus stronger timing side channel.
The left plot shows that the overlap decreases for longer prefixes, especially for larger models such as Llama2-13B and Llama3-70B. In contrast, smaller models (e.g., Llava-0.5B) have distinctly higher overlap, as well as models that run on newer GPUs (Llama2-7B on H100) for short prompts. The right plot shows that overlap increases with request rate (RPS), as batching and queuing delays dominate latency and mask cache-dependent variations. At high RPS, hits and misses become nearly indistinguishable across all models, regardless of the underlying GPU A100 vs. H100, effectively eliminating the timing leak.
In conclusion, while prior work acknowledges APC-induced timing side channels (Chu et al., 2026; Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025), our motivational analysis shows that the strength and exploitability of the channel depend on the following critical parameters:
∙\bullet
the shared prefix’s length: longer prefixes are more vulnerable.
∙\bullet
the size of the LLM model: larger models are more vulnerable.
∙\bullet
the system load: lower load (requests received per second) is more vulnerable.
∙\bullet
the underlying hardware platform: since it directly influences timing measurements.
These parameters jointly determine whether timing side channels are distinguishable and, should be taken into consideration into building robust and practical mitigation mechanisms.
Key insight: While APC introduces timing side channels, their exploitability depends on various parameters: the prefix length, LLM size, system load, and hardware platform. Prior work treated APC leaks as uniformly exploitable, whereas our analysis reveals that these parameters jointly determine side-channel strength and must guide efficient and practical mitigation.
2.3. Prompt Stealing Attacks via APC leaks
In multi-tenant systems the prefix cache is shared between requests from different users and security domains.
Hence, these visible timing differences can be exploited by attackers to incrementally reconstruct
sensitive prompts or steal private information (secrets) of other users by observing the TTFT of attacker requests.
That is, APC leaks can be exploited to perform prompt stealing attacks (Song et al., 2025).
Figure 1 illustrates the workflow of a timing-based prompt stealing attack that exploits APC leaks, inspired by (Song et al., 2025).
First, the victim user issues a request that includes a prompt containing sensitive information.
The attacker uses an LLM-based Prompt Constructor to create candidate prompts. Next, each candidate is submitted to the LLM serving system, and the TTFT is measured.
By observing the TTFT, the attacker can determine (e.g., using a dedicated pre-trained classifier) whether the observed latency corresponds to hits or misses in the prefix cache.
In particular, a cache hit indicates that the candidate shares a prefix with the victim’s prompt.
By repeating this process iteratively, the attacker can reconstruct the original prompt word-by-word or retrieve missing/private data fields (e.g., names, dates, identifiers) without direct access to the cache (Song et al., 2025; Gu et al., 2025).
Attack Examples.
Consider an LLM-based customer-support application where multiple users send requests to a shared backend model. To improve performance, the system prepends hidden context (e.g., account data) to each query and reuses cached prefixes across requests. For example, the system may internally construct a prompt such as: “You are a support assistant. Customer name: John Doe. Account ID: 48291.”, followed by “Summarize recent activity.” An attacker, acting as a regular API user, can issue inputs containing guesses for likely fields (e.g., “Customer name: A…”, “Customer name: Alice…”) and measure response times. Faster responses indicate prefix reuse, allowing the attacker to iteratively refine guesses and recover sensitive fields embedded in prior prompts.
Next, consider a shared LLM API where multiple users submit prompts that may include sensitive personal or business information. For example, a user might send a query such as “Draft an email to my manager John Doe about delaying Project Phoenix.” As requests are processed, parts of these prompts may be cached to improve performance. An attacker, interacting as a normal user, can probe the system by issuing prompts containing guesses (e.g., names or project titles) and measuring response times. By iteratively refining these guesses (e.g., extending “John…” to “John Doe…”), the attacker can reconstruct real user prompts.
Real prompts with secret information. Next, in Table 1 we analyze datasets with real user prompts from diverse domains, including logs of personal chats, interactions with assistants, and instruction tuning; the task where a prompt specifies an instruction and the model is trained to produce the intended response. Given that these datasets do not include labeled private information, we use the ai4privacy 0.5.0 Python module (Ai4Privacy, 2026) as a proxy to identify sensitive content within each prompt and estimate the fraction of prompts containing personally identifiable information (PII), as also done in prior work on LLM privacy leakage (Ai4Privacy, 2024; Cheng et al., 2025; Singh and Narayanan, 2025; Acharya and Shrestha, 2025).
We observe that a substantial fraction of prompts across datasets include sensitive content, ranging from 19%-27.24% in user conversations and assistant interactions, up to 76.1% in instruction-tuning prompts. This gap arises because instruction-tuning prompts ground tasks in concrete contexts, often including specific entities such as names, locations, or dates. For example, a prompt may ask: “Summarize the following article about Barack Obama’s visit to Berlin in 2013” or “Extract all locations and dates mentioned in a passage about the 2020 Tokyo Olympics,” which naturally include personally identifiable information. In contrast, conversational prompts are typically more abstract or task-oriented, e.g., “How do I improve my resume?” or “What’s a good itinerary for a 3-day trip?”, and thus rarely include personal details.
We further evaluate the extent to which such information can be recovered using a state-of-the-art BERT-based model (Devlin et al., 2019) (google-bert/bert-base-uncased), mimicking an attacker employing a Prompt Constructor. We find that, among prompts containing secrets, the model can recover hidden information in up to 52.5% of cases. This result indicates that real-world prompt datasets contain substantial amounts of recoverable sensitive information, suggesting that prompt stealing attacks can be effective in extracting real secrets.
Dataset
Domain
Prompts
% Prompts
w/ Secrets
% Secrets
Recover.
Flan (Data Provenance Initiative, 2024)
Instr. tuning
553,869
76.1%
40.39%
UltraChat (OpenBMB, 2023)
Chat logs
10,000
27.24%
52.5%
ShareGPT (anon8231489123, 2023)
Chat logs
702,151
24.3%
22.8%
OASST1 (OpenAssistant, 2023)
Assistant logs
39,283
19%
30.76%
Table 1. Sensitive information (secrets) in real-world prompt datasets and its recovery rate.
In addition, prior studies (Chu et al., 2026) have shown that such real world datasets exhibit frequent prefix reuse within and across users. Specifically, requests from the same user share prefixes in 9–60% of cases, while up to 30% reuse occurs across different users. This widespread reuse increases the likelihood that sensitive prompt components remain in cache and become vulnerable to prompt stealing attacks.
2.4. Defenses Against APC leaks
Existing defenses against APC-induced timing leaks fall into three main categories, each with distinct trade-offs between security and performance, as summarized in Table 2.
Cache Isolation and Partitioning.
Several works propose mitigating APC leaks by eliminating cache sharing entirely across different users and security domains.
InputSnatch (Zheng et al., 2024b) and Auditing Prompt Caching (Gu et al., 2025) advocate per-user cache isolation or disabling prefix reuse across requests.
Cache Partitioning (Pang et al., 2024) similarly enforces user-boundaries within the KV-cache to prevent cross-user hits.
At the same time, major AI providers adopt isolation mechanisms in-production at varying scopes, along with periodic cache refresh policies, as summarized in Table 3. OpenAI scopes its prompt cache at the organization level and explicitly warns about timing observability (OpenAI, 2024). Anthropic recently tightened its isolation boundary from the organization to the workspace level (Anthropic, 2026). Similarly, Azure OpenAI and Amazon Bedrock enforce subscription- and account-level isolation, largely driven by compliance requirements (Microsoft Azure, 2025; Amazon Web Services, 2025). Google Vertex AI provides manual caching primitives with per-project scoping (Google Cloud, 2025).
In the open-source ecosystem, the widely used vLLM framework introduced an optional cache isolation mechanism based on a per-request cache_salt (vLLM Contributors, 2025), following the disclosure of CVE-2025-46570 (National Vulnerability Database, 2025) (a publicly registered security vulnerability) and the related GitHub Security Advisory (GHSA-4qjh-9fv9-r85r), which highlighted the risk of timing leakage from shared prefix caches. Finally, cache refresh times range from few minutes up to hours and days, leaving ample time for an attacker to mount prompt stealing attacks targeting cached prefixes.
Related Work
Mitigation
Prefix Reuse
Low TTFT
Partitioning (Pang et al., 2024)
Per-user Isolation
✗
✗
InputSnatch (Zheng et al., 2024b)
Per-user Isolation
✗
✗
Audit (Gu et al., 2025)
Per-user Isolation
✗
✗
Remote (Carlini and Nasr, 2024)
Timing Obfuscation
✓
✗
SafeKV (Chu et al., 2026)
Selective Sharing
✓
✗
CacheSolidarity
Selective Sharing
✓
✓
Table 2. Comparison of current mitigation strategies.
APC-based
side channels are a practical and widely acknowledged threat across major AI providers.
Cache isolation ensures strong security guarantees by preventing cross-user prefix sharing.
However, it also sacrifice the performance benefits of prefix caching, which can result in significant overhead given that “real-world LLM workloads frequently exhibit significant cross-query reuse” (Chu et al., 2026).
Shortcoming 1: User-based cache isolation prevents timing leaks but introduces overhead due to reduced prefix sharing.
Timing Obfuscation.
Carlini and Nasr (Carlini and Nasr, 2024) propose to secure systems by making the execution time of inference “constant” across hits and misses.
For this, they propose to inject noise in the system to mask timing signals and, ultimately, close the side channel by making hits and misses in the prefix cache indistinguishable to attackers.
That is, these defenses would ensure that the distributions of hits and misses in figure 2 overlap.
Although obfuscation defenses can prevent APC leaks, they have two limitations.
First, they introduce uniform delays across all requests, penalizing benign users and reducing overall performance.
Second, they do not address the source of the timing leak (i.e., the prefix cache being shared between security domains) and historically obfuscation defenses for timing leaks are less robust since attackers can often find ways of amplifying even small differences in execution time (Vila and Kopf, 2017; Kohlbrenner and Shacham, 2016; Gras et al., 2017).
Shortcoming 2: Obfuscation-based techniques do not address the source of leaks and introduce overheads for benign requests.
Provider
Isolation Scope
Cache Refresh
OpenAI (OpenAI, 2024)
Per organization
5–60 min
Anthropic (Anthropic, 2026)
Per workspace
Session only (volatile)
Azure OpenAI (Microsoft Azure, 2025)
Per subscription
Not disclosed
Amazon Bedrock (Amazon Web Services, 2025)
Per account/org
5 min
Google Vertex (Google Cloud, 2025)
Per GCP project
1 min–30 days (TTL)
vLLM (vLLM Contributors, 2025; GitHub Security Advisory, 2025)
None by default
Unbounded
Table 3. Cache isolation across LLM providers.
Selective Cache Sharing.
To balance security and efficiency, some defenses restrict cache sharing rather than disabling it completely.
SafeKV (Chu et al., 2026) introduces a multi-tier detection pipeline that semantically classifies requests using rule-based checks and semantic validation via LLMs either as “sensitive” (i.e., that may contain secret information) or non-sensitive.
In SafeKV, only requests classified as sensitive are isolated at cache-level, thereby preventing other users (attackers included) from hitting on them.
Although this approach prevents leakage without fully disabling APC, its reliance on heavyweight semantic LLM-based analysis limits scalability for high-performance deployments.
Moreover, some requests might be misclassified and, therefore, left unprotected.
Shortcoming 3: Current selective sharing defenses may fail in preventing leaks for “misclassified” requests and still introduce unnecessary overhead.
These shortcomings motivate the need for a defense that adapts to the conditions under which timing leaks are exploitable, secures prefix reuse without blind per-user isolation, and preserves the efficiency of APC across diverse workloads, without introducing unbearable overheads in return for security.
3. System Design
In this section, we start by providing a high-level overview of CacheSolidarity and its objectives (3.1),
and later describe CacheSolidarity’s core components (Sections 3.2 and 3.3).
3.1. Overview and Objectives
CacheSolidarity deploys a lightweight defense mechanism that secures multi-tenant LLM serving systems against timing side-channel attacks caused by Automatic Prefix Caching (APC).
It builds on the key insight that preventing timing side-channel attacks does not require isolating entire users (like it is done in (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025)); it only requires isolating prefixes that might lead to attacks.
Building on this insight, CacheSolidarity allows cached prefixes to be reused across users but stops reuse beyond prefixes that could reveal sensitive information.
This selective prefix isolation works on a simple principle: attacks require different users to share and reuse a prefix. CacheSolidarity enforces this by tracking how users interact with shared cache entries
without requiring any knowledge of prompt semantics (Chu et al., 2026).
This approach embodies the principle of cooperative efficiency: benign users benefit from shared caching through solidarity, where common prefixes remain accessible to all.
When suspicious behavior threatens this solidarity, CacheSolidarity intervenes by isolating the corresponding prefixes rather than penalizing all users.
This design ensures that cache reuse within and across users is maximized to the greatest extent possible without compromising security.
Objectives.
The system design is guided by the following goals:
[O1]
Secure Prefix Reuse: Prevent timing attacks introduced by Automatic Prefix Caching (APC) by isolating suspicious prefixes, avoiding heavy-handed approaches such as per-user isolation or disabling cache sharing.
[O2]
Performance Preservation: Maximize cache reuse and accelerate inference speed, across diverse workloads and LLM models, thereby ensuring that security does not come at the cost of performance.
[O3]
Lightweight and Practical Design: Provide real-time protection with minimal overhead, without requiring semantic analysis or prior knowledge of sensitive content, and integrate seamlessly with state-of-the-art LLM serving systems.
Overview.
To achieve these objectives, CacheSolidarity introduces a lightweight pipeline that operates on the request-serving path, as illustrated in Figure 4. It extends the KV cache with minimal metadata per entry to track cross-user prefix reuse and flag suspicious entries. When a request arrives, the Activator determines whether to enable the Detector based on the distinguishability of timing differences in past cache hits and misses. At the same time, the LLM serving system checks if the request’s prefixes hit or miss the cache. On a cache miss, a new cache entry is created and tagged with the user’s ID. On a cache hit, the Detector (if enabled by the Activator) checks whether the prefix can be safely reused.
If safe, the request proceeds with full reuse and is forwarded to the LLM for decoding. Otherwise, a partial hit occurs: reuse stops at the flagged prefix, and the remaining prefill tokens of the isolated prefix are recomputed before proceeding to the LLM for decoding.
System Components. CacheSolidarity consists of the following:
∙\bullet
KV Cache Extension: Augments each cache entry with metadata to track user-prompt interactions and flag suspicious prefixes (§3.2).
∙\bullet
Detector: Examines prefix reuse to identify cross-user access and enforce selective isolation when suspicious reuse occurs (§3.2).
∙\bullet
Activator: Dynamically activates selective isolation only under conditions that create exploitable timing side-channels, balancing security with performance (§3.3).
Together, these components maximize cache reuse while mitigating timing attacks without sacrificing performance.
3.2. KV Cache Extension and Detector
3.2.1. KV Cache Extension
CacheSolidarity extends each cache entry with the following metadata fields:
∙\bullet
OwnerID: the identifier of the user who first created and populated this cache entry. It is set exactly once at allocation time and remains immutable.
∙\bullet
AttackFlag: a marker indicating that this prefix has been flagged for isolation due to being reused by multiple users. When set, prefix reuse beyond this point must be disabled for non-owners.
These fields add only a few bytes per entry and do not affect tensor layout or memory mapping.
3.2.2. Detection Pipeline
When a cache entry is created on a cache miss, its metadata is initialized: OwnerID is set to the current user ID and AttackFlag is cleared. When there is a cache hit, the request is sent to the Detector for validation. At this stage, the Detector examines whether the prefix should remain shared or be isolated to prevent leakage. Two scenarios can occur during validation:
∙\bullet
Hit on an unflagged prefix: If the prefix is unflagged and owned by the requesting user, reuse proceeds without changes, the cached entry is returned back to the user. If the prefix is owned by a different user, the Detector flags this prefix as isolated for future requests, ensuring that reuse beyond this point is blocked for non-owners.
∙\bullet
Hit on a flagged prefix: If the prefix is previously flagged, the Detector checks whether the next prefix in the prompt belongs to the requesting user. If yes, reuse continues normally. If not, reuse stops at the flagged prefix, and the remaining ones are recomputed through the LLM.
Figure 4. System Design of CacheSolidarity.
Figure 5. Example workflow of CacheSolidarity.
3.2.3. Example Workflow
Figure 5 shows how CacheSolidarity handles prefix reuse across three users issuing requests at timestamps t1t_{1}–t4t_{4}. Prompts differ only in private information (e.g., names). Circles denote cache entries and arrows denote prefix sequences; red, green, and orange indicate misses, hits, and flagged entries, respectively. We describe the execution at each timestamp next:
t1t_{1}:
User 1 submits a prompt, creating new cache entries tagged with OwnerID = 1. All entries are unflagged.
t2t_{2}:
User 2 reuses the first two entries. CacheSolidarity detects a different OwnerID and flags the second entry. New entries are created beyond this point for User 2.
t3t_{3}:
User 1 issues a follow-up request. As the owner, reuse continues beyond the flagged entry without restriction.
t4t_{4}:
User 3 attempts to reuse the prompt with modified private data. Since the prefix is flagged and owned by another user, reuse stops and new entries are created from that point.
In summary, this example illustrates CacheSolidarity’s selective isolation: flagged prefixes prevent cross-user continuation, forcing non-owners onto separate paths while allowing full reuse for the owner. For example, User 2 can still extend its own path (1-2-6-7-8) even if node 2 is flagged.
3.3. Activator Optimization
As shown in Section 2.2, APC timing side channels are conditionally exploitable: latency gaps between cache hits and misses increase with longer prefixes and larger models, but diminish under higher system load, while also depending on the underlying hardware. As a result, “always-on” defenses (Table 2) may incur unnecessary overhead.
CacheSolidarity addresses this by activating selective isolation only when timing differences are distinguishable under the current operating conditions (model, hardware, workload). To achieve this, it relies on an offline profiling phase combined with lightweight online monitoring.
Offline, CacheSolidarity profiles the underlying hardware–LLM pair by running workloads with varying request rates and prompt lengths, measuring latency distributions for cache hits and misses, and computing the KDE overlap, a statistical measure of how distinguishable these distributions are (Inman and Bradley, 1989). It then stores a mapping (RPS,prompt length)→overlap(\text{RPS},\text{prompt length})\rightarrow\text{overlap}, where inputs are bucketed as shown in Figure 2: RPS in increments of 1, and prompt lengths in increments of 50.
Online, CacheSolidarity maintains a sliding window hh of recent requests and calculates the request rate and average prompt length, given that the underlying the hardware and LLM are fixed. Then it uses the profiled mappings (RPS,prompt length)→overlap(\text{RPS},\text{prompt length})\rightarrow\text{overlap} to retrieve the KDE overlap(hh). If the current (RPS,prompt length)(\text{RPS},\text{prompt length}) pair has not been profiled, CacheSolidarity defaults to enabling security and skips the threshold comparison described next.
The Activator is configured with a static threshold θ\theta. When the KDE overlap(hh) exceeds θ\theta, CacheSolidarity disables selective isolation and allows full reuse, while still updating cache metadata. When the overlap falls below θ\theta, CacheSolidarity activates detection and prefix isolation. This decision is updated per request using a sliding window of TTFT samples, enabling dynamic adaptation to workload conditions. The choice of θ\theta is left to the administrator and reflects the security–performance trade-off: higher thresholds (up to 100%) increase security but may reduce performance.
Section 5.3 evaluates the impact of the threshold selection to the security and performance of the system and provides guidelines to the system administrators. Section 4.2 discusses how the Activator’s design mitigates potential adversarial threshold manipulation.
4. Security Analysis
In this section, we analyze the security guarantees provided by CacheSolidarity. First, we precisely characterize its selective isolation guarantees, and then examine the implications of the activator.
4.1. Security of Selective Isolation
We characterize which KV cache states an attacker can distinguish via APC timing leaks under CacheSolidarity’s prefix-based selective isolation.
Cache states
We consider a simplified model of the KV cache state, extended with CacheSolidarity’s metadata.
A cache state c\mathit{c} is a set of cache entries, each one consisting of a tuple (𝑖𝑑CLOSE(\mathit{id}, 𝑑𝑎𝑡𝑎\mathit{data}, 𝑜𝑤𝑛𝑒𝑟𝐼𝑑,𝑎𝑡𝑡𝑎𝑐𝑘𝐹𝑙𝑎𝑔\mathit{ownerId},\mathit{attackFlag}, OPEN𝑛𝑒𝑥𝑡)\mathit{next}). Two states c1,c2\mathit{c}_{1},\mathit{c}_{2} are structure-equivalent for user uu if they are identical except for the 𝑑𝑎𝑡𝑎\mathit{data} associated with entries not owned by uu.
Attacker model
We consider an attacker 𝑎𝑡𝑘\mathit{atk} who interacts with the system as a regular user and issues requests alongside other users.
For an issued request r\mathit{r}, the attacker 𝑎𝑡𝑘\mathit{atk} can observe whether the prefixes associated with the request result in a sequence of hits (H\mathit{H}) and/or misses (M\mathit{M}). The sequence may consist of only hits H\mathit{H}…H\mathit{H}, only misses M\mathit{M}…M\mathit{M}, or a sequence of hits followed by misses 𝐻𝐻\mathit{H}\mathit{H}…𝑀𝑀\mathit{M}\mathit{M} (some prefixes hit the cache).
Given the current state c\mathit{c} and the request r\mathit{r} issued by 𝑎𝑡𝑘\mathit{atk}, we define 𝑜𝑏𝑠(c,𝑎𝑡𝑘,r)∈{H,M}∗\mathit{obs}(\mathit{c},\mathit{atk},\mathit{r})\in\{\mathit{H},\mathit{M}\}^{*} to be an attacker observation (i.e., the sequence of H\mathit{H} and M\mathit{M}).
Security guarantees
To characterize CacheSolidarity’s guarantees, we first need to introduce two properties of requests. First, a request r\mathit{r} results in a first-entry hit, defined as 𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡(c,𝑎𝑡𝑘,r)\mathit{firstHit}(\mathit{c},\mathit{atk},\mathit{r}), if there is a cache entry for the first prefix in the request r\mathit{r}. This results in a hit in state c\mathit{c}, i.e., the first element of 𝑜𝑏𝑠(c,𝑎𝑡𝑘,r)\mathit{obs}(\mathit{c},\mathit{atk},\mathit{r}) is H\mathit{H}. Second, a request r\mathit{r} results in an unflagged hit, written 𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡(c,𝑎𝑡𝑘,r)\mathit{unflagHit}(\mathit{c},\mathit{atk},\mathit{r}), if it results in a hit on an unflagged entry in state c\mathit{c}, i.e., if 𝑜𝑏𝑠(c,𝑎𝑡𝑘,r)\mathit{obs}(\mathit{c},\mathit{atk},\mathit{r}) contains an H\mathit{H} corresponding to an unflagged cache entry. We now characterize the security guarantees of CacheSolidarity’s selective isolation by identifying which pairs of states an attacker can distinguish. This characterization is expressed as a non-interference property, a standard way to formalize confidentiality (Goguen and Meseguer, 1982; Goguen and Meseguer, 1984; Denning, 1976; Volpano et al., 1996; Sabelfeld and Myers, 2003).
Theorem 4.1.
Let r\mathit{r} be an 𝑎𝑡𝑘\mathit{atk}-request and c1,c2\mathit{c}_{1},\mathit{c}_{2} be cache states.
If:
(1)
c1\mathit{c}_{1} and c2\mathit{c}_{2} are structure-equivalent for 𝑎𝑡𝑘\mathit{atk},
(2)
¬𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡(c1,𝑎𝑡𝑘,r)∧¬𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡(c2,𝑎𝑡𝑘,r)\neg\mathit{firstHit}(\mathit{c}_{1},\mathit{atk},\mathit{r})\wedge\neg\mathit{firstHit}(\mathit{c}_{2},\mathit{atk},\mathit{r}), and
(3)
¬𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡(c1,𝑎𝑡𝑘,r)∧¬𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡(c2,𝑎𝑡𝑘,r)\neg\mathit{unflagHit}(\mathit{c}_{1},\mathit{atk},\mathit{r})\wedge\neg\mathit{unflagHit}(\mathit{c}_{2},\mathit{atk},\mathit{r}),
then 𝑜𝑏𝑠(c1,𝑎𝑡𝑘,r)=𝑜𝑏𝑠(c2,𝑎𝑡𝑘,r)\mathit{obs}(\mathit{c}_{1},\mathit{atk},\mathit{r})=\mathit{obs}(\mathit{c}_{2},\mathit{atk},\mathit{r}).
Theorem 4.1 states that, for all requests satisfying conditions (2) and (3), CacheSolidarity prevents attackers from inferring any information about data stored in cache entries not owned by them. These guarantees are conditional by design, reflecting its lightweight system design and security/performance trade-off.
Next, we describe the two cases not covered by CacheSolidarity:
∙\bullet
Attacks targeting the first entry (condition (2)):
CacheSolidarity does not protect against attacks targeting the first cache entry of a request rr that result in a 𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡\mathit{firstHit}. This happens because in this case there is no parent node (Figure 5) that CacheSolidarity can flag as potentially involved in an attack. Introducing a “dummy” parent node would make CacheSolidarity fall back to the naive user-level cache isolation.
∙\bullet
Attacks against unflagged prefixes (condition (3)):
CacheSolidarity does not protect unflagged cache entries that result in an 𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡\mathit{unflagHit}, i.e., entries that CacheSolidarity has not yet flagged because their first reuse occurs by the attacker, who correctly guesses the prefix, resulting in a cache hit. This is the only case where an 𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡\mathit{unflagHit} can happen, because CacheSolidarity conservatively flags and isolates any prefixes exactly after they are reused by different users.
The only way to prevent this case is to always treat a cache entry as flagged. However, this would make CacheSolidarity fall back to the naive user-level cache isolation.
Beyond the two cases described above, CacheSolidarity secures the system against APC leaks. Its guarantees do not rely on semantic detection (as in (Chu et al., 2026)), but on monitoring prefix overlap across users. Moreover, these guarantees hold regardless of whether attacks are performed by a single or multiple attackers, interleaved with benign requests, or under different initial cache states.
Occurrence of CacheSolidarity’s limiting conditions. In practice, these conditions are rarely met. We revisit the real datasets in Table 1, applying the same methodology to identify sensitive content and simulate prompt stealing attacks (Section 2.3). Table 6(b) reports the fraction of prompts with secrets in the first cache entry (condition (2)) and those recoverable on the first attempt (condition (3)). Only 0.01%–1.35% of prompts contain secrets in the first entry. Moreover, short prompts (<100<100 tokens), which are more likely to contain secrets early on, exhibit high KDE overlap (Figure 3), making cache hits and misses harder to distinguish. In practice, prefix caching is typically restricted to long prompts (e.g., >1024>1024 tokens in OpenAI (OpenAI, 2024)), further reducing this risk. For first-try attacks, only 3.24% of prompts are recoverable, on average. Notably, this assumes an exploitable timing channel; in practice, the factors that impact the exploitability of the timing side channel discussed in Section 2.2, may further limit attack success. In addition, user solidarity in CacheSolidarity can further reduce first-try success: if another user reuses the target prefix before the attacker, the prefix gets isolated and is inaccessible to the attacker.
(a) Secured prompts (%) for CacheSolidarity vs. SafeKV.
Dataset
1st Entry
1st Try
Flan
0.12%
1.51%
UltraChat
0.01%
5.03%
ShareGPT
1.35%
2.63%
OASST1
1.08%
3.8%
(b) Failure cases for CacheSolidarity (first-entry, first-try).
Figure 6. Security vs. SafeKV (θ=100%\theta=100\%) and CacheSolidarity failure cases.
4.2. Security impact of threshold activation
The Activator disables CacheSolidarity’s selective isolation when the KDE overlap over a sliding window hh exceeds a threshold θ\theta, indicating that timing differences are indistinguishable.
This can impact the security of the system in two ways.
First, a low threshold θ\theta may leave the system unprotected when timing leakage is exploitable.
Second, an attacker may manipulate the Activator by shaping traffic patterns.
For example, issuing bursts of requests to inflate the KDE overlap and force deactivation, or throttling requests to reduce overlap and trigger isolation for probing.
CacheSolidarity mitigates these risks through three design choices. First, the Activator computes the KDE overlap over a sliding window, requiring sustained conditions rather than reacting to transient fluctuations. Second, activation decisions rely on aggregate system-level measurements rather than per-user metrics or prompt semantics, making it difficult for an attacker to influence the observed signal. Finally, cache metadata is always updated: shared prefixes remain flagged even when isolation is disabled, preventing attackers from manipulating cache state.
While dynamic threshold adaptation is possible, it introduces a distinct risk since attackers might shape traffic patterns over time (e.g., sustained high or low load) to steer the system into adapting its threshold to a specific value. Unlike fixed-threshold designs, this creates a feedback loop where adversarial inputs may influence future system decisions, potentially causing the system to keep isolation deactivated. Even though the sliding window mitigates short-term manipulation, it does not prevent this form of threshold miscalibration. We therefore adopted a static threshold to avoid such feedback-based attacks and ensure predictable behavior, leaving its selection to the administrator following common practice in real-world systems (e.g., Google’s differential privacy deployments (Google Research, 2022)) and the proposed guidelines in Section 5.3.
5. Evaluation
(a) Workload construction.
(b) Cache hit rate.
(c) Average TTFT.
Figure 7. Workload construction and inference performance comparison across workloads and baselines.
We evaluate CacheSolidarity to understand its impact on performance and security in multi-tenant LLM serving environments. Our goal is to quantify the performance benefits under realistic workloads, across LLM families and sizes, while examining the overhead introduced by CacheSolidarity. Specifically, we address the following research questions:
RQ1::
Performance Gains: How much does CacheSolidarity accelerate inference compared to existing defenses across different workloads and models?
RQ2::
Overheads: What are the latency and resource overheads introduced by CacheSolidarity?
RQ3::
Security: Can CacheSolidarity effectively secure prompts that contain private information?
RQ4::
Sensitivity: What is the impact of the activation threshold on CacheSolidarity’s performance and security?
5.1. Experimental Setup
Table 4 summarizes the LLM models used for evaluation, their memory footprint, and the remaining GPU memory available for hosting the KV cache. The serving system is vLLM (vLLM Team, 2024) (version 0.8.5) with a block size of 16. We evaluate the performance of CacheSolidarity on a native hardware server equipped with an NVIDIA A100 GPU (40 GB memory). For larger models, we use a server with 4 H100 GPUs (94 GB each). We evaluate Llama3-70B that needs 131.5 GB of memory, so we configure it with tensor parallelism TP = 2.
Workloads.
For our experiments, we use real prompts from the ShareGPT (anon8231489123, 2023) dataset. We process prompts using the state-of-the-art BERT model (Devlin et al., 2019) (google-bert/bert-base-uncased) to (i) identify and mask sensitive words that contain private information, and (ii) replace masked words with alternative candidates. This allows us to evaluate prompts that share common prefixes but differ in private content (e.g., names, addresses etc).
Then, we construct different workloads by sampling prompts, varying the level of prefix overlap. Higher overlap means a longer shared prefix, which leads to more cache reuse and better performance. For example, private data at the end of the prompt (“You are a helpful assistant. I want you to write an email to reply to [sensitive information]”) creates high overlap, while at the beginning (“My name is [sensitive information]”) results in minimal overlap. To capture a multi-user environment, we vary both the intra-user reuse (how often a user reuses a previously cached prefix) and inter-user reuse (how much different users share common prefixes). Figure 7(a) illustrates these dimensions across our constructed workloads.
For the experiments in Section 5.2, each workload includes 10 users issuing 100 requests each (1000 total), with arrivals following a Poisson process at a rate of 10 requests per second (RPS = 10), reflecting realistic LLM workloads (Kwon et al., 2023; Agrawal et al., 2023; Zhong et al., 2024; Patel et al., 2024). The Activator of CacheSolidarity is configured with θ=100%\theta=100\% and window h=1h=1 second. One of the users acts as an adversary targeting a common prompt template, issuing variants with different candidate values at the position of the secret (as described in Section 2.3).
Evaluation Baselines. We compare CacheSolidarity against the following baselines, based on the categorization in Table 2:
∙\bullet
Automatic Prefix Caching (APC): Enables reuse of common prefixes cached across all users (vLLM Team, 2025). This approach maximizes reuse and efficiency but offers no isolation or security guarantees.
∙\bullet
User Cache Isolation: Allocates dedicated KV cache regions per user to ensure isolation and security (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025). This eliminates the benefits of caching common prefixes, reducing efficiency.
∙\bullet
Selective Sharing: Uses semantic analysis (rule-based checks and LLM-based validation) to classify prompts as sensitive and selectively isolate them, sharing only non-sensitive ones, as proposed in SafeKV (Chu et al., 2026).
∙\bullet
CacheSolidarity: Our proposed mechanism that isolates prefixes based on sharing behavior across users, without relying on semantics, balancing security and performance.
Implementation Details of the Baselines.
CacheSolidarity is implemented on top of vLLM (vLLM Team, 2024) (version 0.8.5) with the V1 engine for multi-tenancy. To extend the KV cache as described in 3.2, we extend the KVCacheBlock class with the two metadata fields.
We introduce a new Detector component, as part of the Scheduler that detects malicious requests before scheduling and updates the new metadata fields attack_flag and owner_id.
We extend the metrics collection of vLLM to support the Activator component which is implemented in the asynchronous LLM execution layer.
User cache isolation is implemented by modifying vLLM to prepend a unique user identifier (a single token) to each request, effectively preventing prefix sharing across users.
The semantic-aware selective sharing baseline, SafeKV (Chu et al., 2026), is built on SGLang’s tree-based architecture (Team, 2024) and is not open-sourced. We therefore implement it on top of vLLM (vLLM Team, 2024) (version 0.8.5) V1 engine, following the methodology described in the paper, to the best of our understanding.
SafeKV consists of three components. First, an asynchronous three-stage detection pipeline that decides whether each KV entry is private or shareable. It uses (i) a rule-based detector covering 34 categories of sensitive information (pii-extract 0.0.2 (Villegas, 2024)), (ii) a lightweight LLM-based classifier (Llama-3.2-1B (Meta AI, 2024b)) for cases not matched by these rules, and (iii) a final step that uses the serving LLM to resolve remaining uncertain cases. Each stage performs a pass over the prompt to identify sensitive content and, when found, it produces a structured output (e.g., a JSON record specifying whether private information is present, along with its position and semantic category). Second, a cache index that enforces access control using per-entry privacy and ownership metadata, similar to CacheSolidarity. Third, a runtime safeguard that monitors user access patterns, specifically whether entries are repeatedly accessed by only a few users, and disables sharing when such behavior appears suspicious. All new cache entries are marked private by default, while the detection pipeline runs asynchronously. Once it completes, only the non-sensitive prefix will be marked as shareable. The runtime safeguard continuously runs in the background. Finally, while SGLang enforces metadata at token granularity, the vLLM implementation operates at the KV block level.
5.2. Comparison Against Baselines
In this section, we compare CacheSolidarity against the baselines, focusing on inference performance across workloads and models, system overheads, and security.
5.2.1. Across Workloads
Figure 7 reports average time-to-first-token (TTFT) and cache hit rate across the five representative workloads (Figure 7(a)) and their aggregate average. The reported values exclude the attacker. This experiment runs inference of Llama-13B on a single A100 GPU. Hence, for the SafeKV baseline, the validation LLM runs on the same GPU as the inference model, competing for GPU cycles and reducing the effective KV cache capacity compared to CacheSolidarity (Table 4). In addition, prefix reuse across users is delayed until the asynchronous semantic validation completes (either rule- or LLM-based), further limiting potential cache hits. Across workloads, most secrets (62%–81.3%) are detected by the rule-based Tier-1, with the remainder handled by Tier-2 (the validation LLM, Llama-3.2-1B). As inter-user reuse increases, more repeated prompts are handled by Tier-1, reducing reliance on LLM-based validation. For the average workload, 63.4% of secrets are detected by Tier-1 and 36.6% by Tier-2, with average latencies of 8.1 ms and 2.6 sec, respectively; Tier-3 is never reached. Although Tier-2 uses a lightweight LLM, its latency is dominated by response generation (i.e., JSON output) and by GPU contention, as it runs alongside the inference model on the same GPU. These semantic validation delays alongside the reduced KV cache capacity, combined with LRU eviction, may cause less frequently reused prefixes to be evicted before they are validated and shared across users.
Workloads with high intra-user reuse. In Workload 1 where users repeat similar prompts but do not share common prefixes, all baselines perform similar to cache isolation. Similarly, Workload 2 introduces moderate inter-user reuse. As expected, User Cache Isolation suffers lower hit rate because it misses shared prefixes, while CacheSolidarity stays very close to Prefix Caching, preserving most performance benefits. SafeKV has slightly reduced hit rate, thus slightly higher TTFT.
Workloads with high inter-user reuse. In Workload 4, where inter-user reuse dominates but some intra-user reuse remains, both CacheSolidarity and SafeKV experience reduced hit rates. However, SafeKV incurs higher TTFT, revealing a key limitation of semantic-based isolation beyond resource contention: prefixes under semantic validation cannot be reused across users, causing them to miss potential hits and, under high reuse, be evicted before reuse even occurs. This issue does not arise in CacheSolidarity, which enables immediate prefix reuse.
Workload 5 has high inter-user reuse and zero intra-user reuse, meaning that users ask similar prompts to each other but not to themselves, leading to zero hit rate of cache isolation. In addition, we see that CacheSolidarity’s lightweight design does not hurt performance: TTFT remains very close to Prefix Caching, and hit rate is similarly high. SafeKV, for the reasons mentioned already, shows reduced performance.
Average Case.
Across all workloads, CacheSolidarity significantly improves over User Cache Isolation while remaining within 5–10% of Prefix Caching, whereas SafeKV consistently incurs lower hit rates and higher TTFT due to the delay in reuse until semantic validation finishes and the reduced cache capacity in a single GPU. The hit-rate gap to Prefix Caching reflects false positives: safe prefixes isolated because CacheSolidarity relies on reuse behavior, not semantics.
5.2.2. Across LLM Models
Model (Abbrev.)
Model
CacheSolidarity
SafeKV
GB
%
GB
%
Gemma3-4B (Google DeepMind, 2025)
8.6 GB
31.4 GB
78.5%
28.8 GB
77.0%
Llava-0.5B (LLaVA Team, 2024a)
1.68 GB
38.32 GB
95.8%
35.72 GB
95.5%
Llava-7B (LLaVA Team, 2024b)
15.03 GB
24.97 GB
62.4%
22.37 GB
59.8%
Llama2-7B (Meta AI, 2023b)
12.6 GB
27.4 GB
68.5%
24.8 GB
66.3%
Llama2-13B (Meta AI, 2023a)
24.3 GB
15.7 GB
39.3%
13.1GB
35.0%
Llama3-70B (Meta AI, 2024a)
131.5 GB
56.6 GB
30.05%
56.5 GB
30.05%
Qwen2-2B (Alibaba Cloud, 2024a)
4.15 GB
35.85 GB
89.6%
33.25 GB
88.9%
Qwen2.5-3B (Alibaba Cloud, 2024c)
7.16 GB
32.84 GB
82.1%
30.24 GB
80.9%
Qwen2-7B (Alibaba Cloud, 2024b)
15.53 GB
24.47 GB
61.2%
21.87 GB
58.5%
Qwen2.5-7B (Alibaba Cloud, 2024d)
15.63 GB
24.37 GB
60.9%
21.77 GB
58.2%
Table 4. Evaluated LLM models and memory allocation.
Figure 8. Hit rate and TTFT across LLMs.
Figure 8 reports cache hit rate and TTFT of CacheSolidarity and the baselines across LLMs (Table 4), evaluated on a single A100 GPU under the average workload (Figure 7(a)). Model size affects both KV cache capacity (larger models leave less space) and inference speed, with smaller models achieving lower TTFT (Papaioannou and Doudali, 2024).
For SafeKV, the LLM-based validator runs on the same GPU for all A100 experiments, as done in Section 5.2.1. However, for Llama3-70B, which runs on a 4 H100 GPU server with TP = 2, the validator executes on a separate GPU, avoiding resource contention and preserving KV cache capacity.
We observe that CacheSolidarity effectively closes the performance gap between Prefix Caching and User Cache Isolation remaining within a 6% TTFT margin of Prefix Caching, while significantly outperforming User Cache Isolation. Two cases in the performance comparison of the baselines stand out. First,
for Llama2-13B the KV cache size is very small (Table 4), almost half the size compared to the rest of the models, causing frequent evictions and more cache misses, reducing the hit rate of CacheSolidarity. In this case, SafeKV exhibits the lowest hit rate due to the combined effect of even smaller effective cache capacity and resource contention with its LLM-based validator running on the same A100 GPU.
However, this limitation is mitigated when executing the Llama3-70B model on a 4×H100 GPU server. This is the only case where SafeKV performs significantly better than cache isolation and closer to CacheSolidarity. This is because the validator runs on a separate GPU, eliminating resource contention, while the longer inference time of the 70B model hides semantic validation overheads, also removing the validation-delay effects observed in Section 5.2.1.
In conclusion, the performance of CacheSolidarity remains close to Prefix Caching and better than semantic-based alternatives across all LLM model families and sizes.
Figure 9. Baseline comparison of TTFT and Hit Rate across increasing RPS for workload 5.
Component
Time
Memory
Detector
0.004 ms per request
32 bytes per cache entry
Activator
0.003 ms
16 bytes * len(window)
Table 5. Overhead of CacheSolidarity’s components.
5.2.3. Across Request Rates
Figure 9 shows the performance comparison across baselines and increasing request rate (RPS) for the Llama2-13B model on a single A100 GPU. We use Workload 5 where any reuse comes from sharing prefixes across users, which directly stresses the mechanisms that enable or delay cross-user reuse.
Regarding hit rate, it is zero for User Cache Isolation as there is no intra-user reuse, while CacheSolidarity remains high and close to Prefix Caching. For these baselines, hit rate stays constant as RPS increases, since reuse patterns remain unchanged. In contrast, SafeKV’s hit rate drops with increasing load due to limited KV cache capacity and semantic validation delays: prefixes are blocked from reuse during validation, leading to delayed hits, coupled with higher request rates that lead to higher cache eviction rates under LRU.
This is reflected in the average TTFT, which increases more sharply for SafeKV compared to the other baselines, where a modest increase is expected due to the higher load.
5.2.4. Overheads.
Table 5 summarizes the operational overheads introduced by the two components of CacheSolidarity in terms of latency and memory resources.
In terms of per-request latency, CacheSolidarity’s modifications over vanilla vLLM (i.e., the selective isolation scheme and the activator component) introduce an average per-request overhead of only 0.007 ms (0.004 ms due to the detector component and 0.003 ms due to the activator component).
In terms of memory, the metadata introduced by the detector component amount to 32 bytes per cache entry, since each KVCache block was extended with two metadata fields—owner_id and attack_flag—of type int.22
2
Since vLLM is implemented in Python, adding two int fields (as Python objects) to the KVCache class results in an increase of 32 bytes.
In contrast, the activator component stores 1 floating point value per request in the sliding window.33
3
Again, a floating point value in Python takes up to 16 bytes.
Notably, overheads scale with the size of the KV cache (Table 4), rather than the number of users, since no per-user state is maintained. SafeKV (Chu et al., 2026) uses similar metadata to enforce per-user prefix isolation, while Table 4 also captures its additional storage overhead, when the LLM-based validator (Tier-2) is colocated on the same GPU, reducing the available KV cache.
5.2.5. Security.
Figure 6(a) compares the fraction of prompts secured by CacheSolidarity across real-world datasets (Table 1) with the Activator set to θ=100%\theta=100\%, against the semantic-aware baseline SafeKV (Chu et al., 2026). Overall, CacheSolidarity achieves high protection (96.12%), closely matching SafeKV (96.95%). For SafeKV, across datasets, 62.5% of prompts are handled by Tier-1 (6.5 ms average latency), 32.19% by Tier-2 (Llama-3.2-1B, 1.8 s), and 2.26% by Tier-3 (Llama2-13B, 4.5 s). The higher latency of Tier-2 and Tier-3 is due to LLM-based processing, which scales with the LLM size and includes the time it takes to generate the structured JSON output. The remaining 3.05% of prompts contain secrets that are not detected due to semantic limitations. SafeKV fails to secure this small subset of prompts due to misclassification, particularly for implicit or context-dependent information (e.g., “I work in the only bakery in the city”), obfuscated forms (e.g., “john dot smith at protonmail dot com”), and cross-alphabet, multilingual, or inferred sensitive information (e.g., “I pick up insulin weekly”). In contrast, CacheSolidarity successfully protects these cases, but fails in a small subset of first-try, first-entry cases, discussed in Section 4.1.
5.3. Sensitivity Analysis
We evaluate CacheSolidarity’s sensitivity to the Activator’s threshold θ\theta. Given the KDE overlap over a window hh, the Activator enables prefix isolation (the Detector) when overlap(hh) <θ<\theta. Thus, θ=0%\theta=0\% corresponds to the Prefix Caching baseline (no security) and θ=100%\theta=100\% to CacheSolidarity with the Detector always on. We run Llama2-13B on a single A100 GPU over Workload 4 for 10 minutes. Figure 10 shows how the overlap varies over time, due to the workload’s prompt lengths and request rate. We consider a continuous attack setting, marking in red the time points where the attacker successfully reconstructs sensitive information and attempts to steal the prompt.
Figure 10 reports the corresponding attack success rate (ASR), capturing how often attacks succeed as a function of both the threshold θ\theta and the strength of the timing side channel. When θ=0%\theta=0\%, the ASR is below 100% because some attacks inherently fail due to weak timing differences (high KDE overlap) regardless of the threshold. As θ\theta increases, the ASR decreases, since the Activator isolates a larger fraction of prefixes. Intuitively, for a given θ\theta, CacheSolidarity protects against attacks that fall within the green region in Figure 10. Beyond θ≈60%\theta\approx 60\%, CacheSolidarity reduces the ASR to zero, fully preventing successful prompt stealing attacks.
Figure 10 shows the corresponding performance (hit rate and average TTFT). As expected, higher θ\theta leads to more prefix isolation, thus reduced hit rate and increased TTFT, capturing the performance-security trade-off that CacheSolidarity’s Activator introduces.
Recommendations on the use of prefix isolation and its activation threshold.
Table 6 summarizes threshold recommendations for system administrators. For privacy-critical applications (e.g., medical, legal, confidential chats), high thresholds (80–100%) provide strong protection. For general-purpose applications (e.g., customer support, productivity assistants), mid-range thresholds (50–70%) balance security and performance. For latency-sensitive or high-throughput systems (e.g., real-time assistants, streaming agents, or high-traffic APIs), lower thresholds (20–40%) prioritize performance, as high load already limits attack success.
Lastly, for privacy-critical applications, even high thresholds may fail to secure a small fraction of prompts, as discussed in §4.1 and §5.2.5. If absolute security is needed, full cache isolation is the only reliable approach. Neither CacheSolidarity nor SafeKV provide complete security: both leave approximately 3-4% of prompts unprotected (Figure 6), due to CacheSolidarity’s first-entry, first-try limitation and semantic misclassification in SafeKV, respectively.
Figure 10. Sensitivity analysis of the Activator’s threshold θ\theta selection on system security and performance.
Application Type
θ\theta
Rationale
Privacy-critical
80-100%
High security, acceptable performance overheads
General-purpose
50-70%
Balanced between security and cache reuse, performance
Latency-sensitive
20-40%
High performance, less isolation as high load already limits attack success
Table 6. Recommended threshold θ\theta by application type.
6. Related Work
Optimizations of LLM Serving Systems.
Recent system-level optimizations use approximate techniques, such as modifying the attention mechanism (Liu et al., 2024a; Xiao et al., 2024; Jiang et al., 2024; Desai et al., 2025; Zhu et al., 2025), reusing (Gim et al., 2024; Gao et al., 2024; Yao et al., 2025), or compressing the KV cache (Lee et al., 2024; Fu et al., 2024; Sun et al., 2025; Liu et al., 2024b; Tang et al., 2024; Shi et al., 2026).
However, these techniques sacrifice accuracy for faster inference.
In contrast, exact techniques aim to reduce the latency by efficiently managing the KV cache (Kwon et al., 2023; Qin et al., 2025; Yu et al., 2025), sharing prefixes (Ye et al., 2024; Jin et al., 2025; Juravsky et al., 2024; Lin et al., 2024), or optimizing scheduling decisions (Agrawal et al., 2023; Agrawal et al., 2024b; Agrawal et al., 2024a; Holmes et al., 2024; Zhao et al., 2024; Chen et al., 2024).
Other approaches attempt to mitigate the impact of long-context processing by disaggregating the prefill and decode phases of inference (Zhong et al., 2024; Patel et al., 2024) or rescheduling requests to reduce memory fragmentation (Sun et al., 2024).
Side-channels and performance optimizations.
Performance optimizations improve average-case resource usage (e.g., latency, memory, energy), but introduce variability that can expose side channels exploitable by attackers. Historically, attacks targeted physical effects such as power or electromagnetic leakage, requiring direct access. More recently, they exploit shared hardware resources such as caches (Yarom and Falkner, 2014), DRAM (Pessl et al., 2016), BPUs (Evtyushkin et al., 2018),
and execution ports (Aldaya et al., 2019). Side channels also arise in software systems like browsers (Vila and Kopf, 2017; Snyder et al., 2023), operating systems (Hähnel et al., 2017), and network protocols (Mehta et al., 2022; Wright et al., 2008).
Timing Side-Channel Attacks in LLM Serving Systems.
Recent work shows that optimizations such as KV caching and prefix reuse introduce exploitable timing leaks, where differences between cache hits and misses can expose private information in prompts (Song et al., 2025; Zheng et al., 2024b; Gu et al., 2025). Beyond caching, inference optimizations (e.g., speculative decoding) also introduce timing variations that can leak sensitive information (Carlini and Nasr, 2024). Other work exploits scheduling behavior rather than timing differences to reconstruct prompts (Wu et al., 2025). Together, these works highlight the vulnerabilities introduced by LLM serving optimizations and the need for robust defenses.
7. Summary
We present CacheSolidarity, a system that secures LLM serving against timing side-channel attacks introduced by Automatic Prefix Caching (APC) without sacrificing performance. CacheSolidarity monitors cross-user prefix reuse, flags suspicious reuse of cached prefixes, and selectively isolates affected prefixes using lightweight KV cache metadata, without the need to analyze prompt semantics. Our evaluation shows that CacheSolidarity provides effective protection against prompt-stealing attacks while maintaining high performance and scalability, bridging the gap between insecure APC and slow isolation-based defenses.
Acknowledgements.
We thank the anonymous reviewers for their constructive feedback.
The project has been partially funded by the Sponsor European Research Council https://erc.europa.eu/ under the ERC Consolidator grant PRIMULA Grant #101230068.44
4
Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the ERC. Neither the European Union nor the ERC can be held responsible for them.
Also from the Spanish Ministry of Science, Innovation and Universities (MICIU/AEI/10.13039/501100011033) under the projects EUR2025-164828 (SINTRAZAS), RYC2021-032614-I, PID2022-142290 OB-I00 (ESPADA), and CEX2024-001471-M; the Madrid Regional Government through the César Nombela grant (2024-T1/COM-31302) and from the Comunidad de Madrid through the DATIA project, co-funded by FEDER UE.
References
Acharya and Shrestha (2025)
P. Acharya and L. Shrestha
A comparative study of light-weight language models for PII masking and their deployment for real conversational texts.
arXiv preprint arXiv:2512.18608.
External Links: Document
Cited by: §2.3.
Agrawal et al. (2024a)
A. Agrawal, J. Chen, Í. Goiri, R. Ramjee, C. Zhang, A. Tumanov, and E. Choukse
Mnemosyne: parallelization strategies for efficiently serving multi-million context length llm inference requests without approximations.
External Links: 2409.17264,
Link
Cited by: §6.
Agrawal et al. (2024b)
A. Agrawal, N. Kedia, A. Panwar, J. Mohan, N. Kwatra, B. S. Gulavani, A. Tumanov, and R. Ramjee
Taming throughput-latency tradeoff in llm inference with sarathi-serve.
In Proceedings of the 18th USENIX Conference on Operating Systems Design and Implementation,
OSDI’24, USA.
External Links: ISBN 978-1-939133-40-3
Cited by: §1,
Example 2.2,
§6.
Agrawal et al. (2023)
A. Agrawal, A. Panwar, J. Mohan, N. Kwatra, B. S. Gulavani, and R. Ramjee
SARATHI: efficient llm inference by piggybacking decodes with chunked prefills.
External Links: 2308.16369,
Link
Cited by: §1,
Example 2.2,
§5.1,
§6.
Ai4Privacy (2024)
Ai4Privacy
PII-masking-200k: a dataset for personally identifiable information masking.
Note: https://huggingface.co/datasets/ai4privacy/pii-masking-200kAccessed: 2024
Cited by: §2.3.
Ai4Privacy (2026)
Ai4privacy (version 0.5.0)
Note: PyPI package version 0.5.0, accessed: 2026-05-20
External Links: Link
Cited by: §2.3.
Aldaya et al. (2019)
A. C. Aldaya, B. B. Brumley, S. ul Hassan, C. P. García, and N. Tuveri
Port Contention for Fun and Profit.
In Proceedings of the 40th IEEE Symposium on Security and Privacy,
S&P ’19.
Cited by: §6.
Alibaba Cloud (2024a)
Alibaba CloudQwen2-vl 2b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Alibaba Cloud (2024b)
Alibaba CloudQwen2-vl 7b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Alibaba Cloud (2024c)
Alibaba CloudQwen2.5-vl 3b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Alibaba Cloud (2024d)
Alibaba CloudQwen2.5-vl 7b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Amazon Web Services (2025)
Amazon Web Services
Prompt caching for Amazon Bedrock.
Note: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
Cited by: §2.4,
Table 3.
anon8231489123 (2023)
anon8231489123
ShareGPT Vicuna unfiltered.
Note: https://huggingface.co/datasets/anon8231489123/ShareGPT%20Vicuna%20unfilteredDataset on Hugging Face
Cited by: Table 1,
§5.1.
Anthropic (2026)
Anthropic
Prompt caching — Claude API documentation.
Note: https://docs.anthropic.com/en/docs/build-with-claude/prompt-cachingWorkspace-level isolation enforced from February 5, 2026
Cited by: §2.4,
Table 3.
Bang (2023)
F. Bang
GPTCache: an open-source semantic cache for LLM applications enabling faster answers and cost savings.
In Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023),
pp. 212–218.
Cited by: §1.
Bortz and Boneh (2007)
A. Bortz and D. Boneh
Exposing private information by timing web applications.
In Proceedings of the 16th International Conference on World Wide Web,
WWW ’07, New York, NY, USA, pp. 621–628.
External Links: ISBN 9781595936547,
Link,
Document
Cited by: §1.
Brown et al. (2020)
T. Brown, B. Mann, N. Ryder, et al.
Language models are few-shot learners.
Advances in Neural Information Processing Systems 33, pp. 1877–1901.
Cited by: §1,
§2.1.
Carlini and Nasr (2024)
N. Carlini and M. Nasr
Remote timing attacks on efficient language model inference.
External Links: 2410.17175,
Link
Cited by: §1,
§2.4,
Table 2,
§6.
Chen et al. (2024)
S. Chen, Y. Lin, M. Zhang, and Y. Wu
Efficient and economic large language model inference with attention offloading.
External Links: 2405.01814,
Link
Cited by: §6.
Cheng et al. (2025)
S. Cheng, Z. Li, S. Meng, M. Ren, H. Xu, S. Hao, C. Yue, and F. Zhang
Understanding PII leakage in large language models: a systematic survey.
In Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence (IJCAI-25),
pp. 10409–10417.
External Links: Document
Cited by: §2.3.
Chu et al. (2026)
K. Chu, Z. Lin, D. Xiang, Z. Shen, J. Su, C. Chu, Y. Yang, W. Zhang, W. Wu, and W. Zhang
Selective kv-cache sharing to mitigate timing side-channels in llm inference.
External Links: 2508.08438,
Link
Cited by: §1,
§2.2,
§2.3,
§2.4,
§2.4,
Table 2,
§3.1,
§4.1,
3rd item,
§5.1,
§5.2.4,
§5.2.5.
Dahlberg and Pulls (2023)
R. Dahlberg and T. Pulls
Timeless timing attacks and preload defenses in tor’s DNS cache.
In 32nd USENIX Security Symposium (USENIX Security 23),
Anaheim, CA, pp. 2635–2652.
External Links: ISBN 978-1-939133-37-3,
Link
Cited by: §1.
Data Provenance Initiative (2024)
Data Provenance Initiative
Commercial flan collection: dialog.
Note: https://huggingface.co/datasets/DataProvenanceInitiative/Commercial-Flan-Collection-DialogAccessed: 2026-05-20
Cited by: Table 1.
DeepMind (2025)
DeepMindGemini(Website)
External Links: Link
Cited by: §1,
§2.1.
DeepSeek (2024)
DeepSeekDeepSeek api docs: deepseek api introduces context caching on disk, cutting prices by an order of magnitude(Website)
Note: Accessed: 2025-07-17
External Links: Link
Cited by: §1,
§2.1.
Denning (1976)
D. E. Denning
A lattice model of secure information flow.
Communications of the ACM 19 (5), pp. 236–243.
Cited by: §4.1.
Desai et al. (2025)
A. Desai, S. Yang, A. Cuadron, A. Klimovic, M. Zaharia, J. E. Gonzalez, and I. Stoica
HashAttention: semantic sparsity for faster inference.
In Proceedings of the 42nd International Conference on Machine Learning (ICML),
PMLR, Vol. 267.
Cited by: §6.
Devlin et al. (2019)
J. Devlin, M. Chang, K. Lee, and K. Toutanova
BERT: pre-training of deep bidirectional transformers for language understanding.
In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers),
pp. 4171–4186.
External Links: Document
Cited by: §2.3,
§5.1.
Evtyushkin et al. (2018)
D. Evtyushkin, R. Riley, N. B. Abu-Ghazaleh, and D. Ponomarev
BranchScope: A New Side-Channel Attack on Directional Branch Predictor.
In Proceedings of the 23rd International Conference on Architectural Support for Programming Languages and Operating Systems,
ASPLOS ’18.
Cited by: §6.
Fu et al. (2024)
Q. Fu, M. Cho, T. Merth, S. Mehta, M. Rastegari, and M. Najibi
LazyLLM: Dynamic Token Pruning for Efficient Long Context LLM Inference.
In ICML 2024 Workshops: ES-FoMo-II,
External Links: Link
Cited by: §6.
Gao et al. (2024)
B. Gao, Z. He, P. Sharma, Q. Kang, D. Jevdjic, J. Deng, X. Yang, Z. Yu, and P. Zuo
Cost-efficient large language model serving for multi-turn conversations with cachedattention.
In Proceedings of the 2024 USENIX Conference on Usenix Annual Technical Conference,
USENIX ATC’24, USA.
External Links: ISBN 978-1-939133-41-0
Cited by: §6.
Gim et al. (2024)
I. Gim, G. Chen, S. Lee, N. Sarda, A. Khandelwal, and L. Zhong
Prompt cache: modular attention reuse for low-latency inference.
In Proceedings of Machine Learning and Systems (MLSys),
Cited by: §6.
GitHub Security Advisory (2025)
GitHub Security Advisory
CVE-2025-25183: vLLM prefix cache hash collision (GHSA-rm76-4mrf-v9r8) and timing side-channel (GHSA-4qjh-9fv9-r85r).
Note: https://github.com/vllm-project/vllm/security/advisories/
Cited by: Table 3.
Goguen and Meseguer (1982)
J. A. Goguen and J. Meseguer
Security policies and security models.
In Proceedings of the IEEE Symposium on Security and Privacy,
pp. 11–20.
Cited by: §4.1.
Goguen and Meseguer (1984)
J. A. Goguen and J. Meseguer
Unwinding and inference control.
In Proceedings of the IEEE Symposium on Security and Privacy,
pp. 75–86.
Cited by: §4.1.
Google Cloud (2025)
Google Cloud
Context caching — Gemini API documentation.
Note: https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview
Cited by: §2.4,
Table 3.
Google DeepMind (2025)
Google DeepMindGemma 3 4b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Google Research (2022)
Google Research
Securing private data at scale with differentially private partition selection.
Note: https://research.google/blog/securing-private-data-at-scale-with-differentially-private-partition-selection/Accessed: 2026-05
Cited by: §4.2.
Gras et al. (2017)
B. Gras, K. Razavi, E. Bosman, H. Bos, and C. Giuffrida
ASLR on the line: practical cache attacks on the MMU.
In Proceedings of the Network and Distributed System Security Symposium (NDSS ’17),
External Links: Link
Cited by: §2.4.
Gruss et al. (2019)
D. Gruss, E. Kraft, T. Tiwari, M. Schwarz, A. Trachtenberg, J. Hennessey, A. Ionescu, and A. Fogh
Page cache attacks.
In Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security,
CCS ’19, New York, NY, USA, pp. 167–180.
External Links: ISBN 9781450367479,
Link,
Document
Cited by: §1.
Gu et al. (2025)
C. Gu, X. L. Li, R. Kuditipudi, P. Liang, and T. Hashimoto
Auditing prompt caching in language model APIs.
In Proceedings of the 42nd International Conference on Machine Learning, A. Singh, M. Fazel, D. Hsu, S. Lacoste-Julien, F. Berkenkamp, T. Maharaj, K. Wagstaff, and J. Zhu (Eds.),
Proceedings of Machine Learning Research, Vol. 267, pp. 20477–20496.
External Links: Link
Cited by: §1,
§1,
§1,
§2.2,
§2.3,
§2.4,
Table 2,
§3.1,
2nd item,
§6.
Hähnel et al. (2017)
M. Hähnel, W. Cui, and M. Peinado
High-resolution side channels for untrusted operating systems.
In Proceedings of the 2017 USENIX Conference on Usenix Annual Technical Conference,
USENIX ATC ’17, USA, pp. 299–312.
External Links: ISBN 9781931971386
Cited by: §6.
Holmes et al. (2024)
C. Holmes, M. Tanaka, M. Wyatt, A. A. Awan, J. Rasley, S. Rajbhandari, R. Y. Aminabadi, H. Qin, A. Bakhtiari, L. Kurilenko, and Y. He
DeepSpeed-fastgen: high-throughput text generation for llms via mii and deepspeed-inference.
External Links: 2401.08671,
Link
Cited by: §1,
§6.
Inman and Bradley (1989)
H. F. Inman and E. L. Bradley
The overlapping coefficient as a measure of agreement between probability distributions.
Communications in Statistics-Theory and Methods 18 (10), pp. 3851–3874.
External Links: Document
Cited by: §2.2,
§3.3.
Jiang et al. (2024)
H. Jiang, Y. Li, C. Zhang, Q. Wu, X. Luo, S. Ahn, Z. Han, A. H. Abdi, D. Li, C. Lin, Y. Yang, and L. Qiu
MInference 1.0: accelerating pre-filling for long-context llms via dynamic sparse attention.
In Advances in Neural Information Processing Systems (NeurIPS),
Vol. 37.
Cited by: §6.
Jin et al. (2025)
C. Jin, Z. Zhang, X. Jiang, F. Liu, S. Liu, X. Liu, and X. Jin
RAGCache: efficient knowledge caching for retrieval-augmented generation.
ACM Trans. Comput. Syst. 44 (1).
External Links: ISSN 0734-2071,
Link,
Document
Cited by: §6.
Juravsky et al. (2024)
J. Juravsky, B. Brown, R. S. Ehrlich, D. Y. Fu, C. Re, and A. Mirhoseini
Hydragen: high-throughput LLM inference with shared prefixes.
In Workshop on Efficient Systems for Foundation Models II @ ICML2024,
External Links: Link
Cited by: §1,
§6.
Kohlbrenner and Shacham (2016)
D. Kohlbrenner and H. Shacham
Trusted browsers for uncertain times.
In Proceedings of the 25th USENIX Conference on Security Symposium,
SEC’16, USA, pp. 463–480.
External Links: ISBN 9781931971324
Cited by: §2.4.
Kwon et al. (2023)
W. Kwon, Z. Li, S. Zhuang, Y. Sheng, L. Zheng, C. H. Yu, J. E. Gonzalez, H. Zhang, and I. Stoica
Efficient memory management for large language model serving with PagedAttention.
In Proceedings of the 29th Symposium on Operating Systems Principles (SOSP ’23),
pp. 611–626.
External Links: Document
Cited by: §1,
§2.1,
§5.1,
§6.
Lee et al. (2024)
W. Lee, J. Lee, J. Seo, and J. Sim
InfiniGen: efficient generative inference of large language models with dynamic KV cache management.
In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24),
Santa Clara, CA, pp. 155–172.
External Links: ISBN 978-1-939133-40-3,
Link
Cited by: §1,
§6.
Lin et al. (2024)
J. Lin, S. Q. Zhang, and A. Leon-Garcia
SLLM: accelerating llm inference using semantic load balancing with shared memory data structures.
In 2024 25th International Symposium on Quality Electronic Design (ISQED),
Vol. , pp. 1–6.
External Links: Document
Cited by: §6.
Liu et al. (2024a)
H. Liu, M. Zaharia, and P. Abbeel
Ring attention with blockwise transformers for near-infinite context.
In International Conference on Learning Representations (ICLR),
Cited by: §6.
Liu et al. (2024b)
Y. Liu, H. Li, Y. Cheng, S. Ray, Y. Huang, Q. Zhang, K. Du, J. Yao, S. Lu, G. Ananthanarayanan, M. Maire, H. Hoffmann, A. Holtzman, and J. Jiang
CacheGen: kv cache compression and streaming for fast large language model serving.
In Proceedings of the ACM SIGCOMM 2024 Conference,
ACM SIGCOMM ’24, New York, NY, USA, pp. 38–56.
External Links: ISBN 9798400706141,
Link,
Document
Cited by: §6.
LLaVA Team (2024a)
LLaVA TeamLLaVA-onevision qwen2 0.5b (ov-hf)(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
LLaVA Team (2024b)
LLaVA TeamLLaVA-onevision qwen2 7b ov-chat (hf)(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Mehta et al. (2022)
A. Mehta, M. Alzayat, R. D. Viti, B. B. Brandenburg, P. Druschel, and D. Garg
Pacer: comprehensive network Side-Channel mitigation in the cloud.
In 31st USENIX Security Symposium (USENIX Security 22),
Boston, MA, pp. 2819–2838.
External Links: ISBN 978-1-939133-31-1,
Link
Cited by: §6.
Meta AI (2023a)
Meta AILlama 2 13b chat model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Meta AI (2023b)
Meta AILlama 2 7b chat model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Meta AI (2024a)
Meta AI
Llama-3.1-70b.
Note: https://huggingface.co/meta-llama/Llama-3.1-70BReleased July 23, 2024. License: Llama 3.1 Community License
Cited by: Table 4.
Meta AI (2024b)
Meta AI
The llama 3.2 collection of open multilingual large language models.
Note: https://huggingface.co/meta-llama/Llama-3.2-1BAccessed: 2026-06-02
Cited by: §5.1.
Microsoft Azure (2025)
Microsoft Azure
Azure OpenAI service — data privacy and prompt caching.
Note: https://learn.microsoft.com/en-us/azure/ai-services/openai/
Cited by: §2.4,
Table 3.
National Vulnerability Database (2025)
National Vulnerability Database
CVE-2025-46570.
Note: https://nvd.nist.gov/vuln/detail/CVE-2025-46570Accessed: 2026-05-29
Cited by: §2.4.
OpenAI (2024)
OpenAIPrompt caching: reduce latency and cost with prompt caching(Website)
Note: Accessed: 2025-07-17
External Links: Link
Cited by: §1,
§2.1,
§2.4,
Table 3,
§4.1.
OpenAssistant (2023)
OpenAssistant
OpenAssistant conversations dataset (oasst1).
Note: https://huggingface.co/datasets/OpenAssistant/oasst1Accessed: 2026-05-20
Cited by: Table 1.
OpenBMB (2023)
OpenBMB
UltraChat: an open-source large-scale multi-turn dialogue dataset.
Note: https://huggingface.co/datasets/openbmb/UltraChatAccessed: 2026-05-20
Cited by: Table 1.
Pang et al. (2024)
Z. Pang, W. Wang, and Y. Liao
Cache partitioning for mitigating timing side-channel attacks in llm serving systems.
In 2024 6th International Conference on Frontier Technologies of Information and Computer (ICFTIC),
Vol. , pp. 1238–1245.
External Links: Document
Cited by: §1,
§1,
§2.2,
§2.4,
Table 2,
§3.1,
2nd item.
Papaioannou and Doudali (2024)
K. Papaioannou and T. D. Doudali
The importance of workload choice in evaluating llm inference systems.
In Proceedings of the 4th Workshop on Machine Learning and Systems,
EuroMLSys ’24, New York, NY, USA, pp. 39–46.
External Links: ISBN 9798400705410,
Link,
Document
Cited by: Example 2.2,
§5.2.2.
Patel et al. (2024)
P. Patel, E. Choukse, C. Zhang, A. Shah, Í. Goiri, S. Maleki, and R. Bianchini
Splitwise: efficient generative llm inference using phase splitting.
In 2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA),
Vol. , pp. 118–132.
External Links: Document
Cited by: §5.1,
§6.
Pessl et al. (2016)
P. Pessl, D. Gruss, C. Maurice, M. Schwarz, and S. Mangard
DRAMA: exploiting DRAM addressing for cross-CPU attacks.
In Proceedings of the 25th USENIX Security Symposium,
USENIX Security ’16.
Cited by: §6.
Qin et al. (2025)
R. Qin, Z. Li, W. He, J. Cui, F. Ren, M. Zhang, Y. Wu, W. Zheng, and X. Xu
Mooncake: trading more storage for less computation — a KVCache-centric architecture for serving LLM chatbot.
In 23rd USENIX Conference on File and Storage Technologies (FAST ’25),
pp. 155–170.
Cited by: §1,
§2.1,
§6.
Sabelfeld and Myers (2003)
A. Sabelfeld and A. C. Myers
Language-based information-flow security.
Vol. 21, pp. 5–19.
Cited by: §4.1.
Shi et al. (2026)
Z. Shi, Y. Ming, X. Nguyen, Y. Liang, and S. Joty
Discovering the gems in early layers: accelerating long-context LLMs with 1000x input token reduction.
In Findings of the Association for Computational Linguistics: ACL 2026,
San Diego, California, United States, pp. 13839–13857.
External Links: Document
Cited by: §6.
Singh and Narayanan (2025)
D. Singh and S. Narayanan
Unmasking the reality of PII masking models: performance gaps and the call for accountability.
arXiv preprint arXiv:2504.12308.
External Links: Document
Cited by: §2.3.
Snyder et al. (2023)
P. Snyder, S. Karami, A. Edelstein, B. Livshits, and H. Haddadi
Pool-party: exploiting browser resource pools for web tracking.
In Proceedings of the 32nd USENIX Conference on Security Symposium,
SEC ’23, USA.
External Links: ISBN 978-1-939133-37-3
Cited by: §6.
Song et al. (2025)
L. Song, Z. Pang, W. Wang, Z. Wang, X. Wang, H. Chen, W. Song, Y. Jin, D. Meng, and R. Hou
The early bird catches the leak: unveiling timing side channels in llm serving systems.
IEEE Transactions on Information Forensics and Security 20 (), pp. 11431–11446.
External Links: Document
Cited by: §1,
§2.3,
§6.
Sun et al. (2024)
B. Sun, Z. Huang, H. Zhao, W. Xiao, X. Zhang, Y. Li, and W. Lin
Llumnix: dynamic scheduling for large language model serving.
In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24),
Santa Clara, CA, pp. 173–191.
External Links: ISBN 978-1-939133-40-3,
Link
Cited by: §1,
§6.
Sun et al. (2025)
H. Sun, L. Chang, W. Bao, S. Zheng, N. Zheng, X. Liu, H. Dong, Y. Chi, and B. Chen
ShadowKV: kv cache in shadows for high-throughput long-context llm inference.
In Proceedings of the 42nd International Conference on Machine Learning (ICML),
PMLR, Vol. 267.
Cited by: §6.
Tang et al. (2024)
J. Tang, Y. Zhao, K. Zhu, G. Xiao, B. Kasikci, and S. Han
QUEST: query-aware sparsity for efficient long-context llm inference.
In Proceedings of the 41st International Conference on Machine Learning,
ICML’24.
Cited by: §6.
Team (2024)
S. Team
SGLang: efficient serving for large language models.
Note: https://github.com/sgl-project/sglang
Cited by: §5.1.
Touvron et al. (2023)
H. Touvron et al.
LLaMA: open and efficient foundation language models.
arXiv preprint arXiv:2302.13971.
Cited by: §2.1.
Vila and Kopf (2017)
P. Vila and B. Kopf
Loophole: timing attacks on shared event loops in chrome.
In 26th USENIX Security Symposium (USENIX Security 17),
Vancouver, BC, pp. 849–864.
External Links: ISBN 978-1-931971-40-9,
Link
Cited by: §2.4,
§6.
Villegas (2024)
Pii-extract-base: extraction of pii from text chunks
Note: Python package
External Links: Link
Cited by: §5.1.
vLLM Contributors (2025)
vLLM Contributors
Prevent side-channel attacks via cache salting — Pull Request #17045.
Note: https://github.com/vllm-project/vllm/pull/17045
Cited by: §2.4,
Table 3.
vLLM Team (2024)
vLLM Team
VLLM: high-throughput serving for large language models.
Note: https://github.com/vllm-project/vllm
Cited by: §1,
§5.1,
§5.1,
§5.1.
vLLM Team (2025)
vLLM Team
Automatic prefix caching in vllm.
Note: https://docs.vllm.ai/en/latest/features/automatic_prefix_caching/
Cited by: §2.1,
1st item.
Volpano et al. (1996)
D. Volpano, C. Irvine, and G. Smith
A sound type system for secure flow analysis.
Journal of Computer Security 4 (2-3), pp. 167–187.
Cited by: §4.1.
Wright et al. (2008)
C. V. Wright, L. Ballard, S. E. Coull, F. Monrose, and G. M. Masson
Spot me if you can: uncovering spoken phrases in encrypted voip conversations.
In 2008 IEEE Symposium on Security and Privacy (sp 2008),
Vol. , pp. 35–49.
External Links: Document
Cited by: §6.
Wu et al. (2025)
G. Wu, Z. Zhang, Y. Zhang, W. Wang, J. Niu, Y. Wu, and Y. Zhang
I know what you asked: prompt leakage via kv-cache sharing in multi-tenant llm serving.
In Proceedings of the 2025 Network and Distributed System Security (NDSS) Symposium. San Diego, CA, USA,
Cited by: §6.
Xiao et al. (2024)
G. Xiao, Y. Tian, B. Chen, S. Han, and M. Lewis
Efficient streaming language models with attention sinks.
External Links: 2309.17453,
Link
Cited by: §6.
Yao et al. (2025)
J. Yao, H. Li, Y. Liu, S. Ray, Y. Cheng, Q. Zhang, K. Du, S. Lu, and J. Jiang
CacheBlend: fast large language model serving for rag with cached knowledge fusion.
In Proceedings of the Twentieth European Conference on Computer Systems,
EuroSys ’25, New York, NY, USA, pp. 94–109.
External Links: ISBN 9798400711961,
Link,
Document
Cited by: §6.
Yarom and Falkner (2014)
Y. Yarom and K. Falkner
FLUSH+RELOAD: a high resolution, low noise, l3 cache side-channel attack.
In Proceedings of the 23rd USENIX Security Symposium,
USENIX Security ’14.
Cited by: §1,
§6.
Ye et al. (2024)
L. Ye, Z. Tao, Y. Huang, and Y. Li
ChunkAttention: efficient self-attention with prefix-aware KV cache and two-phase partition.
In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), L. Ku, A. Martins, and V. Srikumar (Eds.),
Bangkok, Thailand, pp. 11608–11620.
External Links: Link,
Document
Cited by: §1,
§6.
Yu et al. (2025)
L. Yu, J. Lin, and J. Li
Stateful large language model serving with pensieve.
In Proceedings of the Twentieth European Conference on Computer Systems,
EuroSys ’25, New York, NY, USA, pp. 144–158.
External Links: ISBN 9798400711961,
Link,
Document
Cited by: §6.
Zhao et al. (2024)
S. Zhao, D. Israel, G. V. den Broeck, and A. Grover
Prepacking: a simple method for fast prefilling and increased throughput in large language models.
External Links: 2404.09529,
Link
Cited by: §6.
Zheng et al. (2024a)
L. Zheng, L. Yin, Z. Xie, C. Sun, J. Huang, C. H. Yu, S. Cao, C. Kozyrakis, I. Stoica, J. E. Gonzalez, C. Barrett, and Y. Sheng
SGLang: efficient execution of structured language model programs.
In Advances in Neural Information Processing Systems (NeurIPS ’24),
Vol. 37, pp. 62557–62583.
Cited by: §1,
§2.1.
Zheng et al. (2024b)
X. Zheng, H. Han, S. Shi, Q. Fang, Z. Du, X. Hu, and Q. Guo
InputSnatch: stealing input in llm services via timing side-channel attacks.
External Links: 2411.18191,
Link
Cited by: §1,
§1,
§2.2,
§2.4,
Table 2,
§3.1,
2nd item,
§6.
Zhong et al. (2024)
Y. Zhong, S. Liu, J. Chen, J. Hu, Y. Zhu, X. Liu, X. Jin, and H. Zhang
DistServe: disaggregating prefill and decoding for goodput-optimized large language model serving.
In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24),
Santa Clara, CA, pp. 193–210.
External Links: ISBN 978-1-939133-40-3,
Link
Cited by: §1,
Example 2.2,
§5.1,
§6.
Zhu et al. (2025)
Q. Zhu, J. Duan, C. Chen, S. Liu, X. Li, G. Feng, X. Lv, X. Chuanfu, D. Lin, and C. Yang
SampleAttention: near-lossless acceleration of long context LLM inference with adaptive structured sparse attention.
In Eighth Conference on Machine Learning and Systems,
External Links: Link
Cited by: §6.
可引用分片 · 83 段
CHK-f915a0c27b8c33d322f575db
CacheSolidarity: Preventing Prefix Caching Side Channels in Multi-Tenant LLM Serving Systems
Conference: 27th ACM/IFIP International Middleware Conference; December 2026; Tarragona, Spain27th ACM/IFIP International Middleware Conference (Middleware ’26), December 2026, Tarragona, SpainDOI: 10.1145/XXXXXXX.XXXXXXXISBN: 979-8-XXXX-XXXX-X/26/12Conference: 27th International Middleware Conference; December 14–18, 2026; Tarragona, Spain27th International Middleware Conference (Middleware ’26), December 14–18, 2026, Tarragona, SpainDOI: 10.1145/3801927.3858638ISBN: 979-8-4007-2621-7/2026/12CCS: Security and privacy Side-channel analysis and countermeasuresCCS: Computing methodologies Machine learning
Panagiotis Georgios Pennas
Affiliation: IMDEA Software Institute, Universidad Politécnica de Madrid, Madrid, Spain
email: panagiotis.pennas@imdea.org
,
Konstantinos Papaioannou
Affiliation: IMDEA Software Institute, Universidad Politécnica de Madrid, Madrid, Spain
email: konstantinos.papaioannou@imdea.org
,
Marco Guarnieri
Affiliation: IMDEA Software Institute, Madrid, Spain
email: marco.guarnieri@imdea.org
and
Thaleia Dimitra Doudali
Affiliation: IMDEA Software Institute, Madrid, Spain
email: thaleia.doudali@imdea.org
© cc
Abstract.
Large Language Models (LLMs) rely on optimizations like Automatic Prefix Caching (APC) to accelerate inference.
CHK-404d8cbbc3a11ab23907ae0e
email: thaleia.doudali@imdea.org
© cc
Abstract.
Large Language Models (LLMs) rely on optimizations like Automatic Prefix Caching (APC) to accelerate inference.
APC works by reusing previously computed states for the beginning part of a request (prefix), when another request starts with the same text.
While APC improves throughput, it introduces timing side channels: cache hits are faster than misses, creating observable latency differences.
In multi-tenant systems, attackers can exploit these differences to infer sensitive information, e.g., by incrementally reconstructing another user’s request by observing hit/miss patterns.
Current defenses take a sledgehammer approach: they disable APC and cache sharing, isolating users, and sacrificing efficiency for regular users.
This paper presents CacheSolidarity, a system that secures multi-tenant LLM serving systems against APC side channels without sacrificing performance and efficiency.
CacheSolidarity monitors cache reuse across users, flags suspicious sharing, and selectively isolates prefixes, restricting their reuse only when necessary.
Evaluation shows that CacheSolidarity enables up to 70% higher cache reuse and 30% lower inference latency compared to existing user-isolation defenses.
CHK-3f1e8cb4121a4dafca79fbe9
essary.
Evaluation shows that CacheSolidarity enables up to 70% higher cache reuse and 30% lower inference latency compared to existing user-isolation defenses. CacheSolidarity’s lightweight design demonstrates how LLM serving can be secured without sacrificing performance or incurring unbearable overheads.
Keywords: LLM Inference Serving, Automatic Prefix Caching, KV Cache, Timing Side Channels, Multi-Tenant Systems, Selective Isolation, Prefix Isolation, Security-Performance Trade-Off
††cc-license: by
1. Introduction
Large Language Models (LLMs) now power applications such as conversational assistants, code generation, and enterprise analytics (Brown et al., 2020). These services operate at massive scale under strict latency and throughput requirements, making inference serving a critical systems challenge (Zhong et al., 2024). Modern serving systems employ system-level optimizations such as cache management (Kwon et al., 2023; Lee et al., 2024; Sun et al., 2024) and scheduling (Agrawal et al., 2023; Agrawal et al., 2024b; Holmes et al., 2024) to accelerate LLM inference.
CHK-b728f737e1f993ae91f53572
et al., 2023; Lee et al., 2024; Sun et al., 2024) and scheduling (Agrawal et al., 2023; Agrawal et al., 2024b; Holmes et al., 2024) to accelerate LLM inference. Among them, prefix sharing (Juravsky et al., 2024; Ye et al., 2024; Bang, 2023), or Automatic Prefix Caching (APC), is widely used by state-of-the-art frameworks and commercial APIs, such as OpenAI (OpenAI, 2024), DeepSeek (DeepSeek, 2024), Google Gemini (DeepMind, 2025), MoonShot Kimi (Qin et al., 2025), vLLM (Kwon et al., 2023), and SGLang (Zheng et al., 2024a).
APC accelerates inference by caching and reusing previously computed model states for the beginning part of a request (the request’s prefix) whenever another request starts with the same text. This avoids redundant computation and significantly reduces latency for long prompts and multi-turn conversations (Juravsky et al., 2024; Ye et al., 2024).
While APC improves performance, it introduces security risks similar to other caching optimizations (Yarom and Falkner, 2014; Dahlberg and Pulls, 2023; Gruss et al., 2019; Bortz and Boneh, 2007). APC creates observable inference latency differences between cache hits and misses, resulting in a timing side channel that can reveal sensitive information. In multi-tenant deployments where prefix caches are shared across users, attackers can exploit these differences to infer private data.
CHK-60a96126dc2dccfbcffdfcb4
l sensitive information. In multi-tenant deployments where prefix caches are shared across users, attackers can exploit these differences to infer private data. For example, by sending crafted requests and measuring time-to-first-token (TTFT), an attacker can determine whether their input matches cached prefixes from another user’s request. Repeated probing enables prompt-stealing attacks that reconstruct sensitive content from other users (Song et al., 2025; Gu et al., 2025).
To prevent these attacks, prior work proposes three main defenses against APC timing leaks: (i) full user-level isolation, which disables prefix sharing entirely (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025); (ii) timing obfuscation, which injects noise to mask latency differences (Carlini and Nasr, 2024); and (iii) selective isolation of secret-dependent prompts based on LLM-aided semantic analysis (Chu et al., 2026).
While effective in theory, all these defenses suffer from a critical drawback: they introduce significant overhead, often unnecessarily, e.g., for prompts that are not involved in attacks or for situations where the timing side channel is not exploitable in practice. Thus, these solutions erase APC’s performance benefits and penalize regular, benign users; thereby limiting their applicability in realistic, high-performance multi-tenant environments.
CHK-65080751214cb4169cc25d0b
e APC’s performance benefits and penalize regular, benign users; thereby limiting their applicability in realistic, high-performance multi-tenant environments.
To address the shortcomings of current defenses, we introduce CacheSolidarity, a system-level solution that secures multi-tenant LLM serving against timing side channels caused by APC, while preserving its performance benefits. CacheSolidarity is based on the key insight that isolating entire users (as done in (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025)) is not necessary to prevent attacks; rather it is sufficient to protect the shared prefixes that might lead to attacks. Building on this insight, CacheSolidarity (1) continuously monitors prefix reuse across users, (2) flags prefixes that are suspiciously reused by multiple users, and (3) prevents further reuse of flagged prefixes in follow-up requests. This approach embodies the principle of cooperative efficiency: benign users benefit from shared caching through solidarity, where common prefixes remain accessible to all. When suspicious behavior threatens this solidarity, CacheSolidarity intervenes by isolating only the flagged prefixes instead of penalizing all users.
CacheSolidarity consists of lightweight components that work together to secure prefix caching without sacrificing efficiency.
CHK-c3869c7e5b49d23eee48e7d0
instead of penalizing all users.
CacheSolidarity consists of lightweight components that work together to secure prefix caching without sacrificing efficiency. First, CacheSolidarity extends the prefix cache with minimal metadata to track ownership and flag suspicious reuse. Second, the Detector monitors cache hits and isolates flagged prefixes shared across users. Finally, the Activator enables isolation only when timing side channels are exploitable, based on the distinguishability of cache-hit and cache-miss latencies. This depends on factors such as hardware, LLM model size, system load, and request length, as shown in Section 2. Together, CacheSolidarity’s system components interact seamlessly: the cache extension provides metadata, the Detector enforces selective isolation and the Activator optimizes the security-performance trade-off.
CacheSolidarity is implemented on top of the state-of-the-art LLM serving system vLLM (vLLM Team, 2024). Extensive evaluation across workloads and LLM model families and sizes shows that CacheSolidarity achieves up to 70% higher cache reuse and 30% lower inference latency than user-level isolation defenses, with negligible runtime and memory overhead.
CHK-3265df5049aba863685c3b4d
olidarity achieves up to 70% higher cache reuse and 30% lower inference latency than user-level isolation defenses, with negligible runtime and memory overhead. We further characterize CacheSolidarity’s security guarantees through a detailed analysis, complemented by empirical validation demonstrating its effectiveness against APC timing side channels across users.
Figure 1. Timing side-channel leakage in prefix-sharing LLM inference. The attacker sends crafted prompts and measures time-to-first-token (TTFT) to detect cache hits or misses caused by Automatic Prefix Caching (APC) and steal the sensitive information in the victim’s prompt.
The specific paper contributions are:
∙\bullet
An analysis of APC timing side channels in multi-tenant LLM serving systems, identifying the workload and system conditions affecting their exploitability (Section 2).
∙\bullet
The design of CacheSolidarity, a lightweight system that prevents timing attacks by selectively isolating suspicious prefixes rather than entire users, preserving caching benefits (Section 3). The code is open-sourced.11
1
https://github.com/muse-research-lab/CacheSolidarity
∙\bullet
A security analysis of CacheSolidarity’s guarantees and limitations, complemented by empirical validation against prompt-stealing attacks (Section 4).
∙\bullet
CHK-05414706196ec854b5db987c
A security analysis of CacheSolidarity’s guarantees and limitations, complemented by empirical validation against prompt-stealing attacks (Section 4).
∙\bullet
An extensive evaluation of the performance of CacheSolidarity across diverse workloads and state-of-the-art LLM models, alongside a sensitivity analysis (Section 5).
2. Background and Motivation
In this section, we provide background and motivation for CacheSolidarity.
We start by introducing background on LLM serving systems and, in particular, on the APC optimization (2.1).
We then characterize the parameters that influence the exploitability of timing side channels due to APC (Section 2.2).
Then, we illustrate how attackers can exploit APC through timing leaks to learn sensitive prompts (2.3).
Next, we overview current defenses for APC timing leaks and discuss their limitations (2.4).
2.1. Caching in LLM Serving Systems
Large Language Models (LLMs), such as GPT (Brown et al., 2020) and LlaMA (Touvron and others, 2023), are the backbone of modern AI services.
Integrating them in modern IT systems requires serving systems that deliver inference with low latency and high throughput under multi-user workloads.
Inference happens in two stages: prefill and decode.
During prefill, the entire input prompt (also called a request) is processed in a single forward pass, generating key-value (KV) tensors for each token.
CHK-01536ea41e285f4fd4d631a0
ecode.
During prefill, the entire input prompt (also called a request) is processed in a single forward pass, generating key-value (KV) tensors for each token.
In the decode phase, tokens are produced autoregressively; for each new token, the model computes a new key-value tensor using all previously generated tensors.
Without caching, every decode step would recompute all KV tensors for both prefill and prior decode tokens, incurring quadratic cost.
To avoid this, current LLM serving systems employ a KV cache that stores tensors generated during the prefill and previous decoding steps for reuse. To further accelerate inference, several commercial frameworks such as OpenAI (OpenAI, 2024), DeepSeek (DeepSeek, 2024), Google Gemini (DeepMind, 2025), MoonShot Kimi (Qin et al., 2025), vLLM (Kwon et al., 2023), and SGLang (Zheng et al., 2024a) implement Automatic Prefix Caching (APC). APC reduces redundant computation by reusing cached KV tensors whenever a new request shares a prefix with an earlier one. This optimization is particularly effective for scenarios such as long-document queries or multi-round conversations (vLLM Team, 2025), where repeated processing of the same prefix would otherwise incur significant overhead.
When serving systems apply APC, a prompt can be viewed as a sequence of prefixes, each mapped to a cache entry in the KV/prefix cache.
CHK-f6c141339cc07ccb6a4a9793
cur significant overhead.
When serving systems apply APC, a prompt can be viewed as a sequence of prefixes, each mapped to a cache entry in the KV/prefix cache. Requests may experience partial cache hits, starting from the beginning of the prompt and reusing some cached prefixes while recomputing others. The leftmost example in Figure 5 illustrates this process, where each node corresponds to a cache entry for that particular prefix/part of the prompt sentence.
(a) RPS = 10
(b) RPS = 40
(c) LLava-0.5B (A100)
(d) Llama2-7B (A100)
(e) Llama2-7B (H100)
(f) Llama3-70B (H100)
Figure 2. TTFT of cache hits (red) and misses (blue).
2.2. Timing Differences due to APC
Although the use of the prefix cache accelerates inference, it introduces observable latency differences between cache hits and misses, particularly in the time-to-first-token (TTFT). These variations create a timing side channel, an unintended information leak where execution time reveals whether a request shares prefixes with cached prompts. In multi-tenant environments, such leaks can be exploited by attackers to infer sensitive information. In the following examples, we illustrate how APC-induced timing differences manifest and we identify the key parameters that influence the strength and exploitability of the side channel.
Example 2.1.
CHK-bed71174dee666da9305d44e
how APC-induced timing differences manifest and we identify the key parameters that influence the strength and exploitability of the side channel.
Example 2.1.
To illustrate APC’s impact on latency, recall that a prompt is processed as a sequence of prefixes mapped to cache entries. With APC, prefixes may either hit or miss the cache; an early miss forces recomputation of all subsequent prefixes, leading to observable differences in time-to-first-token (TTFT) between full-reuse and recomputation cases.
Figures 2(c)-2(f) reports TTFT comparisons across LLMs of increasing size (0.5B, 7B, 70B) and varying prompt lengths, with requests sent at a constant rate (RPS = 1). TTFT for cache hits is shown in red, while misses are shown in blue. Llama3-70, due to its parameter count, is configured to run across 2 H100 GPUs with tensor parallelism TP = 2. For all models except the smallest one (i.e., LLava-0.5B), we highlight the following:
∙\bullet
The TTFT gap between cache hits and misses become noticeable after a certain prefix length for each model.
∙\bullet
The TTFT gap grows as the shared prefix length increases.
∙\bullet
For a given prefix length, larger LLMs exhibit greater TTFT gaps.
∙\bullet
Larger LLMs show distinguishable gaps even at shorter prefixes.
CHK-c312603241278765eb2f031e
increases.
∙\bullet
For a given prefix length, larger LLMs exhibit greater TTFT gaps.
∙\bullet
Larger LLMs show distinguishable gaps even at shorter prefixes.
For LLava-0.5B, TTFT differences between hits and misses are negligible because the model is small and the recomputation latency for the misses is minimal.
Observation 1: TTFT reveals whether a request reuses cached prefixes (hits) or recomputes them (misses), and the difference becomes more pronounced with larger models and longer prefixes that are reused across users.
Figure 3. Effect of the LLM model size, prefix/prompt length, system load (requests per second) and GPU hardware on the distinguishability of the APC timing differences, captured by the KDE overlap between cache hits and misses.
Example 2.2.
Next, we examine how system load influences these timing differences using the same setup as before with the Llama-13B model. Figures 2(a), 2(b) show TTFT measurements under increasing request-per-second (RPS) rates for prompts with prefixes of up to 500 tokens. We observe that as the request-per-second (RPS) rate increases, the latency gap between cache hits and misses progressively collapses, making them hard to distinguish.
CHK-ee333bbc688a17e5a72f860b
rve that as the request-per-second (RPS) rate increases, the latency gap between cache hits and misses progressively collapses, making them hard to distinguish. This happens because higher RPS introduces resource contention and head-of-line blocking in the LLM serving pipeline (Agrawal et al., 2023; Agrawal et al., 2024b; Zhong et al., 2024; Papaioannou and Doudali, 2024). Under these conditions, batching and queuing delays dominate latency, overshadowing the computational savings of prefix reuse. Thus, cache hits appear as slow as misses, effectively eliminating any timing gaps.
Observation 2: As system load increases, TTFT differences between prefix cache hits and misses disappear because batching and queuing delays dominate latency, masking cache-related timing variations.
Example 2.3.
Next, we evaluate the impact of the underlying GPU hardware by running the same Llama-7B model on a single A100 vs. H100 GPU. Figures 2(d), 2(e) show that cache misses (model inference) are served significantly faster on the H100 due to its higher throughput and improved architecture, significantly reducing timing gap compared to that of the A100.
Observation 3: Higher-throughput GPUs accelerate inference and speed up cache misses, thereby reducing the time gap.
CHK-97341f41acf8baeeb0119f2c
g timing gap compared to that of the A100.
Observation 3: Higher-throughput GPUs accelerate inference and speed up cache misses, thereby reducing the time gap.
To further validate the above observations across conditions, Figure 3 shows the KDE overlap between the TTFT distributions of cache hits and misses across models of varying size, prefix length, system load (RPS), and GPU hardware. All models execute on a single A100 GPU (unless otherwise noted) and Llama3-70B across 2 H100 GPUs.
KDE overlap is a statistical measure of similarity between two probability distributions, computed as the integral of the minimum of their density functions (Inman and Bradley, 1989). Higher values indicate harder to distinguish cache hit vs. miss latency, while lower values indicate clear separation, thus stronger timing side channel.
The left plot shows that the overlap decreases for longer prefixes, especially for larger models such as Llama2-13B and Llama3-70B. In contrast, smaller models (e.g., Llava-0.5B) have distinctly higher overlap, as well as models that run on newer GPUs (Llama2-7B on H100) for short prompts. The right plot shows that overlap increases with request rate (RPS), as batching and queuing delays dominate latency and mask cache-dependent variations. At high RPS, hits and misses become nearly indistinguishable across all models, regardless of the underlying GPU A100 vs.
CHK-f3676bb71448721c0a301c00
y and mask cache-dependent variations. At high RPS, hits and misses become nearly indistinguishable across all models, regardless of the underlying GPU A100 vs. H100, effectively eliminating the timing leak.
In conclusion, while prior work acknowledges APC-induced timing side channels (Chu et al., 2026; Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025), our motivational analysis shows that the strength and exploitability of the channel depend on the following critical parameters:
∙\bullet
the shared prefix’s length: longer prefixes are more vulnerable.
∙\bullet
the size of the LLM model: larger models are more vulnerable.
∙\bullet
the system load: lower load (requests received per second) is more vulnerable.
∙\bullet
the underlying hardware platform: since it directly influences timing measurements.
These parameters jointly determine whether timing side channels are distinguishable and, should be taken into consideration into building robust and practical mitigation mechanisms.
Key insight: While APC introduces timing side channels, their exploitability depends on various parameters: the prefix length, LLM size, system load, and hardware platform. Prior work treated APC leaks as uniformly exploitable, whereas our analysis reveals that these parameters jointly determine side-channel strength and must guide efficient and practical mitigation.
2.3.
CHK-07e9a10093569cf20e1da95e
exploitable, whereas our analysis reveals that these parameters jointly determine side-channel strength and must guide efficient and practical mitigation.
2.3. Prompt Stealing Attacks via APC leaks
In multi-tenant systems the prefix cache is shared between requests from different users and security domains.
Hence, these visible timing differences can be exploited by attackers to incrementally reconstruct
sensitive prompts or steal private information (secrets) of other users by observing the TTFT of attacker requests.
That is, APC leaks can be exploited to perform prompt stealing attacks (Song et al., 2025).
Figure 1 illustrates the workflow of a timing-based prompt stealing attack that exploits APC leaks, inspired by (Song et al., 2025).
First, the victim user issues a request that includes a prompt containing sensitive information.
The attacker uses an LLM-based Prompt Constructor to create candidate prompts. Next, each candidate is submitted to the LLM serving system, and the TTFT is measured.
By observing the TTFT, the attacker can determine (e.g., using a dedicated pre-trained classifier) whether the observed latency corresponds to hits or misses in the prefix cache.
In particular, a cache hit indicates that the candidate shares a prefix with the victim’s prompt.
CHK-bdc120300c8c387164c38e7b
ed latency corresponds to hits or misses in the prefix cache.
In particular, a cache hit indicates that the candidate shares a prefix with the victim’s prompt.
By repeating this process iteratively, the attacker can reconstruct the original prompt word-by-word or retrieve missing/private data fields (e.g., names, dates, identifiers) without direct access to the cache (Song et al., 2025; Gu et al., 2025).
Attack Examples.
Consider an LLM-based customer-support application where multiple users send requests to a shared backend model. To improve performance, the system prepends hidden context (e.g., account data) to each query and reuses cached prefixes across requests. For example, the system may internally construct a prompt such as: “You are a support assistant. Customer name: John Doe. Account ID: 48291.”, followed by “Summarize recent activity.” An attacker, acting as a regular API user, can issue inputs containing guesses for likely fields (e.g., “Customer name: A…”, “Customer name: Alice…”) and measure response times. Faster responses indicate prefix reuse, allowing the attacker to iteratively refine guesses and recover sensitive fields embedded in prior prompts.
Next, consider a shared LLM API where multiple users submit prompts that may include sensitive personal or business information.
CHK-32e53a747cb5faeab274d124
elds embedded in prior prompts.
Next, consider a shared LLM API where multiple users submit prompts that may include sensitive personal or business information. For example, a user might send a query such as “Draft an email to my manager John Doe about delaying Project Phoenix.” As requests are processed, parts of these prompts may be cached to improve performance. An attacker, interacting as a normal user, can probe the system by issuing prompts containing guesses (e.g., names or project titles) and measuring response times. By iteratively refining these guesses (e.g., extending “John…” to “John Doe…”), the attacker can reconstruct real user prompts.
Real prompts with secret information. Next, in Table 1 we analyze datasets with real user prompts from diverse domains, including logs of personal chats, interactions with assistants, and instruction tuning; the task where a prompt specifies an instruction and the model is trained to produce the intended response.
CHK-c59d9294aa849e89bcf268b8
nteractions with assistants, and instruction tuning; the task where a prompt specifies an instruction and the model is trained to produce the intended response. Given that these datasets do not include labeled private information, we use the ai4privacy 0.5.0 Python module (Ai4Privacy, 2026) as a proxy to identify sensitive content within each prompt and estimate the fraction of prompts containing personally identifiable information (PII), as also done in prior work on LLM privacy leakage (Ai4Privacy, 2024; Cheng et al., 2025; Singh and Narayanan, 2025; Acharya and Shrestha, 2025).
We observe that a substantial fraction of prompts across datasets include sensitive content, ranging from 19%-27.24% in user conversations and assistant interactions, up to 76.1% in instruction-tuning prompts. This gap arises because instruction-tuning prompts ground tasks in concrete contexts, often including specific entities such as names, locations, or dates. For example, a prompt may ask: “Summarize the following article about Barack Obama’s visit to Berlin in 2013” or “Extract all locations and dates mentioned in a passage about the 2020 Tokyo Olympics,” which naturally include personally identifiable information.
CHK-eb6c0b4ba57bbb3c4b05583b
in 2013” or “Extract all locations and dates mentioned in a passage about the 2020 Tokyo Olympics,” which naturally include personally identifiable information. In contrast, conversational prompts are typically more abstract or task-oriented, e.g., “How do I improve my resume?” or “What’s a good itinerary for a 3-day trip?”, and thus rarely include personal details.
We further evaluate the extent to which such information can be recovered using a state-of-the-art BERT-based model (Devlin et al., 2019) (google-bert/bert-base-uncased), mimicking an attacker employing a Prompt Constructor. We find that, among prompts containing secrets, the model can recover hidden information in up to 52.5% of cases. This result indicates that real-world prompt datasets contain substantial amounts of recoverable sensitive information, suggesting that prompt stealing attacks can be effective in extracting real secrets.
Dataset
Domain
Prompts
% Prompts
w/ Secrets
% Secrets
Recover.
Flan (Data Provenance Initiative, 2024)
Instr. tuning
553,869
76.1%
40.39%
UltraChat (OpenBMB, 2023)
Chat logs
10,000
27.24%
52.5%
ShareGPT (anon8231489123, 2023)
Chat logs
702,151
24.3%
22.8%
OASST1 (OpenAssistant, 2023)
Assistant logs
39,283
19%
30.76%
Table 1. Sensitive information (secrets) in real-world prompt datasets and its recovery rate.
CHK-4cf107dea22ab5f9ce8338af
.8%
OASST1 (OpenAssistant, 2023)
Assistant logs
39,283
19%
30.76%
Table 1. Sensitive information (secrets) in real-world prompt datasets and its recovery rate.
In addition, prior studies (Chu et al., 2026) have shown that such real world datasets exhibit frequent prefix reuse within and across users. Specifically, requests from the same user share prefixes in 9–60% of cases, while up to 30% reuse occurs across different users. This widespread reuse increases the likelihood that sensitive prompt components remain in cache and become vulnerable to prompt stealing attacks.
2.4. Defenses Against APC leaks
Existing defenses against APC-induced timing leaks fall into three main categories, each with distinct trade-offs between security and performance, as summarized in Table 2.
Cache Isolation and Partitioning.
Several works propose mitigating APC leaks by eliminating cache sharing entirely across different users and security domains.
InputSnatch (Zheng et al., 2024b) and Auditing Prompt Caching (Gu et al., 2025) advocate per-user cache isolation or disabling prefix reuse across requests.
Cache Partitioning (Pang et al., 2024) similarly enforces user-boundaries within the KV-cache to prevent cross-user hits.
At the same time, major AI providers adopt isolation mechanisms in-production at varying scopes, along with periodic cache refresh policies, as summarized in Table 3.
CHK-54e241b9e9a74538a774b2ba
same time, major AI providers adopt isolation mechanisms in-production at varying scopes, along with periodic cache refresh policies, as summarized in Table 3. OpenAI scopes its prompt cache at the organization level and explicitly warns about timing observability (OpenAI, 2024). Anthropic recently tightened its isolation boundary from the organization to the workspace level (Anthropic, 2026). Similarly, Azure OpenAI and Amazon Bedrock enforce subscription- and account-level isolation, largely driven by compliance requirements (Microsoft Azure, 2025; Amazon Web Services, 2025). Google Vertex AI provides manual caching primitives with per-project scoping (Google Cloud, 2025).
In the open-source ecosystem, the widely used vLLM framework introduced an optional cache isolation mechanism based on a per-request cache_salt (vLLM Contributors, 2025), following the disclosure of CVE-2025-46570 (National Vulnerability Database, 2025) (a publicly registered security vulnerability) and the related GitHub Security Advisory (GHSA-4qjh-9fv9-r85r), which highlighted the risk of timing leakage from shared prefix caches. Finally, cache refresh times range from few minutes up to hours and days, leaving ample time for an attacker to mount prompt stealing attacks targeting cached prefixes.
Related Work
Mitigation
Prefix Reuse
Low TTFT
Partitioning (Pang et al., 2024)
Per-user Isolation
✗
✗
CHK-d3bd60e684c414c4e2a9a8b2
mount prompt stealing attacks targeting cached prefixes.
Related Work
Mitigation
Prefix Reuse
Low TTFT
Partitioning (Pang et al., 2024)
Per-user Isolation
✗
✗
InputSnatch (Zheng et al., 2024b)
Per-user Isolation
✗
✗
Audit (Gu et al., 2025)
Per-user Isolation
✗
✗
Remote (Carlini and Nasr, 2024)
Timing Obfuscation
✓
✗
SafeKV (Chu et al., 2026)
Selective Sharing
✓
✗
CacheSolidarity
Selective Sharing
✓
✓
Table 2. Comparison of current mitigation strategies.
APC-based
side channels are a practical and widely acknowledged threat across major AI providers.
Cache isolation ensures strong security guarantees by preventing cross-user prefix sharing.
However, it also sacrifice the performance benefits of prefix caching, which can result in significant overhead given that “real-world LLM workloads frequently exhibit significant cross-query reuse” (Chu et al., 2026).
Shortcoming 1: User-based cache isolation prevents timing leaks but introduces overhead due to reduced prefix sharing.
Timing Obfuscation.
Carlini and Nasr (Carlini and Nasr, 2024) propose to secure systems by making the execution time of inference “constant” across hits and misses.
For this, they propose to inject noise in the system to mask timing signals and, ultimately, close the side channel by making hits and misses in the prefix cache indistinguishable to attackers.
CHK-1eb1e70206b23b93b233cccc
oise in the system to mask timing signals and, ultimately, close the side channel by making hits and misses in the prefix cache indistinguishable to attackers.
That is, these defenses would ensure that the distributions of hits and misses in figure 2 overlap.
Although obfuscation defenses can prevent APC leaks, they have two limitations.
First, they introduce uniform delays across all requests, penalizing benign users and reducing overall performance.
Second, they do not address the source of the timing leak (i.e., the prefix cache being shared between security domains) and historically obfuscation defenses for timing leaks are less robust since attackers can often find ways of amplifying even small differences in execution time (Vila and Kopf, 2017; Kohlbrenner and Shacham, 2016; Gras et al., 2017).
Shortcoming 2: Obfuscation-based techniques do not address the source of leaks and introduce overheads for benign requests.
Provider
Isolation Scope
Cache Refresh
OpenAI (OpenAI, 2024)
Per organization
5–60 min
Anthropic (Anthropic, 2026)
Per workspace
Session only (volatile)
Azure OpenAI (Microsoft Azure, 2025)
Per subscription
Not disclosed
Amazon Bedrock (Amazon Web Services, 2025)
Per account/org
5 min
Google Vertex (Google Cloud, 2025)
Per GCP project
1 min–30 days (TTL)
vLLM (vLLM Contributors, 2025; GitHub Security Advisory, 2025)
None by default
Unbounded
Table 3.
CHK-d89925b4b29ebcf5524f3e46
ertex (Google Cloud, 2025)
Per GCP project
1 min–30 days (TTL)
vLLM (vLLM Contributors, 2025; GitHub Security Advisory, 2025)
None by default
Unbounded
Table 3. Cache isolation across LLM providers.
Selective Cache Sharing.
To balance security and efficiency, some defenses restrict cache sharing rather than disabling it completely.
SafeKV (Chu et al., 2026) introduces a multi-tier detection pipeline that semantically classifies requests using rule-based checks and semantic validation via LLMs either as “sensitive” (i.e., that may contain secret information) or non-sensitive.
In SafeKV, only requests classified as sensitive are isolated at cache-level, thereby preventing other users (attackers included) from hitting on them.
Although this approach prevents leakage without fully disabling APC, its reliance on heavyweight semantic LLM-based analysis limits scalability for high-performance deployments.
Moreover, some requests might be misclassified and, therefore, left unprotected.
Shortcoming 3: Current selective sharing defenses may fail in preventing leaks for “misclassified” requests and still introduce unnecessary overhead.
CHK-cc9113c4890bf0e5a254a157
rotected.
Shortcoming 3: Current selective sharing defenses may fail in preventing leaks for “misclassified” requests and still introduce unnecessary overhead.
These shortcomings motivate the need for a defense that adapts to the conditions under which timing leaks are exploitable, secures prefix reuse without blind per-user isolation, and preserves the efficiency of APC across diverse workloads, without introducing unbearable overheads in return for security.
3. System Design
In this section, we start by providing a high-level overview of CacheSolidarity and its objectives (3.1),
and later describe CacheSolidarity’s core components (Sections 3.2 and 3.3).
3.1. Overview and Objectives
CacheSolidarity deploys a lightweight defense mechanism that secures multi-tenant LLM serving systems against timing side-channel attacks caused by Automatic Prefix Caching (APC).
It builds on the key insight that preventing timing side-channel attacks does not require isolating entire users (like it is done in (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025)); it only requires isolating prefixes that might lead to attacks.
Building on this insight, CacheSolidarity allows cached prefixes to be reused across users but stops reuse beyond prefixes that could reveal sensitive information.
CHK-b2ac0b06859a50ff9f8de346
ding on this insight, CacheSolidarity allows cached prefixes to be reused across users but stops reuse beyond prefixes that could reveal sensitive information.
This selective prefix isolation works on a simple principle: attacks require different users to share and reuse a prefix. CacheSolidarity enforces this by tracking how users interact with shared cache entries
without requiring any knowledge of prompt semantics (Chu et al., 2026).
This approach embodies the principle of cooperative efficiency: benign users benefit from shared caching through solidarity, where common prefixes remain accessible to all.
When suspicious behavior threatens this solidarity, CacheSolidarity intervenes by isolating the corresponding prefixes rather than penalizing all users.
This design ensures that cache reuse within and across users is maximized to the greatest extent possible without compromising security.
Objectives.
The system design is guided by the following goals:
[O1]
Secure Prefix Reuse: Prevent timing attacks introduced by Automatic Prefix Caching (APC) by isolating suspicious prefixes, avoiding heavy-handed approaches such as per-user isolation or disabling cache sharing.
[O2]
Performance Preservation: Maximize cache reuse and accelerate inference speed, across diverse workloads and LLM models, thereby ensuring that security does not come at the cost of performance.
[O3]
CHK-e085d5b877251d1992d46c26
he reuse and accelerate inference speed, across diverse workloads and LLM models, thereby ensuring that security does not come at the cost of performance.
[O3]
Lightweight and Practical Design: Provide real-time protection with minimal overhead, without requiring semantic analysis or prior knowledge of sensitive content, and integrate seamlessly with state-of-the-art LLM serving systems.
Overview.
To achieve these objectives, CacheSolidarity introduces a lightweight pipeline that operates on the request-serving path, as illustrated in Figure 4. It extends the KV cache with minimal metadata per entry to track cross-user prefix reuse and flag suspicious entries. When a request arrives, the Activator determines whether to enable the Detector based on the distinguishability of timing differences in past cache hits and misses. At the same time, the LLM serving system checks if the request’s prefixes hit or miss the cache. On a cache miss, a new cache entry is created and tagged with the user’s ID. On a cache hit, the Detector (if enabled by the Activator) checks whether the prefix can be safely reused.
If safe, the request proceeds with full reuse and is forwarded to the LLM for decoding. Otherwise, a partial hit occurs: reuse stops at the flagged prefix, and the remaining prefill tokens of the isolated prefix are recomputed before proceeding to the LLM for decoding.
CHK-9a3bf131a0bad94f0fdc7298
it occurs: reuse stops at the flagged prefix, and the remaining prefill tokens of the isolated prefix are recomputed before proceeding to the LLM for decoding.
System Components. CacheSolidarity consists of the following:
∙\bullet
KV Cache Extension: Augments each cache entry with metadata to track user-prompt interactions and flag suspicious prefixes (§3.2).
∙\bullet
Detector: Examines prefix reuse to identify cross-user access and enforce selective isolation when suspicious reuse occurs (§3.2).
∙\bullet
Activator: Dynamically activates selective isolation only under conditions that create exploitable timing side-channels, balancing security with performance (§3.3).
Together, these components maximize cache reuse while mitigating timing attacks without sacrificing performance.
3.2. KV Cache Extension and Detector
3.2.1. KV Cache Extension
CacheSolidarity extends each cache entry with the following metadata fields:
∙\bullet
OwnerID: the identifier of the user who first created and populated this cache entry. It is set exactly once at allocation time and remains immutable.
∙\bullet
AttackFlag: a marker indicating that this prefix has been flagged for isolation due to being reused by multiple users. When set, prefix reuse beyond this point must be disabled for non-owners.
These fields add only a few bytes per entry and do not affect tensor layout or memory mapping.
3.2.2.
CHK-02f91959197c27fa45ad7baa
x reuse beyond this point must be disabled for non-owners.
These fields add only a few bytes per entry and do not affect tensor layout or memory mapping.
3.2.2. Detection Pipeline
When a cache entry is created on a cache miss, its metadata is initialized: OwnerID is set to the current user ID and AttackFlag is cleared. When there is a cache hit, the request is sent to the Detector for validation. At this stage, the Detector examines whether the prefix should remain shared or be isolated to prevent leakage. Two scenarios can occur during validation:
∙\bullet
Hit on an unflagged prefix: If the prefix is unflagged and owned by the requesting user, reuse proceeds without changes, the cached entry is returned back to the user. If the prefix is owned by a different user, the Detector flags this prefix as isolated for future requests, ensuring that reuse beyond this point is blocked for non-owners.
∙\bullet
Hit on a flagged prefix: If the prefix is previously flagged, the Detector checks whether the next prefix in the prompt belongs to the requesting user. If yes, reuse continues normally. If not, reuse stops at the flagged prefix, and the remaining ones are recomputed through the LLM.
Figure 4. System Design of CacheSolidarity.
Figure 5. Example workflow of CacheSolidarity.
3.2.3. Example Workflow
CHK-ebef19863cf356379655556c
maining ones are recomputed through the LLM.
Figure 4. System Design of CacheSolidarity.
Figure 5. Example workflow of CacheSolidarity.
3.2.3. Example Workflow
Figure 5 shows how CacheSolidarity handles prefix reuse across three users issuing requests at timestamps t1t_{1}–t4t_{4}. Prompts differ only in private information (e.g., names). Circles denote cache entries and arrows denote prefix sequences; red, green, and orange indicate misses, hits, and flagged entries, respectively. We describe the execution at each timestamp next:
t1t_{1}:
User 1 submits a prompt, creating new cache entries tagged with OwnerID = 1. All entries are unflagged.
t2t_{2}:
User 2 reuses the first two entries. CacheSolidarity detects a different OwnerID and flags the second entry. New entries are created beyond this point for User 2.
t3t_{3}:
User 1 issues a follow-up request. As the owner, reuse continues beyond the flagged entry without restriction.
t4t_{4}:
User 3 attempts to reuse the prompt with modified private data. Since the prefix is flagged and owned by another user, reuse stops and new entries are created from that point.
In summary, this example illustrates CacheSolidarity’s selective isolation: flagged prefixes prevent cross-user continuation, forcing non-owners onto separate paths while allowing full reuse for the owner.CHK-b4e9cbdaaa48d0b38349e873
idarity’s selective isolation: flagged prefixes prevent cross-user continuation, forcing non-owners onto separate paths while allowing full reuse for the owner. For example, User 2 can still extend its own path (1-2-6-7-8) even if node 2 is flagged.
3.3. Activator Optimization
As shown in Section 2.2, APC timing side channels are conditionally exploitable: latency gaps between cache hits and misses increase with longer prefixes and larger models, but diminish under higher system load, while also depending on the underlying hardware. As a result, “always-on” defenses (Table 2) may incur unnecessary overhead.
CacheSolidarity addresses this by activating selective isolation only when timing differences are distinguishable under the current operating conditions (model, hardware, workload). To achieve this, it relies on an offline profiling phase combined with lightweight online monitoring.
Offline, CacheSolidarity profiles the underlying hardware–LLM pair by running workloads with varying request rates and prompt lengths, measuring latency distributions for cache hits and misses, and computing the KDE overlap, a statistical measure of how distinguishable these distributions are (Inman and Bradley, 1989).
CHK-d51df0b2ea07ba4a898be2a8
utions for cache hits and misses, and computing the KDE overlap, a statistical measure of how distinguishable these distributions are (Inman and Bradley, 1989). It then stores a mapping (RPS,prompt length)→overlap(\text{RPS},\text{prompt length})\rightarrow\text{overlap}, where inputs are bucketed as shown in Figure 2: RPS in increments of 1, and prompt lengths in increments of 50.
Online, CacheSolidarity maintains a sliding window hh of recent requests and calculates the request rate and average prompt length, given that the underlying the hardware and LLM are fixed. Then it uses the profiled mappings (RPS,prompt length)→overlap(\text{RPS},\text{prompt length})\rightarrow\text{overlap} to retrieve the KDE overlap(hh). If the current (RPS,prompt length)(\text{RPS},\text{prompt length}) pair has not been profiled, CacheSolidarity defaults to enabling security and skips the threshold comparison described next.
The Activator is configured with a static threshold θ\theta. When the KDE overlap(hh) exceeds θ\theta, CacheSolidarity disables selective isolation and allows full reuse, while still updating cache metadata. When the overlap falls below θ\theta, CacheSolidarity activates detection and prefix isolation. This decision is updated per request using a sliding window of TTFT samples, enabling dynamic adaptation to workload conditions.CHK-77039d4a8fa0abe7935d4816
detection and prefix isolation. This decision is updated per request using a sliding window of TTFT samples, enabling dynamic adaptation to workload conditions. The choice of θ\theta is left to the administrator and reflects the security–performance trade-off: higher thresholds (up to 100%) increase security but may reduce performance.
Section 5.3 evaluates the impact of the threshold selection to the security and performance of the system and provides guidelines to the system administrators. Section 4.2 discusses how the Activator’s design mitigates potential adversarial threshold manipulation.
4. Security Analysis
In this section, we analyze the security guarantees provided by CacheSolidarity. First, we precisely characterize its selective isolation guarantees, and then examine the implications of the activator.
4.1. Security of Selective Isolation
We characterize which KV cache states an attacker can distinguish via APC timing leaks under CacheSolidarity’s prefix-based selective isolation.
Cache states
We consider a simplified model of the KV cache state, extended with CacheSolidarity’s metadata.
A cache state c\mathit{c} is a set of cache entries, each one consisting of a tuple (𝑖𝑑CLOSE(\mathit{id}, 𝑑𝑎𝑡𝑎\mathit{data}, 𝑜𝑤𝑛𝑒𝑟𝐼𝑑,𝑎𝑡𝑡𝑎𝑐𝑘𝐹𝑙𝑎𝑔\mathit{ownerId},\mathit{attackFlag}, OPEN𝑛𝑒𝑥𝑡)\mathit{next}).CHK-231654225d9ed80f3f7b5cd6
ntries, each one consisting of a tuple (𝑖𝑑CLOSE(\mathit{id}, 𝑑𝑎𝑡𝑎\mathit{data}, 𝑜𝑤𝑛𝑒𝑟𝐼𝑑,𝑎𝑡𝑡𝑎𝑐𝑘𝐹𝑙𝑎𝑔\mathit{ownerId},\mathit{attackFlag}, OPEN𝑛𝑒𝑥𝑡)\mathit{next}). Two states c1,c2\mathit{c}_{1},\mathit{c}_{2} are structure-equivalent for user uu if they are identical except for the 𝑑𝑎𝑡𝑎\mathit{data} associated with entries not owned by uu.
Attacker model
We consider an attacker 𝑎𝑡𝑘\mathit{atk} who interacts with the system as a regular user and issues requests alongside other users.
For an issued request r\mathit{r}, the attacker 𝑎𝑡𝑘\mathit{atk} can observe whether the prefixes associated with the request result in a sequence of hits (H\mathit{H}) and/or misses (M\mathit{M}). The sequence may consist of only hits H\mathit{H}…H\mathit{H}, only misses M\mathit{M}…M\mathit{M}, or a sequence of hits followed by misses 𝐻𝐻\mathit{H}\mathit{H}…𝑀𝑀\mathit{M}\mathit{M} (some prefixes hit the cache).
Given the current state c\mathit{c} and the request r\mathit{r} issued by 𝑎𝑡𝑘\mathit{atk}, we define 𝑜𝑏𝑠(c,𝑎𝑡𝑘,r)∈{H,M}∗\mathit{obs}(\mathit{c},\mathit{atk},\mathit{r})\in\{\mathit{H},\mathit{M}\}^{*} to be an attacker observation (i.e., the sequence of H\mathit{H} and M\mathit{M}).
Security guarantees
To characterize CacheSolidarity’s guarantees, we first need to introduce two properties of requests.CHK-314540988b3874154d14fa44
quence of H\mathit{H} and M\mathit{M}).
Security guarantees
To characterize CacheSolidarity’s guarantees, we first need to introduce two properties of requests. First, a request r\mathit{r} results in a first-entry hit, defined as 𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡(c,𝑎𝑡𝑘,r)\mathit{firstHit}(\mathit{c},\mathit{atk},\mathit{r}), if there is a cache entry for the first prefix in the request r\mathit{r}. This results in a hit in state c\mathit{c}, i.e., the first element of 𝑜𝑏𝑠(c,𝑎𝑡𝑘,r)\mathit{obs}(\mathit{c},\mathit{atk},\mathit{r}) is H\mathit{H}. Second, a request r\mathit{r} results in an unflagged hit, written 𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡(c,𝑎𝑡𝑘,r)\mathit{unflagHit}(\mathit{c},\mathit{atk},\mathit{r}), if it results in a hit on an unflagged entry in state c\mathit{c}, i.e., if 𝑜𝑏𝑠(c,𝑎𝑡𝑘,r)\mathit{obs}(\mathit{c},\mathit{atk},\mathit{r}) contains an H\mathit{H} corresponding to an unflagged cache entry. We now characterize the security guarantees of CacheSolidarity’s selective isolation by identifying which pairs of states an attacker can distinguish. This characterization is expressed as a non-interference property, a standard way to formalize confidentiality (Goguen and Meseguer, 1982; Goguen and Meseguer, 1984; Denning, 1976; Volpano et al., 1996; Sabelfeld and Myers, 2003).
Theorem 4.1.
Let r\mathit{r} be an 𝑎𝑡𝑘\mathit{atk}-request and c1,c2\mathit{c}_{1},\mathit{c}_{2} be cache states.
If:
(1)
CHK-743149a08add5461adb09551
., 1996; Sabelfeld and Myers, 2003).
Theorem 4.1.
Let r\mathit{r} be an 𝑎𝑡𝑘\mathit{atk}-request and c1,c2\mathit{c}_{1},\mathit{c}_{2} be cache states.
If:
(1)
c1\mathit{c}_{1} and c2\mathit{c}_{2} are structure-equivalent for 𝑎𝑡𝑘\mathit{atk},
(2)
¬𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡(c1,𝑎𝑡𝑘,r)∧¬𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡(c2,𝑎𝑡𝑘,r)\neg\mathit{firstHit}(\mathit{c}_{1},\mathit{atk},\mathit{r})\wedge\neg\mathit{firstHit}(\mathit{c}_{2},\mathit{atk},\mathit{r}), and
(3)
¬𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡(c1,𝑎𝑡𝑘,r)∧¬𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡(c2,𝑎𝑡𝑘,r)\neg\mathit{unflagHit}(\mathit{c}_{1},\mathit{atk},\mathit{r})\wedge\neg\mathit{unflagHit}(\mathit{c}_{2},\mathit{atk},\mathit{r}),
then 𝑜𝑏𝑠(c1,𝑎𝑡𝑘,r)=𝑜𝑏𝑠(c2,𝑎𝑡𝑘,r)\mathit{obs}(\mathit{c}_{1},\mathit{atk},\mathit{r})=\mathit{obs}(\mathit{c}_{2},\mathit{atk},\mathit{r}).
Theorem 4.1 states that, for all requests satisfying conditions (2) and (3), CacheSolidarity prevents attackers from inferring any information about data stored in cache entries not owned by them. These guarantees are conditional by design, reflecting its lightweight system design and security/performance trade-off.
Next, we describe the two cases not covered by CacheSolidarity:
∙\bullet
Attacks targeting the first entry (condition (2)):
CacheSolidarity does not protect against attacks targeting the first cache entry of a request rr that result in a 𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡\mathit{firstHit}.CHK-07156facc476367a15a87a7a
ry (condition (2)):
CacheSolidarity does not protect against attacks targeting the first cache entry of a request rr that result in a 𝑓𝑖𝑟𝑠𝑡𝐻𝑖𝑡\mathit{firstHit}. This happens because in this case there is no parent node (Figure 5) that CacheSolidarity can flag as potentially involved in an attack. Introducing a “dummy” parent node would make CacheSolidarity fall back to the naive user-level cache isolation.
∙\bullet
Attacks against unflagged prefixes (condition (3)):
CacheSolidarity does not protect unflagged cache entries that result in an 𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡\mathit{unflagHit}, i.e., entries that CacheSolidarity has not yet flagged because their first reuse occurs by the attacker, who correctly guesses the prefix, resulting in a cache hit. This is the only case where an 𝑢𝑛𝑓𝑙𝑎𝑔𝐻𝑖𝑡\mathit{unflagHit} can happen, because CacheSolidarity conservatively flags and isolates any prefixes exactly after they are reused by different users.
The only way to prevent this case is to always treat a cache entry as flagged. However, this would make CacheSolidarity fall back to the naive user-level cache isolation.
Beyond the two cases described above, CacheSolidarity secures the system against APC leaks. Its guarantees do not rely on semantic detection (as in (Chu et al., 2026)), but on monitoring prefix overlap across users.CHK-b357aad5cd124f0f8c3b3dbd
ecures the system against APC leaks. Its guarantees do not rely on semantic detection (as in (Chu et al., 2026)), but on monitoring prefix overlap across users. Moreover, these guarantees hold regardless of whether attacks are performed by a single or multiple attackers, interleaved with benign requests, or under different initial cache states.
Occurrence of CacheSolidarity’s limiting conditions. In practice, these conditions are rarely met. We revisit the real datasets in Table 1, applying the same methodology to identify sensitive content and simulate prompt stealing attacks (Section 2.3). Table 6(b) reports the fraction of prompts with secrets in the first cache entry (condition (2)) and those recoverable on the first attempt (condition (3)). Only 0.01%–1.35% of prompts contain secrets in the first entry. Moreover, short prompts (<100<100 tokens), which are more likely to contain secrets early on, exhibit high KDE overlap (Figure 3), making cache hits and misses harder to distinguish. In practice, prefix caching is typically restricted to long prompts (e.g., >1024>1024 tokens in OpenAI (OpenAI, 2024)), further reducing this risk. For first-try attacks, only 3.24% of prompts are recoverable, on average.
CHK-8f909b82d37b87de024a329e
rompts (e.g., >1024>1024 tokens in OpenAI (OpenAI, 2024)), further reducing this risk. For first-try attacks, only 3.24% of prompts are recoverable, on average. Notably, this assumes an exploitable timing channel; in practice, the factors that impact the exploitability of the timing side channel discussed in Section 2.2, may further limit attack success. In addition, user solidarity in CacheSolidarity can further reduce first-try success: if another user reuses the target prefix before the attacker, the prefix gets isolated and is inaccessible to the attacker.
(a) Secured prompts (%) for CacheSolidarity vs. SafeKV.
Dataset
1st Entry
1st Try
Flan
0.12%
1.51%
UltraChat
0.01%
5.03%
ShareGPT
1.35%
2.63%
OASST1
1.08%
3.8%
(b) Failure cases for CacheSolidarity (first-entry, first-try).
Figure 6. Security vs. SafeKV (θ=100%\theta=100\%) and CacheSolidarity failure cases.
4.2. Security impact of threshold activation
The Activator disables CacheSolidarity’s selective isolation when the KDE overlap over a sliding window hh exceeds a threshold θ\theta, indicating that timing differences are indistinguishable.
This can impact the security of the system in two ways.
First, a low threshold θ\theta may leave the system unprotected when timing leakage is exploitable.
Second, an attacker may manipulate the Activator by shaping traffic patterns.
CHK-48794f5533231ad48660a1fa
hold θ\theta may leave the system unprotected when timing leakage is exploitable.
Second, an attacker may manipulate the Activator by shaping traffic patterns.
For example, issuing bursts of requests to inflate the KDE overlap and force deactivation, or throttling requests to reduce overlap and trigger isolation for probing.
CacheSolidarity mitigates these risks through three design choices. First, the Activator computes the KDE overlap over a sliding window, requiring sustained conditions rather than reacting to transient fluctuations. Second, activation decisions rely on aggregate system-level measurements rather than per-user metrics or prompt semantics, making it difficult for an attacker to influence the observed signal. Finally, cache metadata is always updated: shared prefixes remain flagged even when isolation is disabled, preventing attackers from manipulating cache state.
While dynamic threshold adaptation is possible, it introduces a distinct risk since attackers might shape traffic patterns over time (e.g., sustained high or low load) to steer the system into adapting its threshold to a specific value. Unlike fixed-threshold designs, this creates a feedback loop where adversarial inputs may influence future system decisions, potentially causing the system to keep isolation deactivated.
CHK-c9ac46f43c3dc7eafbfb9d36
igns, this creates a feedback loop where adversarial inputs may influence future system decisions, potentially causing the system to keep isolation deactivated. Even though the sliding window mitigates short-term manipulation, it does not prevent this form of threshold miscalibration. We therefore adopted a static threshold to avoid such feedback-based attacks and ensure predictable behavior, leaving its selection to the administrator following common practice in real-world systems (e.g., Google’s differential privacy deployments (Google Research, 2022)) and the proposed guidelines in Section 5.3.
5. Evaluation
(a) Workload construction.
(b) Cache hit rate.
(c) Average TTFT.
Figure 7. Workload construction and inference performance comparison across workloads and baselines.
We evaluate CacheSolidarity to understand its impact on performance and security in multi-tenant LLM serving environments. Our goal is to quantify the performance benefits under realistic workloads, across LLM families and sizes, while examining the overhead introduced by CacheSolidarity. Specifically, we address the following research questions:
RQ1::
Performance Gains: How much does CacheSolidarity accelerate inference compared to existing defenses across different workloads and models?
RQ2::
Overheads: What are the latency and resource overheads introduced by CacheSolidarity?
RQ3::
CHK-b49032c5a470c1b6125513d5
d to existing defenses across different workloads and models?
RQ2::
Overheads: What are the latency and resource overheads introduced by CacheSolidarity?
RQ3::
Security: Can CacheSolidarity effectively secure prompts that contain private information?
RQ4::
Sensitivity: What is the impact of the activation threshold on CacheSolidarity’s performance and security?
5.1. Experimental Setup
Table 4 summarizes the LLM models used for evaluation, their memory footprint, and the remaining GPU memory available for hosting the KV cache. The serving system is vLLM (vLLM Team, 2024) (version 0.8.5) with a block size of 16. We evaluate the performance of CacheSolidarity on a native hardware server equipped with an NVIDIA A100 GPU (40 GB memory). For larger models, we use a server with 4 H100 GPUs (94 GB each). We evaluate Llama3-70B that needs 131.5 GB of memory, so we configure it with tensor parallelism TP = 2.
Workloads.
For our experiments, we use real prompts from the ShareGPT (anon8231489123, 2023) dataset. We process prompts using the state-of-the-art BERT model (Devlin et al., 2019) (google-bert/bert-base-uncased) to (i) identify and mask sensitive words that contain private information, and (ii) replace masked words with alternative candidates. This allows us to evaluate prompts that share common prefixes but differ in private content (e.g., names, addresses etc).
CHK-9e2790bc76f4d196c645021e
ed words with alternative candidates. This allows us to evaluate prompts that share common prefixes but differ in private content (e.g., names, addresses etc).
Then, we construct different workloads by sampling prompts, varying the level of prefix overlap. Higher overlap means a longer shared prefix, which leads to more cache reuse and better performance. For example, private data at the end of the prompt (“You are a helpful assistant. I want you to write an email to reply to [sensitive information]”) creates high overlap, while at the beginning (“My name is [sensitive information]”) results in minimal overlap. To capture a multi-user environment, we vary both the intra-user reuse (how often a user reuses a previously cached prefix) and inter-user reuse (how much different users share common prefixes). Figure 7(a) illustrates these dimensions across our constructed workloads.
For the experiments in Section 5.2, each workload includes 10 users issuing 100 requests each (1000 total), with arrivals following a Poisson process at a rate of 10 requests per second (RPS = 10), reflecting realistic LLM workloads (Kwon et al., 2023; Agrawal et al., 2023; Zhong et al., 2024; Patel et al., 2024). The Activator of CacheSolidarity is configured with θ=100%\theta=100\% and window h=1h=1 second.
CHK-18d63c2fa5c37280db06523c
Agrawal et al., 2023; Zhong et al., 2024; Patel et al., 2024). The Activator of CacheSolidarity is configured with θ=100%\theta=100\% and window h=1h=1 second. One of the users acts as an adversary targeting a common prompt template, issuing variants with different candidate values at the position of the secret (as described in Section 2.3).
Evaluation Baselines. We compare CacheSolidarity against the following baselines, based on the categorization in Table 2:
∙\bullet
Automatic Prefix Caching (APC): Enables reuse of common prefixes cached across all users (vLLM Team, 2025). This approach maximizes reuse and efficiency but offers no isolation or security guarantees.
∙\bullet
User Cache Isolation: Allocates dedicated KV cache regions per user to ensure isolation and security (Pang et al., 2024; Zheng et al., 2024b; Gu et al., 2025). This eliminates the benefits of caching common prefixes, reducing efficiency.
∙\bullet
Selective Sharing: Uses semantic analysis (rule-based checks and LLM-based validation) to classify prompts as sensitive and selectively isolate them, sharing only non-sensitive ones, as proposed in SafeKV (Chu et al., 2026).
∙\bullet
CacheSolidarity: Our proposed mechanism that isolates prefixes based on sharing behavior across users, without relying on semantics, balancing security and performance.
Implementation Details of the Baselines.
CHK-2b272a9ca2bd5cee61d4fd5c
tes prefixes based on sharing behavior across users, without relying on semantics, balancing security and performance.
Implementation Details of the Baselines.
CacheSolidarity is implemented on top of vLLM (vLLM Team, 2024) (version 0.8.5) with the V1 engine for multi-tenancy. To extend the KV cache as described in 3.2, we extend the KVCacheBlock class with the two metadata fields.
We introduce a new Detector component, as part of the Scheduler that detects malicious requests before scheduling and updates the new metadata fields attack_flag and owner_id.
We extend the metrics collection of vLLM to support the Activator component which is implemented in the asynchronous LLM execution layer.
User cache isolation is implemented by modifying vLLM to prepend a unique user identifier (a single token) to each request, effectively preventing prefix sharing across users.
The semantic-aware selective sharing baseline, SafeKV (Chu et al., 2026), is built on SGLang’s tree-based architecture (Team, 2024) and is not open-sourced. We therefore implement it on top of vLLM (vLLM Team, 2024) (version 0.8.5) V1 engine, following the methodology described in the paper, to the best of our understanding.
SafeKV consists of three components. First, an asynchronous three-stage detection pipeline that decides whether each KV entry is private or shareable.
CHK-8ed852d427e55afd356e7d02
standing.
SafeKV consists of three components. First, an asynchronous three-stage detection pipeline that decides whether each KV entry is private or shareable. It uses (i) a rule-based detector covering 34 categories of sensitive information (pii-extract 0.0.2 (Villegas, 2024)), (ii) a lightweight LLM-based classifier (Llama-3.2-1B (Meta AI, 2024b)) for cases not matched by these rules, and (iii) a final step that uses the serving LLM to resolve remaining uncertain cases. Each stage performs a pass over the prompt to identify sensitive content and, when found, it produces a structured output (e.g., a JSON record specifying whether private information is present, along with its position and semantic category). Second, a cache index that enforces access control using per-entry privacy and ownership metadata, similar to CacheSolidarity. Third, a runtime safeguard that monitors user access patterns, specifically whether entries are repeatedly accessed by only a few users, and disables sharing when such behavior appears suspicious. All new cache entries are marked private by default, while the detection pipeline runs asynchronously. Once it completes, only the non-sensitive prefix will be marked as shareable. The runtime safeguard continuously runs in the background.
CHK-bb58de8c1914358bec08e4c0
ne runs asynchronously. Once it completes, only the non-sensitive prefix will be marked as shareable. The runtime safeguard continuously runs in the background. Finally, while SGLang enforces metadata at token granularity, the vLLM implementation operates at the KV block level.
5.2. Comparison Against Baselines
In this section, we compare CacheSolidarity against the baselines, focusing on inference performance across workloads and models, system overheads, and security.
5.2.1. Across Workloads
Figure 7 reports average time-to-first-token (TTFT) and cache hit rate across the five representative workloads (Figure 7(a)) and their aggregate average. The reported values exclude the attacker. This experiment runs inference of Llama-13B on a single A100 GPU. Hence, for the SafeKV baseline, the validation LLM runs on the same GPU as the inference model, competing for GPU cycles and reducing the effective KV cache capacity compared to CacheSolidarity (Table 4). In addition, prefix reuse across users is delayed until the asynchronous semantic validation completes (either rule- or LLM-based), further limiting potential cache hits. Across workloads, most secrets (62%–81.3%) are detected by the rule-based Tier-1, with the remainder handled by Tier-2 (the validation LLM, Llama-3.2-1B).
CHK-db821cd975765d909517e4aa
hits. Across workloads, most secrets (62%–81.3%) are detected by the rule-based Tier-1, with the remainder handled by Tier-2 (the validation LLM, Llama-3.2-1B). As inter-user reuse increases, more repeated prompts are handled by Tier-1, reducing reliance on LLM-based validation. For the average workload, 63.4% of secrets are detected by Tier-1 and 36.6% by Tier-2, with average latencies of 8.1 ms and 2.6 sec, respectively; Tier-3 is never reached. Although Tier-2 uses a lightweight LLM, its latency is dominated by response generation (i.e., JSON output) and by GPU contention, as it runs alongside the inference model on the same GPU. These semantic validation delays alongside the reduced KV cache capacity, combined with LRU eviction, may cause less frequently reused prefixes to be evicted before they are validated and shared across users.
Workloads with high intra-user reuse. In Workload 1 where users repeat similar prompts but do not share common prefixes, all baselines perform similar to cache isolation. Similarly, Workload 2 introduces moderate inter-user reuse. As expected, User Cache Isolation suffers lower hit rate because it misses shared prefixes, while CacheSolidarity stays very close to Prefix Caching, preserving most performance benefits. SafeKV has slightly reduced hit rate, thus slightly higher TTFT.
Workloads with high inter-user reuse.
CHK-95884059a851e1dc72b42149
to Prefix Caching, preserving most performance benefits. SafeKV has slightly reduced hit rate, thus slightly higher TTFT.
Workloads with high inter-user reuse. In Workload 4, where inter-user reuse dominates but some intra-user reuse remains, both CacheSolidarity and SafeKV experience reduced hit rates. However, SafeKV incurs higher TTFT, revealing a key limitation of semantic-based isolation beyond resource contention: prefixes under semantic validation cannot be reused across users, causing them to miss potential hits and, under high reuse, be evicted before reuse even occurs. This issue does not arise in CacheSolidarity, which enables immediate prefix reuse.
Workload 5 has high inter-user reuse and zero intra-user reuse, meaning that users ask similar prompts to each other but not to themselves, leading to zero hit rate of cache isolation. In addition, we see that CacheSolidarity’s lightweight design does not hurt performance: TTFT remains very close to Prefix Caching, and hit rate is similarly high. SafeKV, for the reasons mentioned already, shows reduced performance.
Average Case.
CHK-045ee7c38cffc67d006316a1
TTFT remains very close to Prefix Caching, and hit rate is similarly high. SafeKV, for the reasons mentioned already, shows reduced performance.
Average Case.
Across all workloads, CacheSolidarity significantly improves over User Cache Isolation while remaining within 5–10% of Prefix Caching, whereas SafeKV consistently incurs lower hit rates and higher TTFT due to the delay in reuse until semantic validation finishes and the reduced cache capacity in a single GPU. The hit-rate gap to Prefix Caching reflects false positives: safe prefixes isolated because CacheSolidarity relies on reuse behavior, not semantics.
5.2.2. Across LLM Models
Model (Abbrev.)
Model
CacheSolidarity
SafeKV
GB
%
GB
%
Gemma3-4B (Google DeepMind, 2025)
8.6 GB
31.4 GB
78.5%
28.8 GB
77.0%
Llava-0.5B (LLaVA Team, 2024a)
1.68 GB
38.32 GB
95.8%
35.72 GB
95.5%
Llava-7B (LLaVA Team, 2024b)
15.03 GB
24.97 GB
62.4%
22.37 GB
59.8%
Llama2-7B (Meta AI, 2023b)
12.6 GB
27.4 GB
68.5%
24.8 GB
66.3%
Llama2-13B (Meta AI, 2023a)
24.3 GB
15.7 GB
39.3%
13.1GB
35.0%
Llama3-70B (Meta AI, 2024a)
131.5 GB
56.6 GB
30.05%
56.5 GB
30.05%
Qwen2-2B (Alibaba Cloud, 2024a)
4.15 GB
35.85 GB
89.6%
33.25 GB
88.9%
Qwen2.5-3B (Alibaba Cloud, 2024c)
7.16 GB
32.84 GB
82.1%
30.24 GB
80.9%
Qwen2-7B (Alibaba Cloud, 2024b)
15.53 GB
24.47 GB
61.2%
21.87 GB
58.5%
Qwen2.5-7B (Alibaba Cloud, 2024d)
15.63 GB
24.37 GB
60.9%
21.77 GB
58.2%
Table 4.
CHK-d153f7160834f1fff5bd4efc
B
80.9%
Qwen2-7B (Alibaba Cloud, 2024b)
15.53 GB
24.47 GB
61.2%
21.87 GB
58.5%
Qwen2.5-7B (Alibaba Cloud, 2024d)
15.63 GB
24.37 GB
60.9%
21.77 GB
58.2%
Table 4. Evaluated LLM models and memory allocation.
Figure 8. Hit rate and TTFT across LLMs.
Figure 8 reports cache hit rate and TTFT of CacheSolidarity and the baselines across LLMs (Table 4), evaluated on a single A100 GPU under the average workload (Figure 7(a)). Model size affects both KV cache capacity (larger models leave less space) and inference speed, with smaller models achieving lower TTFT (Papaioannou and Doudali, 2024).
For SafeKV, the LLM-based validator runs on the same GPU for all A100 experiments, as done in Section 5.2.1. However, for Llama3-70B, which runs on a 4 H100 GPU server with TP = 2, the validator executes on a separate GPU, avoiding resource contention and preserving KV cache capacity.
We observe that CacheSolidarity effectively closes the performance gap between Prefix Caching and User Cache Isolation remaining within a 6% TTFT margin of Prefix Caching, while significantly outperforming User Cache Isolation. Two cases in the performance comparison of the baselines stand out. First,
for Llama2-13B the KV cache size is very small (Table 4), almost half the size compared to the rest of the models, causing frequent evictions and more cache misses, reducing the hit rate of CacheSolidarity.
CHK-e4b83543da1ad736718333ed
(Table 4), almost half the size compared to the rest of the models, causing frequent evictions and more cache misses, reducing the hit rate of CacheSolidarity. In this case, SafeKV exhibits the lowest hit rate due to the combined effect of even smaller effective cache capacity and resource contention with its LLM-based validator running on the same A100 GPU.
However, this limitation is mitigated when executing the Llama3-70B model on a 4×H100 GPU server. This is the only case where SafeKV performs significantly better than cache isolation and closer to CacheSolidarity. This is because the validator runs on a separate GPU, eliminating resource contention, while the longer inference time of the 70B model hides semantic validation overheads, also removing the validation-delay effects observed in Section 5.2.1.
In conclusion, the performance of CacheSolidarity remains close to Prefix Caching and better than semantic-based alternatives across all LLM model families and sizes.
Figure 9. Baseline comparison of TTFT and Hit Rate across increasing RPS for workload 5.
Component
Time
Memory
Detector
0.004 ms per request
32 bytes per cache entry
Activator
0.003 ms
16 bytes * len(window)
Table 5. Overhead of CacheSolidarity’s components.
5.2.3. Across Request Rates
CHK-6a01ed7afc6d5d790a135b01
s per request
32 bytes per cache entry
Activator
0.003 ms
16 bytes * len(window)
Table 5. Overhead of CacheSolidarity’s components.
5.2.3. Across Request Rates
Figure 9 shows the performance comparison across baselines and increasing request rate (RPS) for the Llama2-13B model on a single A100 GPU. We use Workload 5 where any reuse comes from sharing prefixes across users, which directly stresses the mechanisms that enable or delay cross-user reuse.
Regarding hit rate, it is zero for User Cache Isolation as there is no intra-user reuse, while CacheSolidarity remains high and close to Prefix Caching. For these baselines, hit rate stays constant as RPS increases, since reuse patterns remain unchanged. In contrast, SafeKV’s hit rate drops with increasing load due to limited KV cache capacity and semantic validation delays: prefixes are blocked from reuse during validation, leading to delayed hits, coupled with higher request rates that lead to higher cache eviction rates under LRU.
This is reflected in the average TTFT, which increases more sharply for SafeKV compared to the other baselines, where a modest increase is expected due to the higher load.
5.2.4. Overheads.
Table 5 summarizes the operational overheads introduced by the two components of CacheSolidarity in terms of latency and memory resources.
CHK-f996b1de0fa04b8e625be527
d.
5.2.4. Overheads.
Table 5 summarizes the operational overheads introduced by the two components of CacheSolidarity in terms of latency and memory resources.
In terms of per-request latency, CacheSolidarity’s modifications over vanilla vLLM (i.e., the selective isolation scheme and the activator component) introduce an average per-request overhead of only 0.007 ms (0.004 ms due to the detector component and 0.003 ms due to the activator component).
In terms of memory, the metadata introduced by the detector component amount to 32 bytes per cache entry, since each KVCache block was extended with two metadata fields—owner_id and attack_flag—of type int.22
2
Since vLLM is implemented in Python, adding two int fields (as Python objects) to the KVCache class results in an increase of 32 bytes.
In contrast, the activator component stores 1 floating point value per request in the sliding window.33
3
Again, a floating point value in Python takes up to 16 bytes.
Notably, overheads scale with the size of the KV cache (Table 4), rather than the number of users, since no per-user state is maintained. SafeKV (Chu et al., 2026) uses similar metadata to enforce per-user prefix isolation, while Table 4 also captures its additional storage overhead, when the LLM-based validator (Tier-2) is colocated on the same GPU, reducing the available KV cache.
5.2.5. Security.
CHK-b7d2b26ece97b2f15a37d040
captures its additional storage overhead, when the LLM-based validator (Tier-2) is colocated on the same GPU, reducing the available KV cache.
5.2.5. Security.
Figure 6(a) compares the fraction of prompts secured by CacheSolidarity across real-world datasets (Table 1) with the Activator set to θ=100%\theta=100\%, against the semantic-aware baseline SafeKV (Chu et al., 2026). Overall, CacheSolidarity achieves high protection (96.12%), closely matching SafeKV (96.95%). For SafeKV, across datasets, 62.5% of prompts are handled by Tier-1 (6.5 ms average latency), 32.19% by Tier-2 (Llama-3.2-1B, 1.8 s), and 2.26% by Tier-3 (Llama2-13B, 4.5 s). The higher latency of Tier-2 and Tier-3 is due to LLM-based processing, which scales with the LLM size and includes the time it takes to generate the structured JSON output. The remaining 3.05% of prompts contain secrets that are not detected due to semantic limitations. SafeKV fails to secure this small subset of prompts due to misclassification, particularly for implicit or context-dependent information (e.g., “I work in the only bakery in the city”), obfuscated forms (e.g., “john dot smith at protonmail dot com”), and cross-alphabet, multilingual, or inferred sensitive information (e.g., “I pick up insulin weekly”).
CHK-ae5e8433c6b444f0e092da78
ed forms (e.g., “john dot smith at protonmail dot com”), and cross-alphabet, multilingual, or inferred sensitive information (e.g., “I pick up insulin weekly”). In contrast, CacheSolidarity successfully protects these cases, but fails in a small subset of first-try, first-entry cases, discussed in Section 4.1.
5.3. Sensitivity Analysis
We evaluate CacheSolidarity’s sensitivity to the Activator’s threshold θ\theta. Given the KDE overlap over a window hh, the Activator enables prefix isolation (the Detector) when overlap(hh) <θ<\theta. Thus, θ=0%\theta=0\% corresponds to the Prefix Caching baseline (no security) and θ=100%\theta=100\% to CacheSolidarity with the Detector always on. We run Llama2-13B on a single A100 GPU over Workload 4 for 10 minutes. Figure 10 shows how the overlap varies over time, due to the workload’s prompt lengths and request rate. We consider a continuous attack setting, marking in red the time points where the attacker successfully reconstructs sensitive information and attempts to steal the prompt.
Figure 10 reports the corresponding attack success rate (ASR), capturing how often attacks succeed as a function of both the threshold θ\theta and the strength of the timing side channel. When θ=0%\theta=0\%, the ASR is below 100% because some attacks inherently fail due to weak timing differences (high KDE overlap) regardless of the threshold.
CHK-a73b59e0d563d4474583ad93
. When θ=0%\theta=0\%, the ASR is below 100% because some attacks inherently fail due to weak timing differences (high KDE overlap) regardless of the threshold. As θ\theta increases, the ASR decreases, since the Activator isolates a larger fraction of prefixes. Intuitively, for a given θ\theta, CacheSolidarity protects against attacks that fall within the green region in Figure 10. Beyond θ≈60%\theta\approx 60\%, CacheSolidarity reduces the ASR to zero, fully preventing successful prompt stealing attacks.
Figure 10 shows the corresponding performance (hit rate and average TTFT). As expected, higher θ\theta leads to more prefix isolation, thus reduced hit rate and increased TTFT, capturing the performance-security trade-off that CacheSolidarity’s Activator introduces.
Recommendations on the use of prefix isolation and its activation threshold.
Table 6 summarizes threshold recommendations for system administrators. For privacy-critical applications (e.g., medical, legal, confidential chats), high thresholds (80–100%) provide strong protection. For general-purpose applications (e.g., customer support, productivity assistants), mid-range thresholds (50–70%) balance security and performance.
CHK-15dc4d78f89b4a9c40424de1
protection. For general-purpose applications (e.g., customer support, productivity assistants), mid-range thresholds (50–70%) balance security and performance. For latency-sensitive or high-throughput systems (e.g., real-time assistants, streaming agents, or high-traffic APIs), lower thresholds (20–40%) prioritize performance, as high load already limits attack success.
Lastly, for privacy-critical applications, even high thresholds may fail to secure a small fraction of prompts, as discussed in §4.1 and §5.2.5. If absolute security is needed, full cache isolation is the only reliable approach. Neither CacheSolidarity nor SafeKV provide complete security: both leave approximately 3-4% of prompts unprotected (Figure 6), due to CacheSolidarity’s first-entry, first-try limitation and semantic misclassification in SafeKV, respectively.
Figure 10. Sensitivity analysis of the Activator’s threshold θ\theta selection on system security and performance.
Application Type
θ\theta
Rationale
Privacy-critical
80-100%
High security, acceptable performance overheads
General-purpose
50-70%
Balanced between security and cache reuse, performance
Latency-sensitive
20-40%
High performance, less isolation as high load already limits attack success
Table 6. Recommended threshold θ\theta by application type.
6. Related Work
Optimizations of LLM Serving Systems.
CHK-c902427a5b5165cfb709833a
on as high load already limits attack success
Table 6. Recommended threshold θ\theta by application type.
6. Related Work
Optimizations of LLM Serving Systems.
Recent system-level optimizations use approximate techniques, such as modifying the attention mechanism (Liu et al., 2024a; Xiao et al., 2024; Jiang et al., 2024; Desai et al., 2025; Zhu et al., 2025), reusing (Gim et al., 2024; Gao et al., 2024; Yao et al., 2025), or compressing the KV cache (Lee et al., 2024; Fu et al., 2024; Sun et al., 2025; Liu et al., 2024b; Tang et al., 2024; Shi et al., 2026).
However, these techniques sacrifice accuracy for faster inference.
In contrast, exact techniques aim to reduce the latency by efficiently managing the KV cache (Kwon et al., 2023; Qin et al., 2025; Yu et al., 2025), sharing prefixes (Ye et al., 2024; Jin et al., 2025; Juravsky et al., 2024; Lin et al., 2024), or optimizing scheduling decisions (Agrawal et al., 2023; Agrawal et al., 2024b; Agrawal et al., 2024a; Holmes et al., 2024; Zhao et al., 2024; Chen et al., 2024).
Other approaches attempt to mitigate the impact of long-context processing by disaggregating the prefill and decode phases of inference (Zhong et al., 2024; Patel et al., 2024) or rescheduling requests to reduce memory fragmentation (Sun et al., 2024).
Side-channels and performance optimizations.
CHK-45f295a90bc7dda00650c096
hong et al., 2024; Patel et al., 2024) or rescheduling requests to reduce memory fragmentation (Sun et al., 2024).
Side-channels and performance optimizations.
Performance optimizations improve average-case resource usage (e.g., latency, memory, energy), but introduce variability that can expose side channels exploitable by attackers. Historically, attacks targeted physical effects such as power or electromagnetic leakage, requiring direct access. More recently, they exploit shared hardware resources such as caches (Yarom and Falkner, 2014), DRAM (Pessl et al., 2016), BPUs (Evtyushkin et al., 2018),
and execution ports (Aldaya et al., 2019). Side channels also arise in software systems like browsers (Vila and Kopf, 2017; Snyder et al., 2023), operating systems (Hähnel et al., 2017), and network protocols (Mehta et al., 2022; Wright et al., 2008).
Timing Side-Channel Attacks in LLM Serving Systems.
Recent work shows that optimizations such as KV caching and prefix reuse introduce exploitable timing leaks, where differences between cache hits and misses can expose private information in prompts (Song et al., 2025; Zheng et al., 2024b; Gu et al., 2025). Beyond caching, inference optimizations (e.g., speculative decoding) also introduce timing variations that can leak sensitive information (Carlini and Nasr, 2024).
CHK-6fc491d5f75e672389854642
ond caching, inference optimizations (e.g., speculative decoding) also introduce timing variations that can leak sensitive information (Carlini and Nasr, 2024). Other work exploits scheduling behavior rather than timing differences to reconstruct prompts (Wu et al., 2025). Together, these works highlight the vulnerabilities introduced by LLM serving optimizations and the need for robust defenses.
7. Summary
We present CacheSolidarity, a system that secures LLM serving against timing side-channel attacks introduced by Automatic Prefix Caching (APC) without sacrificing performance. CacheSolidarity monitors cross-user prefix reuse, flags suspicious reuse of cached prefixes, and selectively isolates affected prefixes using lightweight KV cache metadata, without the need to analyze prompt semantics. Our evaluation shows that CacheSolidarity provides effective protection against prompt-stealing attacks while maintaining high performance and scalability, bridging the gap between insecure APC and slow isolation-based defenses.
Acknowledgements.
We thank the anonymous reviewers for their constructive feedback.
The project has been partially funded by the Sponsor European Research Council https://erc.europa.eu/ under the ERC Consolidator grant PRIMULA Grant #101230068.44
4
CHK-742e6be0ac2931a3879037f0
roject has been partially funded by the Sponsor European Research Council https://erc.europa.eu/ under the ERC Consolidator grant PRIMULA Grant #101230068.44
4
Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the ERC. Neither the European Union nor the ERC can be held responsible for them.
Also from the Spanish Ministry of Science, Innovation and Universities (MICIU/AEI/10.13039/501100011033) under the projects EUR2025-164828 (SINTRAZAS), RYC2021-032614-I, PID2022-142290 OB-I00 (ESPADA), and CEX2024-001471-M; the Madrid Regional Government through the César Nombela grant (2024-T1/COM-31302) and from the Comunidad de Madrid through the DATIA project, co-funded by FEDER UE.
References
Acharya and Shrestha (2025)
P. Acharya and L. Shrestha
A comparative study of light-weight language models for PII masking and their deployment for real conversational texts.
arXiv preprint arXiv:2512.18608.
External Links: Document
Cited by: §2.3.
Agrawal et al. (2024a)
A. Agrawal, J. Chen, Í. Goiri, R. Ramjee, C. Zhang, A. Tumanov, and E. Choukse
Mnemosyne: parallelization strategies for efficiently serving multi-million context length llm inference requests without approximations.
External Links: 2409.17264,
Link
Cited by: §6.
Agrawal et al. (2024b)
A. Agrawal, N. Kedia, A. Panwar, J. Mohan, N. Kwatra, B. S.
CHK-88e2ab0bce6214e649021fd3
quests without approximations.
External Links: 2409.17264,
Link
Cited by: §6.
Agrawal et al. (2024b)
A. Agrawal, N. Kedia, A. Panwar, J. Mohan, N. Kwatra, B. S. Gulavani, A. Tumanov, and R. Ramjee
Taming throughput-latency tradeoff in llm inference with sarathi-serve.
In Proceedings of the 18th USENIX Conference on Operating Systems Design and Implementation,
OSDI’24, USA.
External Links: ISBN 978-1-939133-40-3
Cited by: §1,
Example 2.2,
§6.
Agrawal et al. (2023)
A. Agrawal, A. Panwar, J. Mohan, N. Kwatra, B. S. Gulavani, and R. Ramjee
SARATHI: efficient llm inference by piggybacking decodes with chunked prefills.
External Links: 2308.16369,
Link
Cited by: §1,
Example 2.2,
§5.1,
§6.
Ai4Privacy (2024)
Ai4Privacy
PII-masking-200k: a dataset for personally identifiable information masking.
Note: https://huggingface.co/datasets/ai4privacy/pii-masking-200kAccessed: 2024
Cited by: §2.3.
Ai4Privacy (2026)
Ai4privacy (version 0.5.0)
Note: PyPI package version 0.5.0, accessed: 2026-05-20
External Links: Link
Cited by: §2.3.
Aldaya et al. (2019)
A. C. Aldaya, B. B. Brumley, S. ul Hassan, C. P. García, and N. Tuveri
Port Contention for Fun and Profit.
In Proceedings of the 40th IEEE Symposium on Security and Privacy,
S&P ’19.
Cited by: §6.
Alibaba Cloud (2024a)
Alibaba CloudQwen2-vl 2b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
CHK-9e6855a395ed7e301baab02b
ited by: §6.
Alibaba Cloud (2024a)
Alibaba CloudQwen2-vl 2b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Alibaba Cloud (2024b)
Alibaba CloudQwen2-vl 7b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Alibaba Cloud (2024c)
Alibaba CloudQwen2.5-vl 3b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Alibaba Cloud (2024d)
Alibaba CloudQwen2.5-vl 7b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Amazon Web Services (2025)
Amazon Web Services
Prompt caching for Amazon Bedrock.
Note: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
Cited by: §2.4,
Table 3.
anon8231489123 (2023)
anon8231489123
ShareGPT Vicuna unfiltered.
Note: https://huggingface.co/datasets/anon8231489123/ShareGPT%20Vicuna%20unfilteredDataset on Hugging Face
Cited by: Table 1,
§5.1.
Anthropic (2026)
Anthropic
Prompt caching — Claude API documentation.
Note: https://docs.anthropic.com/en/docs/build-with-claude/prompt-cachingWorkspace-level isolation enforced from February 5, 2026
Cited by: §2.4,
Table 3.
Bang (2023)
F. Bang
GPTCache: an open-source semantic cache for LLM applications enabling faster answers and cost savings.
CHK-d7ca5e4ef18030a77538bc3a
ary 5, 2026
Cited by: §2.4,
Table 3.
Bang (2023)
F. Bang
GPTCache: an open-source semantic cache for LLM applications enabling faster answers and cost savings.
In Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023),
pp. 212–218.
Cited by: §1.
Bortz and Boneh (2007)
A. Bortz and D. Boneh
Exposing private information by timing web applications.
In Proceedings of the 16th International Conference on World Wide Web,
WWW ’07, New York, NY, USA, pp. 621–628.
External Links: ISBN 9781595936547,
Link,
Document
Cited by: §1.
Brown et al. (2020)
T. Brown, B. Mann, N. Ryder, et al.
Language models are few-shot learners.
Advances in Neural Information Processing Systems 33, pp. 1877–1901.
Cited by: §1,
§2.1.
Carlini and Nasr (2024)
N. Carlini and M. Nasr
Remote timing attacks on efficient language model inference.
External Links: 2410.17175,
Link
Cited by: §1,
§2.4,
Table 2,
§6.
Chen et al. (2024)
S. Chen, Y. Lin, M. Zhang, and Y. Wu
Efficient and economic large language model inference with attention offloading.
External Links: 2405.01814,
Link
Cited by: §6.
Cheng et al. (2025)
S. Cheng, Z. Li, S. Meng, M. Ren, H. Xu, S. Hao, C. Yue, and F. Zhang
Understanding PII leakage in large language models: a systematic survey.
In Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence (IJCAI-25),
pp. 10409–10417.
CHK-380369950a18ed478e5b9901
anguage models: a systematic survey.
In Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence (IJCAI-25),
pp. 10409–10417.
External Links: Document
Cited by: §2.3.
Chu et al. (2026)
K. Chu, Z. Lin, D. Xiang, Z. Shen, J. Su, C. Chu, Y. Yang, W. Zhang, W. Wu, and W. Zhang
Selective kv-cache sharing to mitigate timing side-channels in llm inference.
External Links: 2508.08438,
Link
Cited by: §1,
§2.2,
§2.3,
§2.4,
§2.4,
Table 2,
§3.1,
§4.1,
3rd item,
§5.1,
§5.2.4,
§5.2.5.
Dahlberg and Pulls (2023)
R. Dahlberg and T. Pulls
Timeless timing attacks and preload defenses in tor’s DNS cache.
In 32nd USENIX Security Symposium (USENIX Security 23),
Anaheim, CA, pp. 2635–2652.
External Links: ISBN 978-1-939133-37-3,
Link
Cited by: §1.
Data Provenance Initiative (2024)
Data Provenance Initiative
Commercial flan collection: dialog.
Note: https://huggingface.co/datasets/DataProvenanceInitiative/Commercial-Flan-Collection-DialogAccessed: 2026-05-20
Cited by: Table 1.
DeepMind (2025)
DeepMindGemini(Website)
External Links: Link
Cited by: §1,
§2.1.
DeepSeek (2024)
DeepSeekDeepSeek api docs: deepseek api introduces context caching on disk, cutting prices by an order of magnitude(Website)
Note: Accessed: 2025-07-17
External Links: Link
Cited by: §1,
§2.1.
Denning (1976)
D. E. Denning
A lattice model of secure information flow.
CHK-78902e958f941aaef92da3d9
magnitude(Website)
Note: Accessed: 2025-07-17
External Links: Link
Cited by: §1,
§2.1.
Denning (1976)
D. E. Denning
A lattice model of secure information flow.
Communications of the ACM 19 (5), pp. 236–243.
Cited by: §4.1.
Desai et al. (2025)
A. Desai, S. Yang, A. Cuadron, A. Klimovic, M. Zaharia, J. E. Gonzalez, and I. Stoica
HashAttention: semantic sparsity for faster inference.
In Proceedings of the 42nd International Conference on Machine Learning (ICML),
PMLR, Vol. 267.
Cited by: §6.
Devlin et al. (2019)
J. Devlin, M. Chang, K. Lee, and K. Toutanova
BERT: pre-training of deep bidirectional transformers for language understanding.
In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers),
pp. 4171–4186.
External Links: Document
Cited by: §2.3,
§5.1.
Evtyushkin et al. (2018)
D. Evtyushkin, R. Riley, N. B. Abu-Ghazaleh, and D. Ponomarev
BranchScope: A New Side-Channel Attack on Directional Branch Predictor.
In Proceedings of the 23rd International Conference on Architectural Support for Programming Languages and Operating Systems,
ASPLOS ’18.
Cited by: §6.
Fu et al. (2024)
Q. Fu, M. Cho, T. Merth, S. Mehta, M. Rastegari, and M. Najibi
LazyLLM: Dynamic Token Pruning for Efficient Long Context LLM Inference.
In ICML 2024 Workshops: ES-FoMo-II,
CHK-8928d0807f96b579cc771397
o, T. Merth, S. Mehta, M. Rastegari, and M. Najibi
LazyLLM: Dynamic Token Pruning for Efficient Long Context LLM Inference.
In ICML 2024 Workshops: ES-FoMo-II,
External Links: Link
Cited by: §6.
Gao et al. (2024)
B. Gao, Z. He, P. Sharma, Q. Kang, D. Jevdjic, J. Deng, X. Yang, Z. Yu, and P. Zuo
Cost-efficient large language model serving for multi-turn conversations with cachedattention.
In Proceedings of the 2024 USENIX Conference on Usenix Annual Technical Conference,
USENIX ATC’24, USA.
External Links: ISBN 978-1-939133-41-0
Cited by: §6.
Gim et al. (2024)
I. Gim, G. Chen, S. Lee, N. Sarda, A. Khandelwal, and L. Zhong
Prompt cache: modular attention reuse for low-latency inference.
In Proceedings of Machine Learning and Systems (MLSys),
Cited by: §6.
GitHub Security Advisory (2025)
GitHub Security Advisory
CVE-2025-25183: vLLM prefix cache hash collision (GHSA-rm76-4mrf-v9r8) and timing side-channel (GHSA-4qjh-9fv9-r85r).
Note: https://github.com/vllm-project/vllm/security/advisories/
Cited by: Table 3.
Goguen and Meseguer (1982)
J. A. Goguen and J. Meseguer
Security policies and security models.
In Proceedings of the IEEE Symposium on Security and Privacy,
pp. 11–20.
Cited by: §4.1.
Goguen and Meseguer (1984)
J. A. Goguen and J. Meseguer
Unwinding and inference control.
In Proceedings of the IEEE Symposium on Security and Privacy,
pp. 75–86.
Cited by: §4.1.
CHK-b4d750f9520f66a48b5ba750
r (1984)
J. A. Goguen and J. Meseguer
Unwinding and inference control.
In Proceedings of the IEEE Symposium on Security and Privacy,
pp. 75–86.
Cited by: §4.1.
Google Cloud (2025)
Google Cloud
Context caching — Gemini API documentation.
Note: https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview
Cited by: §2.4,
Table 3.
Google DeepMind (2025)
Google DeepMindGemma 3 4b instruct model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Google Research (2022)
Google Research
Securing private data at scale with differentially private partition selection.
Note: https://research.google/blog/securing-private-data-at-scale-with-differentially-private-partition-selection/Accessed: 2026-05
Cited by: §4.2.
Gras et al. (2017)
B. Gras, K. Razavi, E. Bosman, H. Bos, and C. Giuffrida
ASLR on the line: practical cache attacks on the MMU.
In Proceedings of the Network and Distributed System Security Symposium (NDSS ’17),
External Links: Link
Cited by: §2.4.
Gruss et al. (2019)
D. Gruss, E. Kraft, T. Tiwari, M. Schwarz, A. Trachtenberg, J. Hennessey, A. Ionescu, and A. Fogh
Page cache attacks.
In Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security,
CCS ’19, New York, NY, USA, pp. 167–180.
External Links: ISBN 9781450367479,
Link,
Document
Cited by: §1.
Gu et al. (2025)
C. Gu, X. L. Li, R.
CHK-67114acee1c2f2daa412c979
cations Security,
CCS ’19, New York, NY, USA, pp. 167–180.
External Links: ISBN 9781450367479,
Link,
Document
Cited by: §1.
Gu et al. (2025)
C. Gu, X. L. Li, R. Kuditipudi, P. Liang, and T. Hashimoto
Auditing prompt caching in language model APIs.
In Proceedings of the 42nd International Conference on Machine Learning, A. Singh, M. Fazel, D. Hsu, S. Lacoste-Julien, F. Berkenkamp, T. Maharaj, K. Wagstaff, and J. Zhu (Eds.),
Proceedings of Machine Learning Research, Vol. 267, pp. 20477–20496.
External Links: Link
Cited by: §1,
§1,
§1,
§2.2,
§2.3,
§2.4,
Table 2,
§3.1,
2nd item,
§6.
Hähnel et al. (2017)
M. Hähnel, W. Cui, and M. Peinado
High-resolution side channels for untrusted operating systems.
In Proceedings of the 2017 USENIX Conference on Usenix Annual Technical Conference,
USENIX ATC ’17, USA, pp. 299–312.
External Links: ISBN 9781931971386
Cited by: §6.
Holmes et al. (2024)
C. Holmes, M. Tanaka, M. Wyatt, A. A. Awan, J. Rasley, S. Rajbhandari, R. Y. Aminabadi, H. Qin, A. Bakhtiari, L. Kurilenko, and Y. He
DeepSpeed-fastgen: high-throughput text generation for llms via mii and deepspeed-inference.
External Links: 2401.08671,
Link
Cited by: §1,
§6.
Inman and Bradley (1989)
H. F. Inman and E. L. Bradley
The overlapping coefficient as a measure of agreement between probability distributions.
Communications in Statistics-Theory and Methods 18 (10), pp. 3851–3874.
CHK-b4c31b848c5e91f32dfc35e2
he overlapping coefficient as a measure of agreement between probability distributions.
Communications in Statistics-Theory and Methods 18 (10), pp. 3851–3874.
External Links: Document
Cited by: §2.2,
§3.3.
Jiang et al. (2024)
H. Jiang, Y. Li, C. Zhang, Q. Wu, X. Luo, S. Ahn, Z. Han, A. H. Abdi, D. Li, C. Lin, Y. Yang, and L. Qiu
MInference 1.0: accelerating pre-filling for long-context llms via dynamic sparse attention.
In Advances in Neural Information Processing Systems (NeurIPS),
Vol. 37.
Cited by: §6.
Jin et al. (2025)
C. Jin, Z. Zhang, X. Jiang, F. Liu, S. Liu, X. Liu, and X. Jin
RAGCache: efficient knowledge caching for retrieval-augmented generation.
ACM Trans. Comput. Syst. 44 (1).
External Links: ISSN 0734-2071,
Link,
Document
Cited by: §6.
Juravsky et al. (2024)
J. Juravsky, B. Brown, R. S. Ehrlich, D. Y. Fu, C. Re, and A. Mirhoseini
Hydragen: high-throughput LLM inference with shared prefixes.
In Workshop on Efficient Systems for Foundation Models II @ ICML2024,
External Links: Link
Cited by: §1,
§6.
Kohlbrenner and Shacham (2016)
D. Kohlbrenner and H. Shacham
Trusted browsers for uncertain times.
In Proceedings of the 25th USENIX Conference on Security Symposium,
SEC’16, USA, pp. 463–480.
External Links: ISBN 9781931971324
Cited by: §2.4.
Kwon et al. (2023)
W. Kwon, Z. Li, S. Zhuang, Y. Sheng, L. Zheng, C. H. Yu, J. E. Gonzalez, H. Zhang, and I. Stoica
CHK-b86a52ef266aeaf9a2bd662c
l Links: ISBN 9781931971324
Cited by: §2.4.
Kwon et al. (2023)
W. Kwon, Z. Li, S. Zhuang, Y. Sheng, L. Zheng, C. H. Yu, J. E. Gonzalez, H. Zhang, and I. Stoica
Efficient memory management for large language model serving with PagedAttention.
In Proceedings of the 29th Symposium on Operating Systems Principles (SOSP ’23),
pp. 611–626.
External Links: Document
Cited by: §1,
§2.1,
§5.1,
§6.
Lee et al. (2024)
W. Lee, J. Lee, J. Seo, and J. Sim
InfiniGen: efficient generative inference of large language models with dynamic KV cache management.
In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24),
Santa Clara, CA, pp. 155–172.
External Links: ISBN 978-1-939133-40-3,
Link
Cited by: §1,
§6.
Lin et al. (2024)
J. Lin, S. Q. Zhang, and A. Leon-Garcia
SLLM: accelerating llm inference using semantic load balancing with shared memory data structures.
In 2024 25th International Symposium on Quality Electronic Design (ISQED),
Vol. , pp. 1–6.
External Links: Document
Cited by: §6.
Liu et al. (2024a)
H. Liu, M. Zaharia, and P. Abbeel
Ring attention with blockwise transformers for near-infinite context.
In International Conference on Learning Representations (ICLR),
Cited by: §6.
Liu et al. (2024b)
Y. Liu, H. Li, Y. Cheng, S. Ray, Y. Huang, Q. Zhang, K. Du, J. Yao, S. Lu, G. Ananthanarayanan, M. Maire, H. Hoffmann, A. Holtzman, and J. Jiang
CHK-8d7a6d34c529107580adecca
et al. (2024b)
Y. Liu, H. Li, Y. Cheng, S. Ray, Y. Huang, Q. Zhang, K. Du, J. Yao, S. Lu, G. Ananthanarayanan, M. Maire, H. Hoffmann, A. Holtzman, and J. Jiang
CacheGen: kv cache compression and streaming for fast large language model serving.
In Proceedings of the ACM SIGCOMM 2024 Conference,
ACM SIGCOMM ’24, New York, NY, USA, pp. 38–56.
External Links: ISBN 9798400706141,
Link,
Document
Cited by: §6.
LLaVA Team (2024a)
LLaVA TeamLLaVA-onevision qwen2 0.5b (ov-hf)(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
LLaVA Team (2024b)
LLaVA TeamLLaVA-onevision qwen2 7b ov-chat (hf)(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Mehta et al. (2022)
A. Mehta, M. Alzayat, R. D. Viti, B. B. Brandenburg, P. Druschel, and D. Garg
Pacer: comprehensive network Side-Channel mitigation in the cloud.
In 31st USENIX Security Symposium (USENIX Security 22),
Boston, MA, pp. 2819–2838.
External Links: ISBN 978-1-939133-31-1,
Link
Cited by: §6.
Meta AI (2023a)
Meta AILlama 2 13b chat model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Meta AI (2023b)
Meta AILlama 2 7b chat model(Website)
Note: Available on Hugging Face Hub
External Links: Link
Cited by: Table 4.
Meta AI (2024a)
Meta AI
Llama-3.1-70b.
Note: https://huggingface.co/meta-llama/Llama-3.1-70BReleased July 23, 2024.
CHK-641b13682816488e0c876790
Hub
External Links: Link
Cited by: Table 4.
Meta AI (2024a)
Meta AI
Llama-3.1-70b.
Note: https://huggingface.co/meta-llama/Llama-3.1-70BReleased July 23, 2024. License: Llama 3.1 Community License
Cited by: Table 4.
Meta AI (2024b)
Meta AI
The llama 3.2 collection of open multilingual large language models.
Note: https://huggingface.co/meta-llama/Llama-3.2-1BAccessed: 2026-06-02
Cited by: §5.1.
Microsoft Azure (2025)
Microsoft Azure
Azure OpenAI service — data privacy and prompt caching.
Note: https://learn.microsoft.com/en-us/azure/ai-services/openai/
Cited by: §2.4,
Table 3.
National Vulnerability Database (2025)
National Vulnerability Database
CVE-2025-46570.
Note: https://nvd.nist.gov/vuln/detail/CVE-2025-46570Accessed: 2026-05-29
Cited by: §2.4.
OpenAI (2024)
OpenAIPrompt caching: reduce latency and cost with prompt caching(Website)
Note: Accessed: 2025-07-17
External Links: Link
Cited by: §1,
§2.1,
§2.4,
Table 3,
§4.1.
OpenAssistant (2023)
OpenAssistant
OpenAssistant conversations dataset (oasst1).
Note: https://huggingface.co/datasets/OpenAssistant/oasst1Accessed: 2026-05-20
Cited by: Table 1.
OpenBMB (2023)
OpenBMB
UltraChat: an open-source large-scale multi-turn dialogue dataset.
Note: https://huggingface.co/datasets/openbmb/UltraChatAccessed: 2026-05-20
Cited by: Table 1.
Pang et al. (2024)
Z. Pang, W. Wang, and Y. Liao
CHK-1549bd670f23ddce681f4a60
alogue dataset.
Note: https://huggingface.co/datasets/openbmb/UltraChatAccessed: 2026-05-20
Cited by: Table 1.
Pang et al. (2024)
Z. Pang, W. Wang, and Y. Liao
Cache partitioning for mitigating timing side-channel attacks in llm serving systems.
In 2024 6th International Conference on Frontier Technologies of Information and Computer (ICFTIC),
Vol. , pp. 1238–1245.
External Links: Document
Cited by: §1,
§1,
§2.2,
§2.4,
Table 2,
§3.1,
2nd item.
Papaioannou and Doudali (2024)
K. Papaioannou and T. D. Doudali
The importance of workload choice in evaluating llm inference systems.
In Proceedings of the 4th Workshop on Machine Learning and Systems,
EuroMLSys ’24, New York, NY, USA, pp. 39–46.
External Links: ISBN 9798400705410,
Link,
Document
Cited by: Example 2.2,
§5.2.2.
Patel et al. (2024)
P. Patel, E. Choukse, C. Zhang, A. Shah, Í. Goiri, S. Maleki, and R. Bianchini
Splitwise: efficient generative llm inference using phase splitting.
In 2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA),
Vol. , pp. 118–132.
External Links: Document
Cited by: §5.1,
§6.
Pessl et al. (2016)
P. Pessl, D. Gruss, C. Maurice, M. Schwarz, and S. Mangard
DRAMA: exploiting DRAM addressing for cross-CPU attacks.
In Proceedings of the 25th USENIX Security Symposium,
USENIX Security ’16.
Cited by: §6.
Qin et al. (2025)
R. Qin, Z. Li, W. He, J. Cui, F. Ren, M. Zhang, Y. Wu, W.
CHK-2489ba3688d66b9137f54a20
roceedings of the 25th USENIX Security Symposium,
USENIX Security ’16.
Cited by: §6.
Qin et al. (2025)
R. Qin, Z. Li, W. He, J. Cui, F. Ren, M. Zhang, Y. Wu, W. Zheng, and X. Xu
Mooncake: trading more storage for less computation — a KVCache-centric architecture for serving LLM chatbot.
In 23rd USENIX Conference on File and Storage Technologies (FAST ’25),
pp. 155–170.
Cited by: §1,
§2.1,
§6.
Sabelfeld and Myers (2003)
A. Sabelfeld and A. C. Myers
Language-based information-flow security.
Vol. 21, pp. 5–19.
Cited by: §4.1.
Shi et al. (2026)
Z. Shi, Y. Ming, X. Nguyen, Y. Liang, and S. Joty
Discovering the gems in early layers: accelerating long-context LLMs with 1000x input token reduction.
In Findings of the Association for Computational Linguistics: ACL 2026,
San Diego, California, United States, pp. 13839–13857.
External Links: Document
Cited by: §6.
Singh and Narayanan (2025)
D. Singh and S. Narayanan
Unmasking the reality of PII masking models: performance gaps and the call for accountability.
arXiv preprint arXiv:2504.12308.
External Links: Document
Cited by: §2.3.
Snyder et al. (2023)
P. Snyder, S. Karami, A. Edelstein, B. Livshits, and H. Haddadi
Pool-party: exploiting browser resource pools for web tracking.
In Proceedings of the 32nd USENIX Conference on Security Symposium,
SEC ’23, USA.
External Links: ISBN 978-1-939133-37-3
Cited by: §6.
Song et al. (2025)
L.
CHK-2aaf7f16bc8df0b07d97e641
ng.
In Proceedings of the 32nd USENIX Conference on Security Symposium,
SEC ’23, USA.
External Links: ISBN 978-1-939133-37-3
Cited by: §6.
Song et al. (2025)
L. Song, Z. Pang, W. Wang, Z. Wang, X. Wang, H. Chen, W. Song, Y. Jin, D. Meng, and R. Hou
The early bird catches the leak: unveiling timing side channels in llm serving systems.
IEEE Transactions on Information Forensics and Security 20 (), pp. 11431–11446.
External Links: Document
Cited by: §1,
§2.3,
§6.
Sun et al. (2024)
B. Sun, Z. Huang, H. Zhao, W. Xiao, X. Zhang, Y. Li, and W. Lin
Llumnix: dynamic scheduling for large language model serving.
In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24),
Santa Clara, CA, pp. 173–191.
External Links: ISBN 978-1-939133-40-3,
Link
Cited by: §1,
§6.
Sun et al. (2025)
H. Sun, L. Chang, W. Bao, S. Zheng, N. Zheng, X. Liu, H. Dong, Y. Chi, and B. Chen
ShadowKV: kv cache in shadows for high-throughput long-context llm inference.
In Proceedings of the 42nd International Conference on Machine Learning (ICML),
PMLR, Vol. 267.
Cited by: §6.
Tang et al. (2024)
J. Tang, Y. Zhao, K. Zhu, G. Xiao, B. Kasikci, and S. Han
QUEST: query-aware sparsity for efficient long-context llm inference.
In Proceedings of the 41st International Conference on Machine Learning,
ICML’24.
Cited by: §6.
Team (2024)
S. Team
SGLang: efficient serving for large language models.
CHK-07dbec1f1ac2d68f104970f1
dings of the 41st International Conference on Machine Learning,
ICML’24.
Cited by: §6.
Team (2024)
S. Team
SGLang: efficient serving for large language models.
Note: https://github.com/sgl-project/sglang
Cited by: §5.1.
Touvron et al. (2023)
H. Touvron et al.
LLaMA: open and efficient foundation language models.
arXiv preprint arXiv:2302.13971.
Cited by: §2.1.
Vila and Kopf (2017)
P. Vila and B. Kopf
Loophole: timing attacks on shared event loops in chrome.
In 26th USENIX Security Symposium (USENIX Security 17),
Vancouver, BC, pp. 849–864.
External Links: ISBN 978-1-931971-40-9,
Link
Cited by: §2.4,
§6.
Villegas (2024)
Pii-extract-base: extraction of pii from text chunks
Note: Python package
External Links: Link
Cited by: §5.1.
vLLM Contributors (2025)
vLLM Contributors
Prevent side-channel attacks via cache salting — Pull Request #17045.
Note: https://github.com/vllm-project/vllm/pull/17045
Cited by: §2.4,
Table 3.
vLLM Team (2024)
vLLM Team
VLLM: high-throughput serving for large language models.
Note: https://github.com/vllm-project/vllm
Cited by: §1,
§5.1,
§5.1,
§5.1.
vLLM Team (2025)
vLLM Team
Automatic prefix caching in vllm.
Note: https://docs.vllm.ai/en/latest/features/automatic_prefix_caching/
Cited by: §2.1,
1st item.
Volpano et al. (1996)
D. Volpano, C. Irvine, and G. Smith
A sound type system for secure flow analysis.
CHK-e47e6e86cf15d4d3ff53e7d9
res/automatic_prefix_caching/
Cited by: §2.1,
1st item.
Volpano et al. (1996)
D. Volpano, C. Irvine, and G. Smith
A sound type system for secure flow analysis.
Journal of Computer Security 4 (2-3), pp. 167–187.
Cited by: §4.1.
Wright et al. (2008)
C. V. Wright, L. Ballard, S. E. Coull, F. Monrose, and G. M. Masson
Spot me if you can: uncovering spoken phrases in encrypted voip conversations.
In 2008 IEEE Symposium on Security and Privacy (sp 2008),
Vol. , pp. 35–49.
External Links: Document
Cited by: §6.
Wu et al. (2025)
G. Wu, Z. Zhang, Y. Zhang, W. Wang, J. Niu, Y. Wu, and Y. Zhang
I know what you asked: prompt leakage via kv-cache sharing in multi-tenant llm serving.
In Proceedings of the 2025 Network and Distributed System Security (NDSS) Symposium. San Diego, CA, USA,
Cited by: §6.
Xiao et al. (2024)
G. Xiao, Y. Tian, B. Chen, S. Han, and M. Lewis
Efficient streaming language models with attention sinks.
External Links: 2309.17453,
Link
Cited by: §6.
Yao et al. (2025)
J. Yao, H. Li, Y. Liu, S. Ray, Y. Cheng, Q. Zhang, K. Du, S. Lu, and J. Jiang
CacheBlend: fast large language model serving for rag with cached knowledge fusion.
In Proceedings of the Twentieth European Conference on Computer Systems,
EuroSys ’25, New York, NY, USA, pp. 94–109.
External Links: ISBN 9798400711961,
Link,
Document
Cited by: §6.
Yarom and Falkner (2014)
Y. Yarom and K. Falkner
CHK-7e644f4c2e8ce927378c5628
,
EuroSys ’25, New York, NY, USA, pp. 94–109.
External Links: ISBN 9798400711961,
Link,
Document
Cited by: §6.
Yarom and Falkner (2014)
Y. Yarom and K. Falkner
FLUSH+RELOAD: a high resolution, low noise, l3 cache side-channel attack.
In Proceedings of the 23rd USENIX Security Symposium,
USENIX Security ’14.
Cited by: §1,
§6.
Ye et al. (2024)
L. Ye, Z. Tao, Y. Huang, and Y. Li
ChunkAttention: efficient self-attention with prefix-aware KV cache and two-phase partition.
In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), L. Ku, A. Martins, and V. Srikumar (Eds.),
Bangkok, Thailand, pp. 11608–11620.
External Links: Link,
Document
Cited by: §1,
§6.
Yu et al. (2025)
L. Yu, J. Lin, and J. Li
Stateful large language model serving with pensieve.
In Proceedings of the Twentieth European Conference on Computer Systems,
EuroSys ’25, New York, NY, USA, pp. 144–158.
External Links: ISBN 9798400711961,
Link,
Document
Cited by: §6.
Zhao et al. (2024)
S. Zhao, D. Israel, G. V. den Broeck, and A. Grover
Prepacking: a simple method for fast prefilling and increased throughput in large language models.
External Links: 2404.09529,
Link
Cited by: §6.
Zheng et al. (2024a)
L. Zheng, L. Yin, Z. Xie, C. Sun, J. Huang, C. H. Yu, S. Cao, C. Kozyrakis, I. Stoica, J. E. Gonzalez, C. Barrett, and Y. Sheng
CHK-ec2cb0f35fe63cb63cf397ac
ed by: §6.
Zheng et al. (2024a)
L. Zheng, L. Yin, Z. Xie, C. Sun, J. Huang, C. H. Yu, S. Cao, C. Kozyrakis, I. Stoica, J. E. Gonzalez, C. Barrett, and Y. Sheng
SGLang: efficient execution of structured language model programs.
In Advances in Neural Information Processing Systems (NeurIPS ’24),
Vol. 37, pp. 62557–62583.
Cited by: §1,
§2.1.
Zheng et al. (2024b)
X. Zheng, H. Han, S. Shi, Q. Fang, Z. Du, X. Hu, and Q. Guo
InputSnatch: stealing input in llm services via timing side-channel attacks.
External Links: 2411.18191,
Link
Cited by: §1,
§1,
§2.2,
§2.4,
Table 2,
§3.1,
2nd item,
§6.
Zhong et al. (2024)
Y. Zhong, S. Liu, J. Chen, J. Hu, Y. Zhu, X. Liu, X. Jin, and H. Zhang
DistServe: disaggregating prefill and decoding for goodput-optimized large language model serving.
In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24),
Santa Clara, CA, pp. 193–210.
External Links: ISBN 978-1-939133-40-3,
Link
Cited by: §1,
Example 2.2,
§5.1,
§6.
Zhu et al. (2025)
Q. Zhu, J. Duan, C. Chen, S. Liu, X. Li, G. Feng, X. Lv, X. Chuanfu, D. Lin, and C. Yang
SampleAttention: near-lossless acceleration of long context LLM inference with adaptive structured sparse attention.
In Eighth Conference on Machine Learning and Systems,
External Links: Link
Cited by: §6.