How BPE Affects Memorization in Transformers
arXiv:2110.02782
Abstract
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.
References in corpus (17)
- Adam: A Method for Stochastic Optimization
- PyTorch: An Imperative Style, High-Performance Deep Learning Library
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
- Language Models are Few-Shot Learners
- Understanding deep learning requires rethinking generalization
- Towards a Human-like Open-Domain Chatbot
- Improving Text-to-SQL Evaluation Methodology
- Theoretical Limitations of Self-Attention in Neural Sequence Models
- Language Models as Knowledge Bases?
- Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Pruned
- Measuring Compositional Generalization: A Comprehensive Method on Realistic Data
- Are Sixteen Heads Really Better than One?
- Siamese recurrent networks learn first-order logic reasoning and exhibit zero-shot compositional generalization
- On Compositionality in Neural Machine Translation
- What they do when in doubt: a study of inductive biases in seq2seq learners
- Déjà Vu: an empirical evaluation of the memorization properties of ConvNets
- Efficient Nearest Neighbor Language Models