[KongchangAI]
· 2 min read· 1,394 words

DistDNA: A New Method for LLM Fingerprinting under Stochastic Decoding

DistDNA: A New Method for LLM Fingerprinting under Stochastic Decoding

DistDNA identifies LLMs under stochastic decoding using prompt-conditioned response distributions and per-prompt MMD, improving accuracy by 10.36%.

This paper proposes DistDNA to tackle LLM behavioral fingerprinting under stochastic decoding. Deployed models often use unknown temperature and top-p, so the same model can produce different responses to the same prompt, defeating existing fingerprint representations like LLM DNA. DistDNA represents models as prompt-conditioned response distributions, compares them using per-prompt Maximum Mean Discrepancy (MMD), and assigns a tested model to the nearest known checkpoint's reference fingerprint without training a classifier. Theory shows finite-sampling variance decreases as O(1/R) with responses per prompt. On 115 checkpoint entries, DistDNA improves accuracy by 10.36% over the strongest baseline LLM DNA and is robust to unknown decoding settings.

Large language model (LLM) behavioral fingerprinting aims to identify a model by its responses to a shared set of prompts, thereby verifying whether a deployed model matches the claimed checkpoint. However, models in real-world deployment typically use stochastic decoding, meaning the same model may produce different responses to the same prompt depending on unknown temperature and top-p settings. Existing representations such as LLM DNA handle this variation only to a limited extent. A natural remedy is to characterize a model by its response distribution, but this introduces two challenges: first, each distribution must be estimated from only a small number of sampled responses; second, changes in decoding settings can affect responses to a degree comparable to changes in checkpoints. As a result, fingerprint distance alone is insufficient to determine model identity, and identification typically relies on a classifier jointly trained on fingerprints from multiple checkpoints. This paper proposes DistDNA, which represents a model by its prompt-conditioned response distributions and compares models using per-prompt Maximum Mean Discrepancy (MMD). A tested model is assigned to the known checkpoint whose reference fingerprint (collected under several decoding settings) is closest to it, without training a classifier. We show that finite sampling adds variance-related terms to the expected squared fingerprint distance, and these terms decrease at a rate of O(1/R) as the number of responses R increases. Experiments on 115 model checkpoint entries show that DistDNA improves identification accuracy by 10.36% over the strongest baseline, LLM DNA.

Fingerprinting Challenges Posed by Stochastic Decoding

The core idea of LLM behavioral fingerprinting is that each model's response pattern to specific prompts is unique, analogous to a human biometric fingerprint. However, the introduction of stochastic decoding causes the same model to produce diverse responses under different temperature or top-p settings, blurring the boundaries between models. Existing methods such as LLM DNA mainly focus on deterministic decoding or responses under fixed settings, making them ill-equipped to handle the noise introduced by changes in decoding parameters.

Specifically, the challenge manifests in two ways: first, the number of samples is limited, with very few response samples per prompt, leading to inaccurate distribution estimation; second, changes in decoding settings can make the differences between response distributions of the same model comparable to the differences between different models under the same setting, thereby confounding fingerprint distances. Therefore, comparing fingerprint distances alone cannot reliably identify models, and more robust representations and comparison methods are needed.

DistDNA method diagram

Temperature and top-p (nucleus sampling) in stochastic decoding are two key parameters controlling generation diversity. Temperature T scales the logits: when T<1 the distribution is sharper and outputs are more deterministic; when T>1 the distribution is flatter and outputs are more random. Top-p samples from the smallest set of words whose cumulative probability reaches p; the smaller p is, the narrower the candidate set. The combination of the two can significantly alter the response distribution of the same model to the same prompt: low temperature or small p tends toward deterministic outputs, while high temperature or large p expands the sampling space. Therefore, without controlling decoding settings, the response differences of the same checkpoint under different parameters may mask the differences between different checkpoints. This is precisely the fundamental reason why fingerprinting under stochastic decoding requires dedicated modeling of response distributions rather than merely comparing single responses.

DistDNA: A Fingerprinting Framework Based on Distributions and MMD

DistDNA represents a model as prompt-conditioned response distributions, i.e., for each prompt, the probability distribution of the model's generated responses. To compare two models, DistDNA computes the per-prompt Maximum Mean Discrepancy (MMD), a non-parametric distance metric used to measure the difference between two distributions. The advantage of MMD is that it can handle high-dimensional response spaces and is sensitive to the shape of distributions, rather than merely comparing means or variances.

The specific procedure is as follows: for the model to be identified, collect its responses under multiple decoding settings to build a reference fingerprint library; for an unknown model, similarly collect responses and compute its MMD distances to each reference fingerprint; finally, assign the unknown model to the nearest reference checkpoint. This method requires no classifier training, avoiding overfitting and generalization issues.

Theoretical analysis shows that finite sampling introduces variance-related terms into the expected squared fingerprint distance, and these terms decrease at a rate of O(1/R) with the number of responses R per prompt. This means that increasing the number of samples can improve identification stability, but it also increases computational cost. DistDNA effectively leverages limited samples through MMD to achieve more accurate identification.

MMD (Maximum Mean Discrepancy) is a non-parametric two-sample test statistic based on the Reproducing Kernel Hilbert Space (RKHS). Its core idea is: if two distributions are identical, their mean embeddings after mapping into the RKHS should also be identical; MMD measures the distance between these two mean embeddings. In practice it is estimated via a kernel function (such as a Gaussian kernel): MMD² = E[k(x,x')] + E[k(y,y')] - 2E[k(x,y)], where x, x' come from distribution P and y, y' come from distribution Q. MMD is sensitive to the overall shape of distributions and requires no assumption about the specific parametric form of the distributions, making it suitable for high-dimensional, multimodal response spaces. In DistDNA, per-prompt MMD means computing the MMD between the response distributions of the model to be identified and the reference model separately for each prompt, then aggregating across prompts, thereby leveraging both prompt specificity and the model's overall fingerprint.

LLM DNA is an earlier LLM behavioral fingerprint representation method. Its approach is to extract fixed-dimensional feature vectors (i.e., "DNA") from the model's responses to a shared set of prompts, and then match model identity through vector distances or a trained classifier. It is mainly designed for deterministic decoding or fixed decoding settings, and lacks explicit modeling of the response distribution perturbations caused by changes in temperature and top-p. The key difference of DistDNA is that it no longer compresses responses into a single feature vector, but instead preserves the response distribution under each prompt and directly compares distributions using MMD; at the same time, it eliminates classifier training and instead uses nearest reference fingerprint matching. This makes DistDNA more robust in few-shot, variable-decoding-setting scenarios, which is also the reason its accuracy surpasses LLM DNA in experiments.

Experimental Validation and Performance Improvement

Experiments on 115 model checkpoint entries show that DistDNA improves identification accuracy by 10.36% over the strongest baseline, LLM DNA. This improvement is mainly attributed to DistDNA's modeling of response distributions and the robustness of MMD distance to changes in decoding settings. The experiments cover a variety of stochastic decoding settings, validating the method's effectiveness under different combinations of temperature and top-p.

Compared with methods that require training a classifier, DistDNA's training-free nature makes it easier to deploy and scale, especially in scenarios where model checkpoints are frequently updated or added. In addition, DistDNA's reference fingerprint library can be pre-collected under multiple decoding settings, and identification only requires computing distances, resulting in high computational efficiency.

Conclusion and Outlook

DistDNA provides an effective solution for LLM fingerprinting under stochastic decoding, overcoming the limitations of traditional methods through distribution representation and MMD distance. Future work may further optimize sampling efficiency, explore more complex decoding settings, or extend the method to multimodal models. As LLM deployment becomes more widespread, reliable model identity verification technology will become increasingly important, and DistDNA has taken a solid step in this direction.

One-line Summary

DistDNA uses prompt-conditioned response distributions and per-prompt MMD to identify LLMs under stochastic decoding, improving accuracy by 10.36%.

Paragraph Summary

This paper proposes DistDNA to address the challenge of LLM behavioral fingerprinting under stochastic decoding. Deployed models often use stochastic decoding with unknown temperature and top-p, so the same model can produce different responses to the same prompt, rendering existing fingerprint representations such as LLM DNA ineffective. DistDNA represents a model as prompt-conditioned response distributions, compares models using per-prompt Maximum Mean Discrepancy (MMD), and assigns the model to be identified to the known checkpoint with the closest reference fingerprint, without training a classifier. Theoretical analysis shows that the variance term introduced by finite sampling decreases at a rate of O(1/R) with the number of responses R per prompt. On 115 model checkpoint entries, DistDNA improves identification accuracy by 10.36% over the strongest baseline LLM DNA and is robust to unknown decoding settings.

#LLM fingerprinting#DistDNA#stochastic decoding#Maximum Mean Discrepancy#LLM DNA#model identification
Share:

Related articles