How BPE Affects Memorization in Transformers
Not on the map. Why?
Abstract (arXiv)
Training data memorization in NLP can both be beneficial (e.g., closed-book QA) and undesirable (personal data extraction). In any case, successful model training requires a non-trivial amount of memorization to store word spellings, various linguistic idiosyncrasies and common knowledge. However, little is known about what affects the memorization behavior of NLP models, as the field tends to focus on the equally important question of generalization. In this work, we demonstrate that the size of the subword vocabulary learned by Byte-Pair Encoding (BPE) greatly affects both ability and tendency of standard Transformer models to memorize training data, even when we control for the number of learned parameters. We find that with a large subword vocabulary size, Transformer models fit random mappings more easily and are more vulnerable to membership inference attacks. Similarly, given a prompt, Transformer-based language models with large subword vocabularies reproduce the training data more often. We conjecture this effect is caused by reduction in the sequences' length that happens as the BPE vocabulary grows. Our findings can allow a more informed choice of hyper-parameters, that is better tailored for a particular use-case.
Key facts. Cited by 29 papers in the map (data through 7 Oct 2026). Builds on 48 of its 67 references that are in the map. First posted on arXiv 6 Oct 2021.
Builds on
48 of 67 references.
References · 48
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2016Membership Inference Attacks against Machine Learning Modelscited by 2,221
- 2020Extracting Training Data from Large Language Modelscited by 2,144
- 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,973
- 2019Language Models as Knowledge Bases?cited by 1,922
- 2015A large annotated corpus for learning natural language inferencecited by 1,837
36 more
- 2016Understanding deep learning requires rethinking generalizationcited by 1,657
- 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,486
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 994
- 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
- 2019Are Sixteen Heads Really Better than One?cited by 803
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
- 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
- 2021The FLORES-101 Evaluation Benchmark for Low-Resource and Multilingual Machine Translationcited by 556
- 2020Towards a Human-like Open-Domain Chatbotcited by 467
- 2021Generative Spoken Language Modeling from Raw Audiocited by 336
- 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
- 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 280
- 2019Compositionality decomposed: how do neural networks generalise?cited by 264
- 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 260
- 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 241
- 2020Nearest Neighbor Machine Translationcited by 209
- 2021PAQ: 65 Million Probably-Asked Questions and What You Can Do With Themcited by 198
- 2019BPE-Dropout: Simple and Effective Subword Regularizationcited by 189
- 2017The Case for Learned Index Structurescited by 188
- 2021Masked Language Modeling and the Distributional Hypothesis: Order Word Matters Pre-training for Littlecited by 176
- 2020Question and Answer Test-Train Overlap in Open-Domain Question Answering Datasetscited by 137
- 2018Improving Text-to-SQL Evaluation Methodologycited by 133
- 2020The Tatoeba Translation Challenge -- Realistic Data Sets for Low Resource and Multilingual MTcited by 127
- 2021Text-Free Prosody-Aware Generative Spoken Language Modelingcited by 119
- 2021Efficient Nearest Neighbor Language Modelscited by 93
- 2021The paradox of the compositionality of natural language: a neural machine translation case studycited by 58
- 2020Effects of Parameter Norm Growth During Transformer Training: Inductive Bias from Gradient Descentcited by 40
- 2019Location Attention for Extrapolation to Longer Sequencescited by 33
- 2020What they do when in doubt: a study of inductive biases in seq2seq learnerscited by 20
- 2019Transcoding compositionally: using attention to find more generalizable solutionscited by 14
- 2019On Compositionality in Neural Machine Translationcited by 14
- 2021Can Transformers Jump Around Right in Natural Language? Assessing Performance Transfer from SCANcited by 14
- 2018D'ej`a Vu: an empirical evaluation of the memorization properties of ConvNetscited by 10
- 2020Dissecting Lottery Ticket Transformers: Structural and Behavioral Study of Sparse Neural Machine Translationcited by 8
- 2019Siamese recurrent networks learn first-order logic reasoning and exhibit zero-shot compositional generalizationcited by 5
Built on by
Citing papers per year: 2021: 1; 2022: 6; 2023: 6; 2024: 10; 2025: 5; 2026: 1.
29 papers.
Sort:
By area:
- 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
- 2021Between words and characters: A Brief History of Open-Vocabulary Modeling and Tokenization in NLPcited by 130
- 2023Language Model Behavior: A Comprehensive Surveycited by 92
- 2023Flocks of Stochastic Parrots: Differentially Private Prompt Learning for Large Language Modelscited by 80
- 2022Do Language Models Plagiarize?cited by 72
- 2022Recitation-Augmented Language Modelscited by 65
- 2024On the Privacy Risk of In-context Learningcited by 31
- 2024Undesirable Memorization in Large Language Models: A Surveycited by 29
- 2023MoPe: Model Perturbation-based Privacy Attacks on Language Modelscited by 25
- 2022A Mixture-of-Expert Approach to RL-based Dialogue Managementcited by 16
- 2024Reconstruct Your Previous Conversations! Comprehensively Investigating Privacy Leakage Risks in Conversations with GPT Modelscited by 16
- 2024Memorization in deep learning: A surveycited by 14
17 more
- 2025Episodic Memories Generation and Evaluation Benchmark for Large Language Modelscited by 14
- 2022Finding Memo: Extractive Memorization in Constrained Sequence Generation Taskscited by 12
- 2024DP-TabICL: In-Context Learning with Differentially Private Tabular Datacited by 11
- 2025The Landscape of Memorization in LLMs: Mechanisms, Measurement, and Mitigationcited by 9
- 2024ROME: Memorization Insights from Text, Logits and Representationcited by 8
- 2024The Role of Language Imbalance in Cross-lingual Generalisation: Insights from Cloned Language Experimentscited by 8
- 2024Understanding Memorisation in LLMs: Dynamics, Influencing Factors, and Implicationscited by 7
- 2025Mitigating Memorization in LLMs using Activation Steeringcited by 7
- 2022Breaking the Representation Bottleneck of Chinese Characters: Neural Machine Translation with Stroke Sequence Modelingcited by 6
- 2023Recognition, recall, and retention of few-shot memories in large language modelscited by 5
- 2025MeMo: Towards Language Models with Associative Memory Mechanismscited by 5
- 2023Memorisation Cartography: Mapping out the Memorisation-Generalisation Continuum in Neural Machine Translationcited by 4
- 2024On the Effect of (Near) Duplicate Subwords in Language Modellingcited by 4
- 2023Optimized Tokenization for Transcribed Error Correctioncited by 0
- 2024Bag of Lies: Robustness in Continuous Pre-training BERTcited by 0
- 2025Tokenization Multiplicity Leads to Arbitrary Price Variation in LLM-as-a-servicecited by 0
- 2026Memorization Dynamics of Fill-in-the-Middle Pretrainingcited by 0
- 2026Memorization Dynamics of Fill-in-the-Middle Pretraining21 May 2026
- 2025The Landscape of Memorization in LLMs: Mechanisms, Measurement, and Mitigation8 Jul 2025
- 2025Tokenization Multiplicity Leads to Arbitrary Price Variation in LLM-as-a-service6 Jun 2025
- 2025Mitigating Memorization in LLMs using Activation Steering8 Mar 2025
- 2025MeMo: Towards Language Models with Associative Memory Mechanisms18 Feb 2025
- 2025Episodic Memories Generation and Evaluation Benchmark for Large Language Models21 Jan 2025
- 2024On the Privacy Risk of In-context Learning15 Nov 2024
- 2024Undesirable Memorization in Large Language Models: A Survey3 Oct 2024
- 2024Understanding Memorisation in LLMs: Dynamics, Influencing Factors, and Implications27 Jul 2024
- 2024Bag of Lies: Robustness in Continuous Pre-training BERT14 Jun 2024
- 2024Memorization in deep learning: A survey6 Jun 2024
- 2024The Role of Language Imbalance in Cross-lingual Generalisation: Insights from Cloned Language Experiments11 Apr 2024
17 more
- 2024On the Effect of (Near) Duplicate Subwords in Language Modelling9 Apr 2024
- 2024DP-TabICL: In-Context Learning with Differentially Private Tabular Data8 Mar 2024
- 2024ROME: Memorization Insights from Text, Logits and Representation1 Mar 2024
- 2024Reconstruct Your Previous Conversations! Comprehensively Investigating Privacy Leakage Risks in Conversations with GPT Models5 Feb 2024
- 2023Memorisation Cartography: Mapping out the Memorisation-Generalisation Continuum in Neural Machine Translation9 Nov 2023
- 2023MoPe: Model Perturbation-based Privacy Attacks on Language Models22 Oct 2023
- 2023Optimized Tokenization for Transcribed Error Correction16 Oct 2023
- 2023Flocks of Stochastic Parrots: Differentially Private Prompt Learning for Large Language Models24 May 2023
- 2023Recognition, recall, and retention of few-shot memories in large language models30 Mar 2023
- 2023Language Model Behavior: A Comprehensive Survey20 Mar 2023
- 2022Breaking the Representation Bottleneck of Chinese Characters: Neural Machine Translation with Stroke Sequence Modeling23 Nov 2022
- 2022Finding Memo: Extractive Memorization in Constrained Sequence Generation Tasks24 Oct 2022
- 2022Recitation-Augmented Language Models4 Oct 2022
- 2022A Mixture-of-Expert Approach to RL-based Dialogue Management31 May 2022
- 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Models22 May 2022
- 2022Do Language Models Plagiarize?15 Mar 2022
- 2021Between words and characters: A Brief History of Open-Vocabulary Modeling and Tokenization in NLP20 Dec 2021
- 2022A Mixture-of-Expert Approach to RL-based Dialogue Managementcited by 16
- 2022A Mixture-of-Expert Approach to RL-based Dialogue Management31 May 2022
- 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
- 2021Between words and characters: A Brief History of Open-Vocabulary Modeling and Tokenization in NLPcited by 130
- 2023Language Model Behavior: A Comprehensive Surveycited by 92
- 2023Flocks of Stochastic Parrots: Differentially Private Prompt Learning for Large Language Modelscited by 80
- 2022Do Language Models Plagiarize?cited by 72
- 2022Recitation-Augmented Language Modelscited by 65
- 2024Undesirable Memorization in Large Language Models: A Surveycited by 29
- 2023MoPe: Model Perturbation-based Privacy Attacks on Language Modelscited by 25
- 2024Reconstruct Your Previous Conversations! Comprehensively Investigating Privacy Leakage Risks in Conversations with GPT Modelscited by 16
- 2024Memorization in deep learning: A surveycited by 14
- 2025Episodic Memories Generation and Evaluation Benchmark for Large Language Modelscited by 14
- 2022Finding Memo: Extractive Memorization in Constrained Sequence Generation Taskscited by 12
12 most cited of 26 All 26 (JSON)
- 2026Memorization Dynamics of Fill-in-the-Middle Pretraining21 May 2026
- 2025Tokenization Multiplicity Leads to Arbitrary Price Variation in LLM-as-a-service6 Jun 2025
- 2025Mitigating Memorization in LLMs using Activation Steering8 Mar 2025
- 2025MeMo: Towards Language Models with Associative Memory Mechanisms18 Feb 2025
- 2025Episodic Memories Generation and Evaluation Benchmark for Large Language Models21 Jan 2025
- 2024Undesirable Memorization in Large Language Models: A Survey3 Oct 2024
- 2024Understanding Memorisation in LLMs: Dynamics, Influencing Factors, and Implications27 Jul 2024
- 2024Bag of Lies: Robustness in Continuous Pre-training BERT14 Jun 2024
- 2024Memorization in deep learning: A survey6 Jun 2024
- 2024The Role of Language Imbalance in Cross-lingual Generalisation: Insights from Cloned Language Experiments11 Apr 2024
- 2024On the Effect of (Near) Duplicate Subwords in Language Modelling9 Apr 2024
- 2024DP-TabICL: In-Context Learning with Differentially Private Tabular Data8 Mar 2024
12 newest of 26 All 26 (JSON)