Tracing Anonymous LLMs: Tokenizer Fingerprints and Engineering Feature Analysis
When an anonymous large language model goes live, identifying its base model is crucial for understanding its capability boundaries across various application scenarios. This article explores how to infer model lineage using three categories of signals: behavioral, quantitative, and engineering. Focusing on tokenizer fingerprints and quantitative signals, it details how to use probe texts and linear fitting methods to compare token counts, identify fixed overheads, and distinguish different model services through implementation details.
1. Why Developers Care About Model Lineage
When an anonymous model is released, developers typically want to know its base origin first. The reason is practical: training data, tokenization methods, and post-training strategies determine the model’s boundaries in understanding specific languages, handling long contexts, and processing multimodal inputs. Knowing the source helps determine which scenarios the model is suited for.
However, similar capabilities do not mean the same origin. Different teams may adopt similar architectural concepts or use distillation, fine-tuning, or system prompts to make the output style resemble another model. Therefore, lineage inference should only be treated as a reference clue, requiring multiple types of evidence for cross-validation.
2. Three Categories of Signals for Inference
- Behavioral Signals: Response tone, refusal wording, and format preferences. These are the easiest to obtain but also the easiest to imitate, resulting in low credibility when used alone.
- Quantitative Signals: Tokenization results, token counts, actual available context window, and single-output limits. These signals are quantifiable and are the focus of this article.
- Engineering Signals: API error structures, rate limiting and retry behaviors, and multimodal input preprocessing methods. They reflect the implementation details of the service chain. Sometimes these signals expose differences better than the model itself, though large services often process requests through a unified gateway, which can mask the true origin.
3. Tokenizer Fingerprints: Using Probe Texts for Comparison
A tokenizer splits text into the basic units processed by the model. Different vocabularies and splitting rules result in different token counts for the same text. Utilizing this, we can design probe sets covering various character types and compare counting differences across models.
An effective set of probes should include:
- Pure Chinese paragraphs, containing common words and rare characters;
- Pure English paragraphs, containing long words and abbreviations;
- Code snippets, containing indentation, symbols, and keywords;
- Emojis and combining characters;
- Whitespace characters like consecutive spaces, tabs, and newlines;
- Sentences mixing Chinese and English.
The value of probes lies in the difference pattern rather than an absolute number. A difference in token counts for the same text only holds comparative significance if it demonstrates a stable pattern across different input types.
When calculating differences, the statistical basis is crucial. If both counts are taken from the usage field returned by the server, the results might include server-injected system prompts or formatting wrappers, which can interfere with a pure tokenizer comparison. Therefore, you should compare values from the same API response and note the statistical basis in your report.
from statistics import pstdevdef probe_offsets(probes, counter_a, counter_b):# counter_a and counter_b are functions that call their respective APIs and return the input token count from usagediffs = [counter_a(t) - counter_b(t) for t in probes]mean = sum(diffs) / len(diffs)spread = pstdev(diffs) # The smaller the standard deviation, the more fixed the offsetreturn diffs, mean, spread
4. What a Fixed Offset Means
If the difference is nearly constant across multiple samples and independent of input length, it typically indicates a fixed overhead. Common sources include:
- Server-injected system prompts;
- Role markers in the chat template;
- Additional prefixes included for billing or statistics.
A pure tokenizer generally does not produce a constant offset independent of input length. Therefore, a fixed offset is more valuable than a simple numerical difference. However, it still cannot directly prove the model’s identity, as any server-side implementation might produce the same fixed overhead.
5. Separating Fixed Overheads and Variable Costs Using Linear Fitting
To distinguish between the fixed overhead and the cost per unit of input, we can perform a linear fit. The method involves starting with an empty or very short input, gradually increasing the length, recording the input token count returned by the server, and then fitting a straight line. The intercept approximates the fixed overhead, while the slope approximates the number of tokens per input unit.
def fit_overhead(lengths, reported_tokens):# lengths: the number of input units per request (e.g., characters)# reported_tokens: the input token count reported in the server's usagen = len(lengths)mean_x = sum(lengths) / nmean_y = sum(reported_tokens) / nsxx = sum((x - mean_x) ** 2 for x in lengths)sxy = sum((x - mean_x) * (y - mean_y) for x, y in zip(lengths, reported_tokens))slope = sxy / sxx # Requires at least two distinct input lengthsintercept = mean_y - slope * mean_xmax_residual = max(abs(y - (slope * x + intercept)) for x, y in zip(lengths, reported_tokens))return slope, intercept, max_residual
If the maximum residual is very small, it means the fitted line reliably represents the token counting behavior, effectively separating the fixed system overhead from the variable token cost.
