Introduction
In machine learning, "memorization" is often viewed as a symptom of overfitting—a sign that a model is simply rote-learning training data rather than learning generalizable patterns. However, recent theoretical work by Feldman (2020) suggested a "long-tail theory": if data follows a long-tail distribution where many small sub-populations are rare or atypical, a model must memorize these instances to achieve high generalization accuracy. While this theory was previously tested in computer vision, its validity in Natural Language Processing (NLP) remained an open question. This study empirically validates the long-tail theory in NLP, demonstrating that models generalize better by memorizing atypical training instances.
Quantifying and Attributing Memorization
The authors employ two primary technical frameworks to study this phenomenon:
- Self-Influence for Memorization Scoring: To quantify memorization, they use "self-influence" based on the work of Koh and Liang (2017). They calculate how much the model's prediction on a specific training instance $z$ would change if that instance were removed from the training set. A high self-influence score indicates that the model relies heavily on having seen that specific example to classify it correctly—a hallmark of memorization.
- Memorization Attribution: To understand why an instance is memorized, the authors adapt Integrated Gradients (IG) to decompose the total memorization score of a sentence into scores for individual tokens. This allows them to identify which words contribute most to the need for memorization.
The Utility of Memorization
A key finding of this research is that memorization is a utility, not a bug. In "Marginal Utility" experiments, the authors removed the most-memorized instances from the training set and observed a much sharper drop in test accuracy compared to removing a random subset of the same size. This suggests that these "atypical" examples are crucial for the model to handle similar rare cases in the test set.
As shown in the SNLI results above, removing instances with high self-influence (orange line) leads to a significantly steeper decline in test accuracy than random removal (green line). This confirms that memorized instances contain unique, valuable information for generalization.
Faithfulness of Attribution
To ensure their attribution method accurately identifies the tokens responsible for memorization, the authors used a "Reduction Rate" metric. This metric measures how much the self-influence score decreases when the top-k% of identified tokens are removed from a sentence.
The results on the SST-2 dataset demonstrate that removing tokens identified by the memorization attribution method (orange line) reduces the self-influence score much more effectively than removing tokens at random (green line), validating the faithfulness of the attribution approach.
Qualitative Insights: Memorizing the Contradiction
By inspecting high-memorization instances, the authors found they are indeed outliers, often containing conflicting signals or rare word pairings. A surprising insight is that models tend to memorize tokens that are negatively correlated with the class label. For example, in a negative movie review, a model might memorize phrases like "tremendous promise." Because such phrases usually signal a positive review, the model must "memorize" their presence in this specific negative context to avoid misclassification.
On the SST-2 dataset, removing the top 30% of memorized training instances led to a 1.44 percentage point drop in test accuracy, compared to only a 0.70 point drop when removing 30% of instances randomly. This reinforces the idea that memorization is essential for navigating the complex, long-tailed nature of natural language.
Conclusion
This empirical study confirms that memorization in NLP models is not merely a byproduct of overfitting but a necessary mechanism for achieving high accuracy on long-tailed data. By developing a novel attribution method, the authors have provided a tool to peek inside the "black box" and understand exactly which features require rote learning. While this poses potential privacy risks, it highlights a fundamental trade-off between model performance and data privacy that warrants further investigation.
Summary updated