Auditing Prompt Caching in Language Model APIs

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. 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.

Cite

Text

Gu et al. "Auditing Prompt Caching in Language Model APIs." Proceedings of the 42nd International Conference on Machine Learning, 2025.

Markdown

[Gu et al. "Auditing Prompt Caching in Language Model APIs." Proceedings of the 42nd International Conference on Machine Learning, 2025.](https://mlanthology.org/icml/2025/gu2025icml-auditing/)

BibTeX

@inproceedings{gu2025icml-auditing,
  title     = {{Auditing Prompt Caching in Language Model APIs}},
  author    = {Gu, Chenchen and Li, Xiang Lisa and Kuditipudi, Rohith and Liang, Percy and Hashimoto, Tatsunori},
  booktitle = {Proceedings of the 42nd International Conference on Machine Learning},
  year      = {2025},
  pages     = {20477-20496},
  volume    = {267},
  url       = {https://mlanthology.org/icml/2025/gu2025icml-auditing/}
}