Identifying Anonymous LLMs with Tokenizer Fingerprinting and Token Offset Analysis

    This article explains how a large language model's tokenizer can reveal its model family even when the vendor releases the model under a codename. It covers why tokenizer fingerprints are hard to hide, how token counts on a fixed probe text can expose shared vocabularies and extra server-side content, how batch testing and other signals can check the results, and where the method's limits lie.

    1. Why Anonymous Models Can Be Identified

    Models are sometimes released under codenames without disclosing their origin. The publisher usually wants to downplay where the model came from, but the model itself gives clues. Its tokenizer, vocabulary, segmentation logic, chat template, and even reply style are stable traits left over from long-term training and engineering work. For developers familiar with a model family, these traits work almost like a fingerprint.

    Among these traits, the tokenizer fingerprint is the hardest to conceal and the easiest to quantify. The tokenizer is the input-side infrastructure of a model. Its segmentation determines the token count, and token counts are exact, reproducible, and comparable across models. As long as a publisher reuses or fine-tunes the vocabulary of the original family, this fingerprint keeps showing.

    2. How Tokenizers Form a Fingerprint

    1. The vocabulary determines segmentation granularity

    Before training, each model family builds its vocabulary from statistics on its own corpus. The vocabulary’s contents, its size, and its subword segmentation algorithm (such as the specific merge rules of BPE-style methods) all differ. As a result, the same text can be split into different numbers of tokens with different boundaries.

    For example, for the same mixed Chinese-English text, one model family may keep common Chinese phrases as whole tokens and split the text into 3 tokens. Another family may split it character by character or by two characters, producing 8 tokens. For ordinary text, this difference is noise. For deliberately designed probe text, it is a stable signal.

    2. Special tokens and injected content add offsets

    Inference services usually add system-level content around user input, such as a system prompt, a safety prefix, or template control tokens. The tokenizer encodes this content too, so it adds to the token count. If an outside observer gets the raw model count and compares it with the count the server actually records, the gap may reveal how much hidden content was injected.

    3. A Reproducible Probing Method

    Step 1: Build high-discrimination test text

    A good probe text covers many segmentation cases, so vocabulary differences show up clearly. Common practice mixes:

    • long passages of Chinese and English;
    • code snippets with indentation, symbols, and identifiers;
    • emoji, full-width symbols, and digit strings;
    • invented words and low-frequency combinations, which test the edges of the vocabulary.

    Example:

    1. 你好世界 hello world, def train_step(batch):
    2. loss = model(batch).sum(); 😀🎮 中文+English+12345 mixed_文本_test

    Step 2: Count tokens for the same text across models

    Send the same text to the anonymous model and to several public models that may be related, then record each model’s returned token count. The key observation is the linear relationship between the counts:

    • If two models share a vocabulary and segmentation logic, their raw counts for the same text should match exactly or nearly so.
    • If one model runs in a deployment that adds a hidden system prompt on the server, its count should consistently exceed the reference count by a fixed offset.

    Step 3: Verify that the offset is stable

    A single comparison can be a coincidence, so batch verification is needed. A common practice in the community is to prepare several groups of prompts of different types, for example 25 groups covering Chinese conversation, English Q&A, and code completion, and count each one. If the anonymous model shows the same fixed offset relative to a reference model in every group, two conclusions are reasonable:

    1. The two models share a tokenizer lineage.
    2. The anonymous model’s server adds content about as long as the offset, most likely a hidden system prompt.

    The logic can be expressed in pseudocode:

    1. offsets = []
    2. for p in probe_prompts: # Multiple heterogeneous probe texts
    3. a = count_tokens(anon_model, p)
    4. b = count_tokens(ref_model, p)
    5. offsets.append(a - b)
    6. # If all elements of offsets are equal and clearly greater than 0
    7. # => same tokenizer lineage + a fixed-length hidden injected content

    In circulating tests, one text mixing Chinese, English, code, and emoji counted 68 tokens in both versions of a reference model, but 143 tokens in the anonymous model. The difference of 75 can be explained by an external hidden system prompt. Repeating the test with 25 different prompts also showed a similar fixed offset. A consistent offset across many groups like this is fairly strong evidence.

    4. Other Identification Methods

    Tokenizer fingerprints are usually cross-checked with the following methods to make the conclusion more credible:

    1. Chat templates and special tokens: The context structure of the anonymous model, and its habits for start and end markers, often carry over from the original family.
    2. Reply style and refusal boundaries: The wording of safety policies and the sentence patterns of refusal templates come from the alignment stage of training.
    3. Capability profile: In specific domains such as long text, code, and math, build graded test sets and compare the shape of the capability curves rather than the absolute scores.
    4. Self-identification questions: Ask the model directly about its identity, version, and training information. Answers can be faked or overridden, but they still have some reference value when combined with tokenizer evidence.

    Any single method can be deliberately disguised. Disguising a low-level feature like tokenizer counts is very costly, though. Changing the vocabulary means retraining almost from scratch, and keeping it leaves a fingerprint.

    5. Practical Considerations

    • Use consistent counting rules: Deployments differ in whether they count special tokens and reply templates. Use the same counting method for every comparison. When needed, count offline with a local tokenizer to rule out server-side effects.
    • An offset is not conclusive proof: A fixed offset can also come from template differences or context concatenation strategies. Judge it together with multiple experiments and several types of evidence.
    • Multiple reference versions are more useful: If different versions of a reference model count the same text identically, the segmentation of that text is stable, and the conclusions are more reliable.
    • Implications for enterprise users: If you choose an LLM service on a cloud platform, for example by storing model assets in object storage, deploying inference on a container platform, or monitoring token usage with a monitoring service, tokenizer differences affect cost accounting, quota estimation, and multi-model routing directly. When evaluating a provider, also check how transparent it is about the models it offers.

    6. Conclusion

    Anonymous models are hard to keep truly anonymous, because tokenizer fingerprints can be quantified and are hard to disguise. With the three-step method of building probe text, counting tokens across models, and verifying fixed offsets in batches, the community can make convincing lineage inferences without access to internal information. For developers, this method is more than a tool for tracing origins. It also shows an engineering fact: tokenizer choice is one of the most distinctive low-level decisions in a model. Any system built on token billing and quotas should account for vocabulary differences.