mlsanityData to 7 Oct 2026

How BPE Affects Memorization in Transformers

arXiv 2110.02782 ↗First posted 6 Oct 2021cs.CLcited by 29

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  6. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  7. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  8. 2016Membership Inference Attacks against Machine Learning Modelscited by 2,221
  9. 2020Extracting Training Data from Large Language Modelscited by 2,144
  10. 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,973
  11. 2019Language Models as Knowledge Bases?cited by 1,922
  12. 2015A large annotated corpus for learning natural language inferencecited by 1,837
36 more
  1. 2016Understanding deep learning requires rethinking generalizationcited by 1,657
  2. 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,486
  3. 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 994
  4. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
  5. 2019Are Sixteen Heads Really Better than One?cited by 803
  6. 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
  7. 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
  8. 2021The FLORES-101 Evaluation Benchmark for Low-Resource and Multilingual Machine Translationcited by 556
  9. 2020Towards a Human-like Open-Domain Chatbotcited by 467
  10. 2021Generative Spoken Language Modeling from Raw Audiocited by 336
  11. 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
  12. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
  13. 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 280
  14. 2019Compositionality decomposed: how do neural networks generalise?cited by 264
  15. 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 260
  16. 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 241
  17. 2020Nearest Neighbor Machine Translationcited by 209
  18. 2021PAQ: 65 Million Probably-Asked Questions and What You Can Do With Themcited by 198
  19. 2019BPE-Dropout: Simple and Effective Subword Regularizationcited by 189
  20. 2017The Case for Learned Index Structurescited by 188
  21. 2021Masked Language Modeling and the Distributional Hypothesis: Order Word Matters Pre-training for Littlecited by 176
  22. 2020Question and Answer Test-Train Overlap in Open-Domain Question Answering Datasetscited by 137
  23. 2018Improving Text-to-SQL Evaluation Methodologycited by 133
  24. 2020The Tatoeba Translation Challenge -- Realistic Data Sets for Low Resource and Multilingual MTcited by 127
  25. 2021Text-Free Prosody-Aware Generative Spoken Language Modelingcited by 119
  26. 2021Efficient Nearest Neighbor Language Modelscited by 93
  27. 2021The paradox of the compositionality of natural language: a neural machine translation case studycited by 58
  28. 2020Effects of Parameter Norm Growth During Transformer Training: Inductive Bias from Gradient Descentcited by 40
  29. 2019Location Attention for Extrapolation to Longer Sequencescited by 33
  30. 2020What they do when in doubt: a study of inductive biases in seq2seq learnerscited by 20
  31. 2019Transcoding compositionally: using attention to find more generalizable solutionscited by 14
  32. 2019On Compositionality in Neural Machine Translationcited by 14
  33. 2021Can Transformers Jump Around Right in Natural Language? Assessing Performance Transfer from SCANcited by 14
  34. 2018D'ej`a Vu: an empirical evaluation of the memorization properties of ConvNetscited by 10
  35. 2020Dissecting Lottery Ticket Transformers: Structural and Behavioral Study of Sparse Neural Machine Translationcited by 8
  36. 2019Siamese recurrent networks learn first-order logic reasoning and exhibit zero-shot compositional generalizationcited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 1; 2022: 6; 2023: 6; 2024: 10; 2025: 5; 2026: 1.

29 papers.

Sort:

By area:

  1. 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
  2. 2021Between words and characters: A Brief History of Open-Vocabulary Modeling and Tokenization in NLPcited by 130
  3. 2023Language Model Behavior: A Comprehensive Surveycited by 92
  4. 2023Flocks of Stochastic Parrots: Differentially Private Prompt Learning for Large Language Modelscited by 80
  5. 2022Do Language Models Plagiarize?cited by 72
  6. 2022Recitation-Augmented Language Modelscited by 65
  7. 2024On the Privacy Risk of In-context Learningcited by 31
  8. 2024Undesirable Memorization in Large Language Models: A Surveycited by 29
  9. 2023MoPe: Model Perturbation-based Privacy Attacks on Language Modelscited by 25
  10. 2022A Mixture-of-Expert Approach to RL-based Dialogue Managementcited by 16
  11. 2024Reconstruct Your Previous Conversations! Comprehensively Investigating Privacy Leakage Risks in Conversations with GPT Modelscited by 16
  12. 2024Memorization in deep learning: A surveycited by 14
17 more
  1. 2025Episodic Memories Generation and Evaluation Benchmark for Large Language Modelscited by 14
  2. 2022Finding Memo: Extractive Memorization in Constrained Sequence Generation Taskscited by 12
  3. 2024DP-TabICL: In-Context Learning with Differentially Private Tabular Datacited by 11
  4. 2025The Landscape of Memorization in LLMs: Mechanisms, Measurement, and Mitigationcited by 9
  5. 2024ROME: Memorization Insights from Text, Logits and Representationcited by 8
  6. 2024The Role of Language Imbalance in Cross-lingual Generalisation: Insights from Cloned Language Experimentscited by 8
  7. 2024Understanding Memorisation in LLMs: Dynamics, Influencing Factors, and Implicationscited by 7
  8. 2025Mitigating Memorization in LLMs using Activation Steeringcited by 7
  9. 2022Breaking the Representation Bottleneck of Chinese Characters: Neural Machine Translation with Stroke Sequence Modelingcited by 6
  10. 2023Recognition, recall, and retention of few-shot memories in large language modelscited by 5
  11. 2025MeMo: Towards Language Models with Associative Memory Mechanismscited by 5
  12. 2023Memorisation Cartography: Mapping out the Memorisation-Generalisation Continuum in Neural Machine Translationcited by 4
  13. 2024On the Effect of (Near) Duplicate Subwords in Language Modellingcited by 4
  14. 2023Optimized Tokenization for Transcribed Error Correctioncited by 0
  15. 2024Bag of Lies: Robustness in Continuous Pre-training BERTcited by 0
  16. 2025Tokenization Multiplicity Leads to Arbitrary Price Variation in LLM-as-a-servicecited by 0
  17. 2026Memorization Dynamics of Fill-in-the-Middle Pretrainingcited by 0