Data Mixture Inference: What do BPE Tokenizers Reveal about their Training Data?
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
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2016Membership Inference Attacks against Machine Learning Modelscited by 2,221
- 2020Extracting Training Data from Large Language Modelscited by 2,144
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
- 2015Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Bookscited by 1,041
- 2021Membership Inference Attacks From First Principlescited by 839
- 2022Quantifying Memorization Across Neural Language Modelscited by 755
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
- 2024OLMo: Accelerating the Science of Language Modelscited by 599
- 2018Exploiting Unintended Feature Leakage in Collaborative Learningcited by 509
- 2023Scalable Extraction of Training Data from (Production) Language Modelscited by 415
25 more
- 2023Detecting Pretraining Data from Large Language Modelscited by 375
- 2020Label-Only Membership Inference Attackscited by 371
- 2023Poisoning Web-Scale Training Datasets is Practicalcited by 276
- 2023Membership Inference Attacks against Language Models via Neighbourhood Comparisoncited by 249
- 2024A Survey on Data Selection for Language Modelscited by 230
- 2024Do Membership Inference Attacks Work on Large Language Models?cited by 188
- 2022Branch-Train-Merge: Embarrassingly Parallel Training of Expert Language Modelscited by 187
- 2023Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Modelscited by 186
- 2023A Pretrainer's Guide to Training Data: Measuring the Effects of Data Age, Domain Coverage, Quality, & Toxicitycited by 180
- 2022Quantifying Privacy Risks of Masked Language Models Using Membership Inference Attackscited by 168
- 2024Stealing Part of a Production Language Modelcited by 152
- 2022Towards a Cleaner Document-Oriented Multilingual Crawled Corpuscited by 143
- 2013Hacking Smart Machines with Smarter Ones: How to Extract Meaningful Data from Machine Learning Classifierscited by 128
- 2023Speak, Memory: An Archaeology of Books Known to ChatGPT/GPT-4cited by 123
- 2024Coercing LLMs to do and reveal (almost) anythingcited by 88
- 2023At Which Training Stage Does Code Data Help LLMs Reasoning?cited by 82
- 2024MambaByte: Token-free Selective State Space Modelcited by 58
- 2020Leakage of Dataset Properties in Multi-Party Machine Learningcited by 46
- 2024Fishing for Magikarp: Automatically Detecting Under-trained Tokens in Large Language Modelscited by 45
- 2021Formalizing and Estimating Distribution Inference Riskscited by 42
- 2024MYTE: Morphology-Driven Byte Encoding for Better and Fairer Multilingual Language Modelingcited by 40
- 2021Property Inference Attacks Against GANscited by 32
- 2024MAGNET: Improving the Multilingual Fairness of Language Models with Adaptive Gradient-Based Tokenizationcited by 31
- 2023Data Augmentation for Code Translation with Comparable Corpora and Multiple Referencescited by 9
- 2024Rethinking Tokenization: Crafting Better Tokenizers for Large Language Modelscited by 8
Built on by
Citing papers per year: 2024: 4; 2025: 8; 2026: 1.
13 papers.
Sort:
- 2025SuperBPE: Space Travel for Language Modelscited by 58
- 2025On Linear Representations and Pretraining Data Frequency in Language Modelscited by 23
- 2025Evaluating Morphological Alignment of Tokenizers in 70 Languagescited by 22
- 2025TokAlign: Efficient Vocabulary Adaptation via Token Alignmentcited by 11
- 2024Cross-Lingual Transfer of Debiasing and Detoxification in Multilingual LLMs: An Extensive Investigationcited by 5
- 2025Speculating LLMs' Chinese Training Data Pollution from Their Tokenscited by 5
- 2025Learning Dynamics in Continual Pre-Training for Large Language Modelscited by 4
- 2024Performance Evaluation of Tokenizers in Large Language Models for the Assamese Languagecited by 3
- 2024VersaTune: An Efficient Data Composition Framework for Training Multi-Capability LLMscited by 3
- 2026Proxy Compression for Language Modelingcited by 3
- 2025When Smiley Turns Hostile: Interpreting How Emojis Trigger LLMs' Toxicitycited by 2
- 2025Train It and Forget It: Merge Lists are Unnecessary for BPE Inference in Language Modelscited by 1
1 more
- 2024Batching BPE Tokenization Mergescited by 0
- 2026Proxy Compression for Language Modeling4 Feb 2026
- 2025When Smiley Turns Hostile: Interpreting How Emojis Trigger LLMs' Toxicity14 Sep 2025
- 2025Speculating LLMs' Chinese Training Data Pollution from Their Tokens25 Aug 2025
- 2025Train It and Forget It: Merge Lists are Unnecessary for BPE Inference in Language Models8 Aug 2025
- 2025Evaluating Morphological Alignment of Tokenizers in 70 Languages8 Jul 2025
- 2025TokAlign: Efficient Vocabulary Adaptation via Token Alignment4 Jun 2025
- 2025Learning Dynamics in Continual Pre-Training for Large Language Models12 May 2025
- 2025On Linear Representations and Pretraining Data Frequency in Language Models16 Apr 2025
- 2025SuperBPE: Space Travel for Language Models17 Mar 2025
- 2024Cross-Lingual Transfer of Debiasing and Detoxification in Multilingual LLMs: An Extensive Investigation18 Dec 2024
- 2024VersaTune: An Efficient Data Composition Framework for Training Multi-Capability LLMs18 Nov 2024
- 2024Performance Evaluation of Tokenizers in Large Language Models for the Assamese Language28 Sep 2024
1 more
- 2024Batching BPE Tokenization Merges5 Aug 2024
- 2025SuperBPE: Space Travel for Language Modelscited by 58
- 2025On Linear Representations and Pretraining Data Frequency in Language Modelscited by 23
- 2025Evaluating Morphological Alignment of Tokenizers in 70 Languagescited by 22
- 2025TokAlign: Efficient Vocabulary Adaptation via Token Alignmentcited by 11
- 2024Cross-Lingual Transfer of Debiasing and Detoxification in Multilingual LLMs: An Extensive Investigationcited by 5
- 2025Speculating LLMs' Chinese Training Data Pollution from Their Tokenscited by 5
- 2025Learning Dynamics in Continual Pre-Training for Large Language Modelscited by 4
- 2024Performance Evaluation of Tokenizers in Large Language Models for the Assamese Languagecited by 3
- 2024VersaTune: An Efficient Data Composition Framework for Training Multi-Capability LLMscited by 3
- 2026Proxy Compression for Language Modelingcited by 3
- 2025When Smiley Turns Hostile: Interpreting How Emojis Trigger LLMs' Toxicitycited by 2
- 2025Train It and Forget It: Merge Lists are Unnecessary for BPE Inference in Language Modelscited by 1
12 most cited of 13 All 13 (JSON)
- 2026Proxy Compression for Language Modeling4 Feb 2026
- 2025When Smiley Turns Hostile: Interpreting How Emojis Trigger LLMs' Toxicity14 Sep 2025
- 2025Speculating LLMs' Chinese Training Data Pollution from Their Tokens25 Aug 2025
- 2025Train It and Forget It: Merge Lists are Unnecessary for BPE Inference in Language Models8 Aug 2025
- 2025Evaluating Morphological Alignment of Tokenizers in 70 Languages8 Jul 2025
- 2025TokAlign: Efficient Vocabulary Adaptation via Token Alignment4 Jun 2025
- 2025Learning Dynamics in Continual Pre-Training for Large Language Models12 May 2025
- 2025On Linear Representations and Pretraining Data Frequency in Language Models16 Apr 2025
- 2025SuperBPE: Space Travel for Language Models17 Mar 2025
- 2024Cross-Lingual Transfer of Debiasing and Detoxification in Multilingual LLMs: An Extensive Investigation18 Dec 2024
- 2024VersaTune: An Efficient Data Composition Framework for Training Multi-Capability LLMs18 Nov 2024
- 2024Performance Evaluation of Tokenizers in Large Language Models for the Assamese Language28 Sep 2024
12 newest of 13 All 13 (JSON)