TokenSwap: A Lightweight Method to Disrupt Memorized Sequences in LLMs
Parjanya Prajakta Prashant, Kaustubh Ponkshe, Babak Salimi
摘要
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× drop in exact memorization with negligible task degradation. Our method offers a practical, accessible solution for mitigating memorized generation in deployed LLMs. Code is available at https://github.com/parjanya20/verbatim-llm.
Write a story about a magical world
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling 引用了 Extracting Training Data from Large Language Models
- Anchored Decoding: Provably Reducing Copyright Risk for Any Language Model 引用了 Fast Inference from Transformers via Speculative Decoding
- Anchored Decoding: Provably Reducing Copyright Risk for Any Language Model 引用了 Extracting Training Data from Large Language Models
- Extracting Training Data from Large Language Models 引用了 Deep Learning with Differential Privacy
引用它的顶会 Paper1
它引用的 Paper28
- Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan 等CCS 2016 · 7,620 次引用
- WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 次引用
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski 等USENIX Security 2021 · 2,866 次引用
- Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley 等ICML 2023 · 1,822 次引用
- Fast Inference from Transformers via Speculative DecodingYaniv Leviathan, Matan Kalman, Yossi MatiasICML 2023 · 1,472 次引用
相关 Paper
- Duwak: Dual Watermarks in Large Language ModelsChaoyi Zhu, Jeroen Galjaard, Pin-Yu Chen, Lydia Y. ChenACL Findings 2024 · 7 次引用
- Be like a Goldfish, Don't Memorize! Mitigating Memorization in Generative LLMsAbhimanyu Hans, John Kirchenbauer, Yuxin Wen, Neel Jain 等NeurIPS 2024 · 65 次引用
- SPaR: Self-Play with Tree-Search Refinement to Improve Instruction-Following in Large Language ModelsJiale Cheng, Xiao Liu, Cunxiang Wang, Xiaotao Gu 等ICLR 2025
- Mitigating Memorization in Language ModelsMansi Sakarvadia, Aswathy Ajith, Arham Mushtaq Khan, Nathaniel C. Hudson 等ICLR 2025
- Learning syntax without semantics: Disentangled tiny language modelsEzra Winston, Zico KolterICML 2026
