LLMs Leak Secrets Through Unrelated Outputs

LLM Other LLM AI Safety / AI Ethics DPPDT RA
2026年11月30日
针对大语言模型(LLMs)的隐私防护机制通常默认:只要模型输出未直接复述或隐含地揭示敏感上下文内容,该上下文即视为安全。然而,我们发现,模型上下文中所包含的秘密信息还会扰动其在非请求任务上的词元(token)概率分布,从而形成一种推理阶段的统计侧信道,我们将其命名为“潜隐泄露”(subliminal leakage)。在开源权重模型(open-weight)场景下,攻击者可通过“教师强制”(teacher-forcing)方式,直接计算观测到的输出在受害者模型下的对数似然值,据此对候选秘密进行排序。例如,当我们将一个四位数字PIN码嵌入Qwen3-8B模型的系统提示词(system prompt)中,并附加保密指令,随后仅要求模型生成随机整数列表时,单次输出即可以77.2%的准确率(随机猜测基线为20.0%)区分出四种不同PIN码及一个无密码控制组;即便进一步剔除输出中与PIN完全一致、各位数字排列顺序不同(digit permutations),以及汉明距离为1(Hamming-distance-1)的近似匹配项后,准确率仍稳定维持在73%以上。若聚合约20条经过严格过滤的输出,可在全部10,000个候选PIN中(随机命中概率仅为0.01%),精确恢复出50个预留测试PIN中的24个(48%);同时,有36个(72%)落入前五名候选之列。同一模型内的检测能力具有跨模型泛化性:在Qwen3-8B上准确率达68.6%,Phi-3.5-Mini为59.1%,OLMo-2-7B为44.3%,显著高于14.3%的基线水平;即便在提示词中明确警告“本系统将接受泄露审计”,检测准确率仍达44.0%(仍远高于20.0%的随机猜测水平)。此外,对模型隐藏状态(hidden states)的探针分析证实:PIN码各数字在整个生成过程中始终可被线性解码,表明仅依赖词法过滤器(lexical filters)和保密性提示指令,无法封堵随机性输出中固有的统计泄露通道。
Privacy defenses for large language models (LLMs) generally assume that confidential context remains safe unless a response repeats or implies it. We show that secrets in a model's context also perturb its token probability distribution on unrequested tasks, creating an inference-time statistical channel we call subliminal leakage. In an open-weight setting, an adversary can rank candidate secrets directly by evaluating the teacher-forced log-likelihood of observed outputs under the victim model. When we place a four-digit PIN in Qwen3-8B's system prompt alongside a secrecy instruction and request random integer lists, a single output identifies the active condition across four PINs and a no-password control with 77.2% accuracy (20.0% chance), remaining above 73% after removing exact matches, digit permutations, and Hamming-distance-1 neighbors. Aggregating roughly 20 strictly filtered outputs recovers 24 of 50 held-out PINs (48%) exactly across all 10,000 candidates (0.01% chance) and places 36 of 50 (72%) in the top five. Same-model detection generalizes across Qwen3-8B (68.6%), Phi-3.5-Mini (59.1%), and OLMo-2-7B (44.3%) against a 14.3% baseline, and stays at 44.0% (20.0% chance) even when the prompt warns of leakage audits. Hidden-state probes confirm that PIN digits remain linearly decodable during generation, showing that lexical filters and secrecy instructions leave open a statistical channel in stochastic outputs.
许愿