发现语言模型记忆的通用特征,可跨架构精准识别训练数据成员身份。
Learning the Signature of Memorization in Autoregressive Language Models
- 通过训练序列分类器捕捉每标记的分布统计特征,实现对记忆信号的自动学习。
- 在未见架构和数据上零样本迁移,最高达0.972 AUC,超越原模型表现。
- 适用于自然语言与代码场景,且无需微调,适合隐私安全研究者使用。
以往针对微调语言模型的成员推断攻击依赖人工设计的启发式方法(如损失阈值、最小K%、参考校准),受限于设计者的直觉。本文首次提出可迁移的端到端学习攻击方法,基于微调任何模型于任意语料库时,成员身份天然可知,从而获得无限标注数据。该方法摆脱了影子模型瓶颈,使成员推断进入深度学习时代:学习关键信号而非人为设计,通过训练多样性与规模实现泛化。我们发现,微调语言模型会产生一个在不同架构家族和数据领域间保持不变的记忆签名。仅在Transformer模型上训练的成员推断分类器,可零样本迁移至Mamba(状态空间)、RWKV-4(线性注意力)和RecurrentGemma(门控递归),分别取得0.963、0.972和0.936 AUC;每项评估均包含训练中未见过的架构与数据,但全部优于留出的Transformer基准(0.908 AUC)。这四类模型无共同计算机制,唯一共性为基于交叉熵损失的梯度下降。即使简单的似然方法也展现出强迁移能力,证明该签名独立于检测方法存在。所提方法Learned Transfer MIA(LT-MIA)通过将成员推断重构为对每标记分布统计的序列分类,最有效捕捉该信号;在Transformer上,其在0.1%误报率下真阳性率提升2.8倍,优于最强基线。该方法还成功迁移到代码数据(0.865 AUC),尽管训练仅用自然语言文本。代码与模型已开源。
原文摘要 · Abstract (English)
All prior membership inference attacks for fine-tuned language models use hand-crafted heuristics (e.g., loss thresholding, Min-K\%, reference calibration), each bounded by the designer's intuition. We introduce the first transferable learned attack, enabled by the observation that fine-tuning any model on any corpus yields unlimited labeled data, since membership is known by construction. This removes the shadow model bottleneck and brings membership inference into the deep learning era: learning what matters rather than designing it, with generalization through training diversity and scale. We discover that fine-tuning language models produces an invariant signature of memorization detectable across architectural families and data domains. We train a membership inference classifier exclusively on transformer-based models. It transfers zero-shot to Mamba (state-space), RWKV-4 (linear attention), and RecurrentGemma (gated recurrence), achieving 0.963, 0.972, and 0.936 AUC respectively. Each evaluation combines an architecture and dataset never seen during training, yet all three exceed performance on held-out transformers (0.908 AUC). These four families share no computational mechanisms, their only commonality is gradient descent on cross-entropy loss. Even simple likelihood-based methods exhibit strong transfer, confirming the signature exists independently of the detection method. Our method, Learned Transfer MIA (LT-MIA), captures this signal most effectively by reframing membership inference as sequence classification over per-token distributional statistics. On transformers, LT-MIA achieves 2.8$\times$ higher TPR at 0.1\% FPR than the strongest baseline. The method also transfers to code (0.865 AUC) despite training only on natural language texts. Code and trained classifier available at https://github.com/JetBrains-Research/learned-mia.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。