仅用模型输出文本就能高效检测数据是否被训练过,适合研究模型隐私漏洞。
The Surprising Effectiveness of Membership Inference with Simple N-Gram Coverage
- 只靠模型生成的文本判断数据是否在训练集中,无需访问内部参数。
- 在多个数据集上表现优于其他黑盒攻击,媲美白盒攻击效果。
- 计算资源越多,攻击越准,适用于评估GPT-4等封闭模型的隐私保护能力。
会员推理攻击可有效检测语言模型中的版权侵权与数据泄露问题。然而,现有先进攻击需访问模型隐藏状态或概率分布,难以应用于仅开放API的模型(如GPT-4)。本文提出仅依赖目标模型文本输出的N-Gram Coverage Attack,实现对完全黑盒模型的攻击。该方法基于模型更可能记忆并重现训练数据中常见文本模式的观察:对候选样本,通过前缀生成多条输出,利用n-gram重叠度衡量其与真实后缀的相似性;相似度高则表明该数据极可能属于训练集。实验显示,该方法在多个基准测试中超越其他黑盒攻击,并达到甚至超过部分白盒攻击性能。值得注意的是,攻击成功率随生成序列数量增加而提升。进一步应用该方法分析OpenAI多个闭源模型发现,较新版本如GPT-4o表现出更强的抗推理能力,暗示模型正朝着增强隐私保护的方向演进。
原文摘要 · Abstract (English)
Membership inference attacks serves as useful tool for fair use of language models, such as detecting potential copyright infringement and auditing data leakage. However, many current state-of-the-art attacks require access to models' hidden states or probability distribution, which prevents investigation into more widely-used, API-access only models like GPT-4. In this work, we introduce N-Gram Coverage Attack, a membership inference attack that relies solely on text outputs from the target model, enabling attacks on completely black-box models. We leverage the observation that models are more likely to memorize and subsequently generate text patterns that were commonly observed in their training data. Specifically, to make a prediction on a candidate member, N-Gram Coverage Attack first obtains multiple model generations conditioned on a prefix of the candidate. It then uses n-gram overlap metrics to compute and aggregate the similarities of these outputs with the ground truth suffix; high similarities indicate likely membership. We first demonstrate on a diverse set of existing benchmarks that N-Gram Coverage Attack outperforms other black-box methods while also impressively achieving comparable or even better performance to state-of-the-art white-box attacks - despite having access to only text outputs. Interestingly, we find that the success rate of our method scales with the attack compute budget - as we increase the number of sequences generated from the target model conditioned on the prefix, attack performance tends to improve. Having verified the accuracy of our method, we use it to investigate previously unstudied closed OpenAI models on multiple domains. We find that more recent models, such as GPT-4o, exhibit increased robustness to membership inference, suggesting an evolving trend toward improved privacy protections.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。