Get Confused Cautiously: Textual Sequence Memorization Erasure with Selective Entropy Maximization
Zhaohan Zhang, Ziquan Liu, Ioannis Patras
TL;DR
This work tackles the privacy and copyright concerns of Textual Sequence Memorization (TSM) in large language models by proposing EMSO, a reference-free framework that maximizes the entropy of the predictive distribution on a forget set to induce forgetting while preserving model utility. It achieves this by selectively updating a small set of weights determined by a contrastive gradient metric that balances forgetting direction with entropy optimization, avoiding reliance on memorized or retain data. Theoretical gradient analysis and extensive experiments on GPT-Neo variants show EMSO provides a superior erasure-utility trade-off compared with baselines, with greater stability (fewer collapses) and better preservation of language generation and reasoning across large forgetting requests. While EMSO advances scalable TSM erasure, it acknowledges limitations such as residual forgetfulness and memory requirements for the contrastive gradient computation, pointing to future work on more automatic privacy-data editing and efficiency improvements.
Abstract
Large Language Models (LLMs) have been found to memorize and recite some of the textual sequences from their training set verbatim, raising broad concerns about privacy and copyright issues when using LLMs. This Textual Sequence Memorization (TSM) phenomenon leads to a high demand to regulate LLM output to prevent it from generating certain memorized text to meet user requirements. However, our empirical study reveals that existing methods for TSM erasure fail to forget massive memorized samples without substantially jeopardizing the model utility. To achieve a better trade-off between the effectiveness of TSM erasure and model utility in LLMs, our paper proposes a new framework based on Entropy Maximization with Selective Optimization (EMSO), where the updated weights are chosen with a novel contrastive gradient metric without any participation of additional model or data. Our analysis shows that training with the entropy maximization loss has a more stable optimization process and better keeps model utility than existing methods. The contrastive gradient metric localizes the most influential weight for TSM erasure by taking both the gradient magnitude and direction into consideration. Extensive experiments across three model scales demonstrate that our method excels in handling large-scale forgetting requests while preserving model ability in language generation and reasoning.
