Lune

NeurIPS2024Top-tier venue

Data Mixture Inference Attack: BPE Tokenizers Reveal Training Data Compositions

Jonathan Hayase, Alisa Liu, Yejin Choi, Sewoong Oh, Noah A. Smith

Abstract

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. 1 1 Code and detailed inferences available at https://github.com/alisawuffles/tokenizer-attack .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Exploiting Unintended Feature Leakage in Collaborative Learning cites Membership Inference Attacks Against Machine Learning Models
  • Exploiting Vocabulary Frequency Imbalance in Language Model Pre-training cites Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling
  • Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling cites Extracting Training Data from Large Language Models
  • Natural Identifiers for Privacy and Data Audits in Large Language Models cites Membership Inference Attacks Against Machine Learning Models
  • Natural Identifiers for Privacy and Data Audits in Large Language Models cites Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling
  • Natural Identifiers for Privacy and Data Audits in Large Language Models cites Membership Inference Attacks From First Principles
  • Natural Identifiers for Privacy and Data Audits in Large Language Models cites Extracting Training Data from Large Language Models
  • Membership Inference Attacks From First Principles cites Exploiting Unintended Feature Leakage in Collaborative Learning
  • Membership Inference Attacks From First Principles cites Membership Inference Attacks Against Machine Learning Models
  • Membership Inference Attacks From First Principles cites Extracting Training Data from Large Language Models
  • Extracting Training Data from Large Language Models cites Membership Inference Attacks Against Machine Learning Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Dynamic Chunking for End-to-End Hierarchical Sequence ModelingSukjun Hwang, Brandon Wang, Albert GuICLR 2026 · 76 citations
  2. Exploiting Vocabulary Frequency Imbalance in Language Model Pre-trainingWoojin Chung, Jeonghoon KimNeurIPS 2025 · 6 citations
  3. Natural Identifiers for Privacy and Data Audits in Large Language ModelsLorenzo Rossi, Bartlomiej Marek, Franziska Boenisch, Adam DziedzicICLR 2026 · 3 citations
  4. Beyond Text Compression: Evaluating Tokenizers Across ScalesJonas F. Lotz, António Vilarinho Lopes, Stephan Peitz, Hendra Setiawan et al.ACL 2025 · 3 citations
  5. MUTANT: A Recipe for Multilingual Tokenizer DesignSouvik Rana, Ashish Kulkarni, Arul Menezes, Chandra Khatri et al.ACL 2026 · 2 citations

Builds on22

  1. Membership Inference Attacks Against Machine Learning ModelsReza Shokri, Marco Stronati, Congzheng Song, Vitaly ShmatikovS&P 2017 · 5,137 citations
  2. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
  3. Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley et al.ICML 2023 · 1,822 citations
  4. Exploiting Unintended Feature Leakage in Collaborative LearningLuca Melis, Congzheng Song, Emiliano De Cristofaro, Vitaly ShmatikovS&P 2019 · 1,736 citations
  5. Membership Inference Attacks From First PrinciplesNicholas Carlini, Steve Chien, Milad Nasr, Shuang Song et al.S&P 2022 · 1,049 citations

Related papers

  1. Train It and Forget It: Merge Lists are Unnecessary for BPE Inference in Language ModelsTomohiro Sawada, Kartik GoyalEMNLP 2025
  2. From Where Words Come: Efficient Regularization of Code Tokenizers Through Source AttributionPavel Chizhov, Egor Bogomolov, Ivan P. YamshchikovACL 2026
  3. Context-Aware Membership Inference Attacks against Pre-trained Large Language ModelsHongyan Chang, Ali Shahin Shamsabadi, Kleomenis Katevas, Hamed Haddadi et al.EMNLP 2025 · 19 citations
  4. Membership Inference Attacks on Tokenizers of Large Language ModelsMeng Tong, Yuntao Du, Kejiang Chen, Weiming Zhang et al.USENIX Security 2026
  5. Retrofitting Large Language Models with Dynamic TokenizationDarius Feher, Ivan Vulic, Benjamin MinixhoferACL 2025
Dusk over the sea between two cliffs drawn in fine vertical lines