Auditing Prompt Caching in Language Model APIs

Chenchen Gu, Xiang Lisa Li, Rohith Kuditipudi, Percy Liang, Tatsunori Hashimoto
2/1/2025
33 citations

Official code: chenchenygu/auditing-prompt-caching (10 stars, Python, Apache-2.0, last commit 2025-10-17).

Abstract

Prompt caching in large language models (LLMs) results in data-dependent timing variations: cached prompts are processed faster than non-cached prompts. These timing differences introduce the risk of side-channel timing attacks.

Show full abstract

For example, if the cache is shared across users, an attacker could identify cached prompts from fast API response times to learn information about other users'prompts. Because prompt caching may cause privacy leakage, transparency around the caching policies of API providers is important. To this end, we develop and conduct statistical audits to detect prompt caching in real-world LLM API providers. We detect global cache sharing across users in seven API providers, including OpenAI, resulting in potential privacy leakage about users'prompts. Timing variations due to prompt caching can also result in leakage of information about model architecture. Namely, we find evidence that OpenAI's embedding model is a decoder-only Transformer, which was previously not publicly known.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Code for "Auditing Prompt Caching in Language Model APIs" (ICML 2025)

101PythonFeb 13, 20251 years agoApache-2.0

Similar Papers

Cite this paper

@article{gu2025auditing,
  title  = {Auditing Prompt Caching in Language Model APIs},
  author = {Chenchen Gu and Xiang Lisa Li and Rohith Kuditipudi and Percy Liang and Tatsunori Hashimoto},
  year   = {2025},
  eprint = {2502.07776},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2502.07776},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.07776.svg)](https://codeofpaper.com/paper/2502.07776)

Discussion