检测大模型API中的提示词缓存,发现用户间缓存共享可能泄露隐私。
Auditing Prompt Caching in Language Model APIs
- 通过分析API响应时间差异,统计检测缓存机制
- 在7个API中发现跨用户全局缓存,包括OpenAI
- 可暴露用户提示内容与模型架构秘密
大型语言模型(LLMs)的提示词缓存会导致数据相关的处理时间差异:被缓存的提示词响应更快。这种时间差异可能引发旁道时序攻击。例如,若缓存跨用户共享,攻击者可通过快速响应时间推断其他用户的提示内容。由于提示词缓存可能导致隐私泄露,透明公开API提供商的缓存策略至关重要。为此,我们开发并实施了统计审计方法,检测真实世界中LLM API提供商的提示词缓存行为。我们在七个API提供商中检测到跨用户全局缓存,包括OpenAI,存在潜在的用户提示信息泄露风险。此外,缓存导致的时间变化还可泄露模型架构信息。我们发现证据表明OpenAI的嵌入模型是仅解码器的Transformer结构,此前未被公开披露。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。