atlas

Research map / Large language models / Language, safety and interpretability

Auditing Prompt Caching in Language Model APIs

ICML 2025 · Large language models › Language, safety and interpretability · approach: LLM unlearning and benchmarks · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Develops statistical timing audits (two-sample KS test with valid p-values) to detect prompt caching and its sharing level in 17 real-world LLM APIs, finding global cache sharing in seven and inferring OpenAI's text-embedding-3-small is decoder-only.

Problem

Prompt caching in LLM APIs causes data-dependent timing differences that enable side-channel timing attacks and privacy leakage across users, and providers rarely disclose their caching policies or cache-sharing level. It also can leak architecture information such as whether a model is decoder-only

Approach

Compare time-to-first-token distributions from a cache-hit procedure (victim sends prompt, attacker sends prefix-sharing prompt) against cache-miss random prompts using a one-sided two-sample Kolmogorov-Smirnov test, with the victim/attacker user placement set to test per-user, per-organization, or global sharing.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use longer prompts (ablation)Prompt-caching audit on globally caching Fireworks, Perplexity, and Replicate APIs · Cache-hit versus cache-miss classificationaverage precisionHelped
Use shorter prompts (ablation)Prompt-caching audit · Cache-hit versus cache-miss classificationaverage precisionHurt
Increase the matching-prefix length (ablation)Prompt-caching audit with same-prefix, different-suffix prompts · Cache-hit versus cache-miss classificationaverage precisionHelped
Decrease the matching-prefix length (ablation)Prompt-caching audit with same-prefix, different-suffix prompts · Cache-hit versus cache-miss classificationaverage precisionHurt
Vary model size (ablation)Fireworks Llama 3.1 and 3.2 models · Cache-hit versus cache-miss classificationaverage precisionNo clear effect
Share the cache globally across usersSeven API providers where global cache sharing was detected · Cross-user prompt privacyglobal cache sharing detectedHurt
Use same-prefix prompts with different suffixesOpenAI text-embedding-3-small · Model architecture inferencedecoder-only architecture evidenceHelped
Use prompt caching with response-time classificationDeepSeek Chat · DeepSeek Chat cache-hit detectionstatistically significant difference between cache-hit and cache-miss timesNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: randomly generated letter prompts (PromptLength 5000)

Benchmarks: audit p-values across 17 LLM API providers precision-recall curves for cache-hit vs cache-miss timing

Metrics: p-value average precision

Baselines: Anthropic Claude 3 Haiku caching OpenAI GPT-4o mini caching

Builds on: Kolmogorov-Smirnov test KV cache reuse prompt caching

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy