利用注意力机制泄露信息,实现更精准的模型成员推断攻击
AttenMIA: LLM Membership Inference Attack through Attention Signals
- 通过分析Transformer中多层注意力头的模式识别训练数据成员
- 在WikiMIA-32上达0.996 ROC AUC与87.9%真阳性率@1%假阳性率
- 适用于隐私安全研究者,揭示注意力机制的潜在泄露风险
大型语言模型(LLMs)在实际应用中日益普及,但其训练数据规模庞大,易产生数据记忆,引发隐私与知识产权问题。其中,成员推断攻击(MIA)旨在判断某样本是否曾出现在训练集中。现有方法主要依赖输出置信度或嵌入特征,但信号脆弱,攻击效果有限。本文提出AttenMIA,一种基于自注意力模式的新攻击框架。注意力机制控制Transformer内部信息流,暴露可被用于识别训练数据成员的差异模式。该方法融合多层注意力头的信息,并结合扰动基分歧度量,训练出高效MIA分类器。在LLaMA-2、Pythia和Opt等开源模型上广泛实验表明,注意力特征持续优于基线,尤其在低假阳性率下表现突出(如在WikiMIA-32基准上,使用Llama2-13b时达到0.996 ROC AUC与87.9% TPR@1%FPR)。我们验证了注意力信号在不同数据集与架构间的泛化能力,并进行了层与头级别的泄露分析。进一步将AttenMIA集成至数据提取框架,所生成的训练数据提取攻击超越现有最优水平。结果表明,原本用于提升可解释性的注意力机制,反而可能放大大模型的隐私风险,亟需新型防御策略。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are increasingly deployed to enable or improve a multitude of real-world applications. Given the large size of their training data sets, their tendency to memorize training data raises serious privacy and intellectual property concerns. A key threat is the membership inference attack (MIA), which aims to determine whether a given sample was included in the model's training set. Existing MIAs for LLMs rely primarily on output confidence scores or embedding-based features, but these signals are often brittle, leading to limited attack success. We introduce AttenMIA, a new MIA framework that exploits self-attention patterns inside the transformer model to infer membership. Attention controls the information flow within the transformer, exposing different patterns for memorization that can be used to identify members of the dataset. Our method uses information from attention heads across layers and combines them with perturbation-based divergence metrics to train an effective MIA classifier. Using extensive experiments on open-source models including LLaMA-2, Pythia, and Opt models, we show that attention-based features consistently outperform baselines, particularly under the important low-false-positive metric (e.g., achieving up to 0.996 ROC AUC & 87.9% TPR@1%FPR on the WikiMIA-32 benchmark with Llama2-13b). We show that attention signals generalize across datasets and architectures, and provide a layer- and head-level analysis of where membership leakage is most pronounced. We also show that using AttenMIA to replace other membership inference attacks in a data extraction framework results in training data extraction attacks that outperform the state of the art. Our findings reveal that attention mechanisms, originally introduced to enhance interpretability, can inadvertently amplify privacy risks in LLMs, underscoring the need for new defenses.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。