Anonymous LLM Attribution: Tokenization and Fingerprinting in Practice

    Token counts, fixed overhead, and multimodal preprocessing can offer clues about the models behind anonymous AI services. This article explains how to run reproducible fingerprinting experiments, interpret the results, and distinguish model-level similarities from gateway or service behavior—without treating indirect evidence as proof of provenance.

    1. Why Model Provenance Matters

    A model’s provenance directly affects model selection. Training data, alignment strategies, and safety policies vary across model families. Organizations need to understand which models power a service when conducting compliance reviews, assessing data security, and estimating costs.

    In practice, a model may launch anonymously, with the platform identifying only a third-party provider and disclosing neither its architecture nor its training origins. Developers must then rely on external observations to form hypotheses. Those hypotheses can inform an assessment, but they cannot replace formal disclosure from the provider.

    2. Five Common Sources of Evidence

    Community investigations typically look for clues in five areas:

    1. Tokenizer characteristics: Different tokenizers split the same text differently, producing repeatable differences in token counts.
    2. Fixed offsets: Hidden content added to user input, such as system prompts or template markers, can create relatively constant token overhead.
    3. Multimodal preprocessing parameters: Video frame sampling rates, image resizing dimensions, patch sizes, and token budgets reflect engineering choices that may differ between teams.
    4. Response style and behavior: Models may exhibit similar refusal language, formatting preferences, and reasoning habits.
    5. API behavior: Error formats, default parameter values, rate-limit headers, and output-length limits can reveal aspects of the serving implementation.

    These clues vary considerably in reliability. The following sections focus on the first three because they can be tested through reproducible experiments.

    3. Comparing Token Counts

    Token counting is one of the most direct fingerprinting methods. The process is straightforward: build a test set, standardize the inputs, record reported usage, and analyze the differences.

    3.1 Build a Representative Test Set

    Include text likely to expose differences between tokenizers:

    • Mixed Chinese and English sentences to test how Chinese characters are segmented.
    • Code snippets containing indentation, symbol combinations, and long identifiers.
    • Emoji and rare characters to examine byte-level encoding behavior.
    • Repeated whitespace, line breaks, and unusual punctuation.

    Use multiple examples in each category rather than drawing conclusions from a single result.

    3.2 Analyze the Pattern of Differences

    Suppose each record contains the test text, the token count reported by the target service, and the count produced by a reference tokenizer. The following function calculates the mean difference, its standard deviation, and the mean ratio:

    1. from statistics import mean, pstdev
    2. def analyze_offsets(records):
    3. """
    4. records: Each item is
    5. (test_text, service_reported_tokens, reference_token_count).
    6. """
    7. diffs = [reported - reference for _, reported, reference in records]
    8. ratios = [reported / reference for _, reported, reference in records if reference > 0]
    9. spread = pstdev(diffs)
    10. return {
    11. "mean_difference": mean(diffs),
    12. "difference_stddev": spread,
    13. "mean_ratio": mean(ratios),
    14. # Adjust the threshold for sample size and measurement noise.
    15. "preliminary_assessment": (
    16. "Stable difference, consistent with a fixed offset"
    17. if spread < 1
    18. else "Text-dependent difference, possibly due to different tokenization rules"
    19. ),
    20. }

    Consider both the differences and the ratios. A nearly constant difference suggests overhead that does not depend on the input content, most likely a fixed prefix or template. A nearly constant ratio suggests a systematic difference in segmentation, potentially indicating different tokenizers.

    Both effects can occur together, so interpretation requires a sufficiently varied set of samples.

    3.3 Measure Baseline Overhead

    Investigate the source of any fixed offset. Submit an empty or very short input, record the baseline token count, and subtract it from each sample’s reported usage.

    1. # report_tokens calls the target service and reads its usage field.
    2. # This example is illustrative.
    3. baseline = report_tokens("")
    4. adjusted = [(text, reported - baseline, ref) for text, reported, ref in records]

    If the offset disappears after baseline subtraction, the result is consistent with fixed request overhead, such as a template. If an offset remains, additional server-side content, such as system instructions or safety-policy text, may need investigation.

    Baseline subtraction alone does not identify which hidden components account for the overhead.

    4. Interpreting Fixed Offsets—and Avoiding Pitfalls

    A fixed offset is useful evidence, but it has several possible explanations.

    The total input token count is approximately the sum of:

    • Tokens in the user’s text.
    • Tokens in system-level instructions.
    • Role markers in the conversation template.
    • Other content injected by the service.

    If any of these components is fixed, it can produce a constant difference.

    A fixed offset therefore has at least three plausible sources:

    • A hidden system prompt added by the server.
    • Different numbers of conversation-template markers.
    • Request rewriting by a gateway or middleware layer.

    The third case is common in deployed services. A third-party provider may route requests through a unified gateway that adds its own content around them. As a result, “Who trained the model?” and “Who operates the service?” may be two separate questions.

    5. Fingerprinting Multimodal Inputs

    Multimodal preprocessing pipelines are more complex than text-only pipelines and can leave more specific fingerprints. For video, token consumption may depend on the frame sampling rate, per-frame resolution, patch size, and maximum frame count.

    Samples with known parameters can be used to fit a simple linear model and estimate the service’s token-accounting rules.

    1. import numpy as np
    2. # Each sample: (frame_count, patches_per_frame, reported_token_count)
    3. X = np.array([[frames, patches] for frames, patches, _ in samples], dtype=float)
    4. y = np.array([tokens for _, _, tokens in samples], dtype=float)
    5. # Add an intercept and fit:
    6. # tokens ≈ a * frame_count + b * patches_per_frame + c
    7. X1 = np.hstack([X, np.ones((len(X), 1))])
    8. coef, residuals, rank, _ = np.linalg.lstsq(X1, y, rcond=None)
    9. print("Frame-count coefficient, patches-per-frame coefficient, intercept:", coef)

    Small fitting residuals suggest that the observed token usage approximately follows this linear structure. If two services have closely matching coefficients and intercepts, their preprocessing parameters may be similar.

    This is still evidence of engineering similarity, not proof of model provenance. Many teams may choose the same general-purpose preprocessing parameters.

    6. Behavioral and API Clues

    Response style and API behavior can provide additional information, but they are less reliable.

    • Response style: Formatting preferences, refusal wording, and list structures under similar instructions may reflect similar post-training data. Distillation or system prompts can also reproduce these characteristics.
    • API behavior: Error codes, error-message structures, default parameters, and maximum output lengths reflect the serving implementation. Gateways and middleware can alter these signals as well.

    Behavioral clues are best used as supporting evidence rather than as the primary basis for attribution.

    7. Ranking the Strength of Evidence

    Classifying evidence by strength helps prevent overinterpretation.

    Evidence type Strength Interpretation
    Similar response style Weak Easily imitated through distillation or prompting
    A single matching tokenization result Moderate May also match other tokenization schemes
    Agreement across multiple independent clues Stronger Shared components must still be ruled out as a confounding factor
    Formal provider disclosure Strongest The only direct basis for accepting a provenance claim

    Several confounding factors deserve particular attention. Multiple model families may use similar tokenization schemes. The same open-source model may be deployed by different providers. Gateways may standardize request formatting across otherwise unrelated services.

    Fingerprint matches should therefore be interpreted as evidence of similarity, not confirmation of origin.

    8. Engineering Recommendations

    Teams that rely on model services over the long term can adopt the following practices:

    1. Maintain an internal evaluation set. Use a fixed collection of Chinese, English, code, and multimodal samples. Periodically record token usage, latency, and output consistency.
    2. Record complete request metadata. Preserve request parameters, returned usage fields, and timestamps for later review.
    3. Base compliance decisions on written disclosure. If model provenance is critical to compliance, request a written statement from the provider rather than relying on inference.
    4. Handle sensitive data cautiously. Avoid sending sensitive information or trade secrets to anonymous endpoints until the model’s origin and the service operator have been established.
    5. Distinguish the model from the service. Assess the responsibilities of the model developer, service operator, and intermediate gateway separately.

    9. Key Takeaways

    Token counts, fixed offsets, and multimodal preprocessing fingerprints are reproducible engineering observations. They help developers formulate hypotheses, but each has confounding factors when used alone.

    Test multiple independent clues together, distinguish model characteristics from service-layer behavior, and use formal provider disclosure as the final basis for provenance decisions.