Abstract
The widespread practice of indiscriminate data scraping to fine-tune language models (LMs) raises significant legal and ethical concerns, particularly regarding compliance with data protection laws such as the General Data Protection Regulation (GDPR). This practice often results in the unauthorized use of personal information, prompting growing debate within the academic and regulatory communities. Recent works have introduced the concept of generating unlearnable datasets (by adding imperceptible noise to the clean data), such that the underlying model achieves lower loss during training but fails to generalize to the unseen test setting. Though somewhat effective, these approaches are predominantly designed for images and are limited by several practical constraints like requiring knowledge of the target model. To this end, we introduce RegText, a framework that injects imperceptible spurious correlations into natural language datasets, effectively rendering them unlearnable without affecting semantic content. We demonstrate RegText's utility through rigorous empirical analysis of small and large LMs. Notably, RegText can restrict newer models like GPT-4o and Llama from learning on our generated data, resulting in a drop in their test accuracy compared to their zero-shot performance and paving the way for generating unlearnable text to protect public data.
Introduction
The "right to data protection" is a cornerstone of modern privacy frameworks like the GDPR. However, enforcing these rights is increasingly difficult as AI companies scrape vast amounts of public forum data and news articles to fine-tune Large Language Models (LLMs) without explicit user consent. While techniques for creating "unlearnable" datasets have emerged in the computer vision domain—using imperceptible noise to prevent model generalization—applying these concepts to text is challenging due to the discrete nature of language.
Existing text-poisoning methods are often computationally expensive, require access to target model weights (model-dependency), or significantly degrade text readability. We propose RegText, a scalable, model-agnostic framework designed to protect public data by making it useless for AI training while remaining perfectly readable to humans.
The RegText Framework
RegText operates by identifying and injecting "shortcuts"—spurious correlations that models prioritize over deep semantic understanding. The framework utilizes an information-theoretic metric called REGTEXTrank, which combines Pointwise Mutual Information (PMI) with token frequency to select optimal "poison" tokens.
A key insight of our work is the Frequency Trade-off: low-frequency tokens provide significantly stronger learning signals (larger gradients) to neural networks. By selecting words that are both highly task-representative and rare, RegText creates a "trap" for the model. When an LLM is fine-tuned on this data, it overfits to these injected tokens. Because these tokens do not appear in real-world test sets, the model's ability to generalize is crippled, often falling below its initial zero-shot performance.
Experimental Evaluation
We evaluated RegText across three diverse benchmarks:
- IMDb: Sentiment classification of movie reviews.
- AGNews: Topic classification of news articles.
- Natural Instructions (NI) Polarity: A complex cross-task dataset used to test the transferability of unlearnability.
The framework was tested against a wide range of state-of-the-art models, including Phi-3, Mistral, Llama-3.1, and GPT-4o-mini.
Key Results and Discussion
Our empirical results demonstrate that RegText effectively disrupts the learning process across various model architectures and sizes. Notably, instruction-tuned models (e.g., Llama-3.1-Instruct) proved more vulnerable to RegText than their base counterparts, likely because their optimization for pattern-following makes them quicker to latch onto injected shortcuts.
As shown in the table above, training on RegText-protected data frequently results in a performance drop below the model's zero-shot baseline. For instance, GPT-4o-mini's accuracy on IMDb dropped by 4.10 percentage points relative to its out-of-the-box performance after being "fine-tuned" on protected data. Similarly, Llama-3.1-8B-Instruct saw a 7.53 point drop on the Polarity dataset.
Beyond effectiveness, RegText is highly efficient. It processes over 18,000 examples in approximately 26 seconds, making it a viable tool for large-scale data protection. Furthermore, the protected text maintains high semantic similarity (90-98%) to the original, ensuring it remains useful for human consumption.
Conclusion and Future Work
RegText represents a significant step toward operationalizing the right to data protection in the age of LLMs. By leveraging the inherent learning biases of neural networks, we can protect public data from unauthorized exploitation. Future research will focus on expanding the framework to non-English languages, developing more deterministic injection strategies, and ensuring robustness against evolving tokenization methods.
Summary updated