用小模型替换大模型的生成概率,降低记忆复现风险。
A Lightweight Method to Disrupt Memorized Sequences in LLM
- 用小模型为常见词重新分配概率,干扰大模型的记忆输出
- 在Pythia-6.9B和Llama-3-8B上实现10倍减少复现率
- 无需重训练或访问权重,适合部署后使用
随着语言模型规模扩大,其任务表现显著提升,但对训练数据的逐字记忆倾向也加剧,带来法律、伦理与安全风险。现有缓解方法如差分隐私或模型遗忘需重训练或访问内部权重,对多数用户不实用。本文提出TokenSwap,一种轻量级、事后防御机制,仅需访问令牌级输出。核心思路是:大模型负责高阶能力,而小模型(如DistilGPT-2)足以对常见功能词赋予流畅概率且记忆更少。通过选择性交换两模型的令牌概率,该方法在保持大模型性能的同时,显著降低其逐字复现倾向。在Pythia-6.9B和Llama-3-8B上的评估显示,精确记忆率最高下降10倍,任务性能损失可忽略。该方法为部署中大型模型的内存防护提供了实用、易用的解决方案。
原文摘要 · Abstract (English)
As language models scale, their performance improves dramatically across a wide range of tasks, but so does their tendency to memorize and regurgitate parts of their training data verbatim. This tradeoff poses serious legal, ethical, and safety concerns, especially in real-world deployments. Existing mitigation techniques, such as differential privacy or model unlearning, often require retraining or access to internal weights making them impractical for most users. In this work, we introduce TokenSwap, a lightweight, post-hoc defense designed for realistic settings where the user can only access token-level outputs. Our key insight is that while large models are necessary for high task performance, small models (e.g., DistilGPT-2) are often sufficient to assign fluent, grammatically plausible probabilities to common function words - and crucially, they memorize far less. By selectively swapping token probabilities between models, TokenSwap preserves the capabilities of large models while reducing their propensity for verbatim reproduction. Evaluations on Pythia-6.9B and Llama-3-8B show up to a 10$\times$ drop in exact memorization with negligible task degradation. Our method offers a practical, accessible solution for mitigating memorized generation in deployed LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。