arXiv:2610.39919cs.CLOct 2026

Manuscript Offprint

arXiv:2610.39919

Tokenizer Tokens Tell Training Tales

Nishita Jain, Parth Upman, Shreyank N Gowda

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Tokenizers are usually treated as fixed preprocessing tools, but they are trained on text and can retain traces of that text in their vocabularies. We ask whether a BPE tokenizer can reveal if a candidate dataset was part of its training corpus. The key observation is simple. Rare strings become tokens only when enough corpus frequency pushes them over the merge threshold. This suggests that membership signal should appear in rare tokens used by the candidate dataset, rather than in the order in which merges were made. We formalize this under a threshold model of BPE inclusion, showing that the likelihood-ratio test assigns its largest weights to tokens that are rare in the background but frequent in the candidate dataset. The same model suggests that merge rank and merge-graph position should not add a first-order membership signal once token existence and dataset frequency are known. We instantiate this view as RTAM-Fusion, which calibrates rare-token mass with shadow tokenizers and combines signals across rarity levels. On the tokenizer membership benchmark, RTAM-Fusion improves AUC and balanced accuracy over Vocabulary Overlap while using fewer shadow tokenizers. Existing defenses also continue to leak membership signal against adaptive attackers at production vocabulary sizes. Code: https://anonymous.4open.science/r/RTAM-Fusion-F7EE/

1 Introduction

Tokenizers are usually treated as a fixed first step before modelling begins. Text is split into token IDs, and the language model is then trained on those IDs. This view misses an important point. Subword tokenizers are themselves learned from text. A BPE tokenizer builds its vocabulary by deciding which strings occur often enough in the training corpus to become tokens. The tokenizer is therefore not only a preprocessing tool, but also a data-dependent artifact that may retain traces of the corpus used to train it. More broadly, securing generative AI systems requires examining vulnerabilities beyond conventional model performance. (Mustafa et al., 2025; Shen et al., 2024; Yazmyradov, 2024; Mustafa et al., 2026) demonstrate that even relatively simple prompt-based jailbreaks can circumvent safety mechanisms in language and text-to-image models, highlighting the importance of evaluating security under adversarial conditions. While these attacks concern generation-time safeguards rather than training-data privacy, they illustrate the broader need to investigate overlooked attack surfaces. In this work, we focus on one such surface: the information retained by a tokenizer during training.

This becomes important when the training data of large language models is in question. Membership inference asks whether a candidate example or dataset was part of training. Most work studies this through the trained model, but recent work by Tong et al. (Tong et al., 2026) showed that the tokenizer can also leak membership information. They proposed attacks based on vocabulary overlap, frequency estimation, compression, and merge similarity, together with two natural defenses based on pruning low-count tokens and randomizing BPE merge order.

We ask what part of the tokenizer actually carries this signal. Several answers seem plausible. A member dataset may share unusual vocabulary items with the target tokenizer. Its tokens may appear at distinctive merge ranks. Its merge graph may have a recognizable structure. Or it may simply be compressed in a different way. Our results point to a simpler explanation. For dataset-level membership, the signal is mainly in rare tokens that the candidate dataset activates.

The intuition is direct. Common strings become tokens regardless of whether one particular dataset was present, so their existence says little about membership. Rare strings are different. If a candi-date dataset repeatedly uses a rare string, and that string appears in the learned vocabulary, then the dataset may have helped push it over the frequency threshold needed for inclusion. The useful quantity is therefore not just whether the vocabulary overlaps with the dataset, but how much of the dataset's own token stream falls on rare learned tokens.

We formalize this intuition under a threshold model of BPE inclusion. Under this model, the likelihood-ratio test for tokenizer membership assigns its largest weights to tokens that are rare in the background corpus but frequent in the candidate dataset. This motivates a rarity-weighted statistic over the dataset's activated-token mass. The same model also suggests that merge rank and merge-graph position should not provide an independent membership channel once token existence and the dataset's own token frequencies are known. In short, rarity matters more than order.

This leads to RTAM-FUSION, a rare-token activation mass attack. Given a target tokenizer and shadow tokenizers trained under the same procedure, we measure the fraction of a candidate dataset's token stream that falls on rare tokens at several rarity levels. We add two inverse-document-frequency style features, calibrate each feature against an out-shadow null following the LiRA principle (Carlini et al., 2022), and combine them into one membership score. The threat model is the same as in Tong et al. (Tong et al., 2026). The change is the statistic used to read the tokenizer.

On the tokenizer membership benchmark, RTAM-FUSION improves over Vocabulary Overlap on AUC and balanced accuracy across the undefended setting and the published min-count defense setting, while using substantially fewer shadow tokenizers. Its low false-positive performance is more mixed. It wins at production-scale vocabularies, but loses some small-vocabulary and defended TPR@1%FPR comparisons. We keep this distinction explicit because low false positive rates are important in membership inference.

The same view also clarifies why some defenses are brittle. If merge order is not where the signal lives, then randomizing merge order should not remove the signal. We test this by evaluating defenses against attackers that know the defense was applied and adapt their features. Across targeted removal of member-distinctive tokens, min-count filtering, merge-order randomization, and a bounded per-site contribution mechanism, the tested defenses do not drive membership inference to chance at production vocabulary size. Removing rare tokens weakens the original signal, but can leave a fragmentation footprint that an attacker can read.

Overall, our results show that tokenizer tokens tell training tales through rare vocabulary entries. We make three contributions. First, we characterize the membership signal in BPE tokenizers with a threshold inclusion model, which predicts that rare tokens activated by the candidate dataset carry the main signal, while merge order and merge-graph position should not add a first-order channel. Second, we introduce RTAM-FUSION, a calibrated rare-token activation mass attack that improves AUC and balanced accuracy over the strongest published tokenizer membership baseline while using fewer shadow tokenizers. Third, we evaluate tokenizer defenses against adaptive attackers and show that the tested defenses still leak membership signal at production vocabulary size.