mlsanityData to 7 Oct 2026

Data Mixture Inference: What do BPE Tokenizers Reveal about their Training Data?

arXiv 2407.16607 ↗First posted 23 Jul 2024cs.CL cs.LGcited by 13

Not on the map. Why?

Abstract (arXiv)

The pretraining data of today's strongest language models is opaque; in particular, little is known about the proportions of various domains or languages represented. In this work, we tackle a task which we call data mixture inference, which aims to uncover the distributional make-up of training data. We introduce a novel attack based on a previously overlooked source of information: byte-pair encoding (BPE) tokenizers, used by the vast majority of modern language models. Our key insight is that the ordered list of merge rules learned by a BPE tokenizer naturally reveals information about the token frequencies in its training data. Given a tokenizer's merge list along with example data for each category of interest, we formulate a linear program that solves for the proportion of each category in the tokenizer's training set. In controlled experiments, we show that our attack recovers mixture ratios with high precision for tokenizers trained on known mixtures of natural languages, programming languages, and data sources. We then apply our approach to off-the-shelf tokenizers released with recent LMs. We confirm much publicly disclosed information about these models, and also make several new inferences: GPT-4o and Mistral NeMo's tokenizers are much more multilingual than their predecessors, training on 39% and 47% non-English language data, respectively; Llama 3 extends GPT-3.5's tokenizer primarily for multilingual (48%) use; GPT-3.5's and Claude's tokenizers are trained on predominantly code (~60%). We hope our work sheds light on current design practices for pretraining data, and inspires continued research into data mixture inference for LMs.

Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 37 of its 56 references that are in the map. First posted on arXiv 23 Jul 2024.

Builds on

37 of 56 references.

References · 37

  1. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  2. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  3. 2016Membership Inference Attacks against Machine Learning Modelscited by 2,221
  4. 2020Extracting Training Data from Large Language Modelscited by 2,144
  5. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
  6. 2015Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Bookscited by 1,041
  7. 2021Membership Inference Attacks From First Principlescited by 839
  8. 2022Quantifying Memorization Across Neural Language Modelscited by 755
  9. 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
  10. 2024OLMo: Accelerating the Science of Language Modelscited by 599
  11. 2018Exploiting Unintended Feature Leakage in Collaborative Learningcited by 509
  12. 2023Scalable Extraction of Training Data from (Production) Language Modelscited by 415
25 more
  1. 2023Detecting Pretraining Data from Large Language Modelscited by 375
  2. 2020Label-Only Membership Inference Attackscited by 371
  3. 2023Poisoning Web-Scale Training Datasets is Practicalcited by 276
  4. 2023Membership Inference Attacks against Language Models via Neighbourhood Comparisoncited by 249
  5. 2024A Survey on Data Selection for Language Modelscited by 230
  6. 2024Do Membership Inference Attacks Work on Large Language Models?cited by 188
  7. 2022Branch-Train-Merge: Embarrassingly Parallel Training of Expert Language Modelscited by 187
  8. 2023Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Modelscited by 186
  9. 2023A Pretrainer's Guide to Training Data: Measuring the Effects of Data Age, Domain Coverage, Quality, & Toxicitycited by 180
  10. 2022Quantifying Privacy Risks of Masked Language Models Using Membership Inference Attackscited by 168
  11. 2024Stealing Part of a Production Language Modelcited by 152
  12. 2022Towards a Cleaner Document-Oriented Multilingual Crawled Corpuscited by 143
  13. 2013Hacking Smart Machines with Smarter Ones: How to Extract Meaningful Data from Machine Learning Classifierscited by 128
  14. 2023Speak, Memory: An Archaeology of Books Known to ChatGPT/GPT-4cited by 123
  15. 2024Coercing LLMs to do and reveal (almost) anythingcited by 88
  16. 2023At Which Training Stage Does Code Data Help LLMs Reasoning?cited by 82
  17. 2024MambaByte: Token-free Selective State Space Modelcited by 58
  18. 2020Leakage of Dataset Properties in Multi-Party Machine Learningcited by 46
  19. 2024Fishing for Magikarp: Automatically Detecting Under-trained Tokens in Large Language Modelscited by 45
  20. 2021Formalizing and Estimating Distribution Inference Riskscited by 42
  21. 2024MYTE: Morphology-Driven Byte Encoding for Better and Fairer Multilingual Language Modelingcited by 40
  22. 2021Property Inference Attacks Against GANscited by 32
  23. 2024MAGNET: Improving the Multilingual Fairness of Language Models with Adaptive Gradient-Based Tokenizationcited by 31
  24. 2023Data Augmentation for Code Translation with Comparable Corpora and Multiple Referencescited by 9
  25. 2024Rethinking Tokenization: Crafting Better Tokenizers for Large Language Modelscited by 8

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 4; 2025: 8; 2026: 1.

13 papers.

Sort: