REEF: Representation Encoding Fingerprints for Large Language Models

## Abstract

Abstract Protecting the intellectual property of open-source Large Language Models (LLMs) is very important, because training LLMs costs extensive computational resources and data. Therefore, model owners and third parties need to identify whether a suspect model is a subsequent development of the victim model. To this end, we propose a training-free REEF to identify the relationship between the suspect and victim models from the perspective of LLMs’ feature representations. Specifically, REEF computes and compares the centered kernel alignment similarity between the representations of a suspect model and a victim model on the same samples. This training-free REEF does not impair the model’s general capabilities and is robust to sequential fine-tuning, pruning, model merging, and permutations. In this way, REEF provides a simple and effective way for third parties and models’ owners to protect LLMs’ intellectual property together. The code is available at https://github.com/tmylla/REEF.

## 1 Introduction

The training process of Large Language Models (LLMs) requires extensive computational resources and time. Therefore, open-source models are usually released with specific licenses (*e.g.*, Apache2.0, and LLaMA 2 Community License (Meta AI, )) to protect their intellectual properties (IPs).
Unfortunately, some developers claim to have trained their own LLMs but actually wrapped or fine-tuned based on other base LLMs (e.g., Llama-2 and MiniCPM-V) (OpenBMB, ; 01-ai, ). It is urgent for model owners and third parties to identify whether the suspect model is a subsequent development of the victim model (e.g., Code-llama trained from Llama-2) or is developed from scratch (e.g., Mistral).

The key is to extract unique features (i.e., fingerprints) that can authenticate the victim model.
Watermarking methods artificially inject triggers into the victim model to make it generate specific content for identification (Peng et al., ; Xu et al., ).
However, watermarks introduce extra training costs and impair the model’s general capabilities (Russinovich & Salem, ), or even can be removed (Wang & Kerschbaum, ; Chen et al., ).
More crucially, these methods can not be applied to models that have already been open-released.
An alternative is to extract intrinsic features of the victim model, avoiding additional training and the compromise of capabilities.
Weight-based fingerprints are one of intrinsic features that allow calculating the similarity between a suspect model and a victim model’s weights for identification (Zeng et al., ; Refael et al., ).
However, these methods are fragile to major changes in weights, e.g., weight permutations, pruning, and extensive fine-tuning
(Fernandez et al., ; Xu et al., ).
This necessitates extracting more robust intrinsic features as fingerprints to identify victim models and protect their IPs.

In this paper, we propose to solve this problem from the perspective of the *feature representations* of LLMs, beginning with the following visualization analysis. It is generally acknowledged that
different models encode informative and intrinsic features based on their training data and model architecture, resulting in distinct feature representations across models (Mikolov et al., ; Bolukbasi et al., ; Karras et al., ; Chen et al., ; Zou et al., ).
Figure 1(a) illustrates that the representations of Llama are markedly distinct from those of Baichuan and Qwen, while largely comparable to its fine-tuned models (i.e., Llama-chat and Chinese-llama).

Such findings inspire us to construct representation-based fingerprints.
Specifically, we apply neural networks
to extract fingerprints of a victim model from its representation space. Figure 1(b) shows that the classifier trained on representations of a victim model (i.e., Llama) can be generalized to its variant models (e.g., Llama-chat and Vicuna), but fail to other models (e.g., Baichuan and Qwen).
Although the effectiveness of representation-based fingerprints has been validated, such fingerprints still have limitations.
On one hand, the input dimensions of neural networks are fixed, making them inapplicable to model pruning that alters the representation dimensions of the victim model (Frantar & Alistarh, ; Xia et al., ; ), which is prevalent in scenarios such as model compression for deployment on mobile devices.
On the other hand, these fingerprints lack robustness against representation permutations, a challenging issue because developers may intentionally manipulate model representations to evade detection (Zeng et al., ; Refael et al., ).

To this end, we propose a simple and effective approach, namely REEF, which is robust against pruning and evading detection. Specifically, REEF is a representation-based fingerprinting method that compares the Centered Kernel Alignment (CKA) similarity (Kornblith et al., ) between the representations of the same samples from a suspect model and a victim model. Experimental results indicate that models derived from the victim model exhibit high similarity.
Moreover, REEF is resilient to dimensional changes, and we theoretically prove that CKA is invariant to column-wise permutations and scaling transformations.
Figure 1(c) demonstrates that REEF maintains its effectiveness even under extreme conditions that cause weight-based methods (Zeng et al., ) ineffective. These conditions include extensive fine-tuning (using data with up to 700B tokens (Azerbayev et al., )), a high ratio pruning (up to 90% of parameters (Ma et al., )), model merging (merging LLMs with different architectures (Wan et al., )), and permutations (parameter vector direction change through weight rearrangements (Fernandez et al., )).

Figure: Figure 1: (a) t-SNE visualization of different LLMs’ representations on the same samples. (b) Performance of classifiers trained on representations from the victim model evaluated on suspect models. (c) Robustness of REEF under variant LLMs that cause ICS (Zeng et al., ) ineffective.
Refer to caption: x1.png

REEF utilizes the intrinsic feature from the perspective of representations to identify whether a suspect model is derived from a victim model. This training-free REEF does not impair model’s general capabilities and is robust to various subsequent developments compared to weight-based fingerprints and watermarks.
Consequently, REEF is a promising method for protecting the IPs of model owners and provides an efficient and effective way for third parties to review models, combating unethical or illegal activities such as unauthorized use or reproduction.

## 2 Related Work

Model fingerprinting protects IPs by allowing model owners and third parties to authenticate model ownership. There are two types of fingerprints for LLMs. One is injected fingerprints, which are artificially added during training or fine-tuning to facilitate model identification, such as watermarking methods (Peng et al., ; Xu et al., ). The other is intrinsic fingerprints, which are inherent properties that naturally emerge from the models’ training data and architectures, including model weights (i.e., parameters) and feature representations, also known as embeddings or activations.

##### Injected Fingerprint.

Watermarking methods inject a backdoor trigger into a victim model so that it will generate specific content in the presence of this trigger, allowing identification of whether a suspect model derives from the victim model.
A large number of approaches embed the watermarks through backdoor attacks (Adi et al., ; Zhang et al., ; Li et al., ), and digital signature technology and hash functions (Guo & Potkonjak, ; Li et al., ; Zhu et al., ) are also used to design trigger words that contain the owner’s identity information to protect the IPs of DNNs.
For generative language models, the high computational resource and time costs of training pose an urgent need to protect their IPs. Researchers have proposed various methods to inject watermarks as fingerprints to identify the victim model (Li et al., ; Peng et al., ; Kirchenbauer et al., ; Zhao et al., ; Russinovich & Salem, ; Xu et al., ), but such methods inevitably impair the model’s overall performance.

##### Intrinsic Fingerprint.

Such fingerprints use the inherent and native attributes of the victim model, without requiring additional tuning which could impair the model’s general capabilities, and are more stable and can not be removed.
Model weights are one of the intrinsic features that can be used to compute the similarity of parameters between a suspect model and a victim model for identification (Zeng et al., ; Refael et al., ).
Semantic analysis methods conduct statistical analysis on the content generated by different models, exploiting the linguistic patterns and semantic preferences exhibited by various LLMs as their unique fingerprints (Iourovitski et al., ; Pasquini et al., ; McGovern et al., ).
However, both methods suffer from insufficient robustness (Xu et al., ).
The internal representations of LLMs are derived from the data, strategies, and frameworks used during the training process, and serve as intrinsic features for model identification (Sevastjanova et al., ). For example, the logits space can be leveraged to identify the victim model (Yang & Wu, ). However, this approach remains highly sensitive to parameter permutation, posing significant challenges for effective fingerprinting.

## 3 Exploring the Potential of Feature Representations as Fingerprints

In this section, we propose to utilize *feature representations* as LLM fingerprints to identify whether a suspect model is a subsequent development of the victim model, based on the following two observations. (1) Feature representations of fine-tuned victim models are similar to feature representations of the original victim model, while the feature representations of unrelated models exhibit distinct distributions, as shown in Figure 1(a). (2) Some high-level semantic concepts are “linearly” encoded in the representation space of LLMs and can be easily classified, such as safety or unsafety and honest or dishonest (Zou et al., ; Slobodkin et al., ; Qian et al., ).
According to these two observations, we can train a binary classifier on the representations of the victim model and then apply it to various suspect models’ representations, *i.e.,* LLMs derived from the victim model and unrelated LLMs. In this way, such a classifier may generalize to different fine-tuned victim models, because they have similar feature representations.

The binary classifier can employ various Deep Neural Network (DNN) architectures, such as a linear classifier, Multi-Layer Perceptron (MLP), Convolutional Neural Network (CNN), and Graph Convolutional Network (GCN). For training, we use the TruthfulQA dataset (Lin et al., ), concatenating each question with its truthful answer as positive samples and with its false answer as negative samples. The dataset is split into training and test sets with a 4:1 ratio.
To evaluate the classifier’s performance, we conduct experiments on LLMs of varying sizes. Specifically, we select Llama-2-7b and Llama-2-13b as the victim models, while derived models and unrelated LLMs serve as suspect models for comparison.

##### Classifiers trained on representations of a victim model can effectively generalize to its variants but not to others.

Figure 2(a) shows that a classifier trained on the 18th layer representation of Llama-2-7b achieves approximately 80% classification accuracy when applied to its fine-tuned models (e.g., Chinese-llama-2-7b). However, the accuracy drops to around 50% on unrelated models (e.g., Mistral-0.1-7b), which is close to the level of random guessing.
Classifiers trained on representations from other layers show the same results, as discussed in Appendix B.
Additionally, similar findings are observed for Llama-2-13b (Figure 2(b)), indicating the scalability of the representation-based fingerprints. These experimental results indicate that representations can serve as fingerprints to protect the victim model’s IP.

Challenges to using the classifier for victim model identification: (1) DNNs have fixed input dimensions and cannot be applied to models pruned from the victim model, e.g., reducing representation dimensions. For example, the pruned models Sheared-llama-1.3b and Sheared-llama-2.7b have dimensions of 2048 and 2560, respectively (Xia et al., ). However, the classifier trained on Llama-2-7b can only process inputs of 4096 dimensions. (2) DNNs are not robust to permutations of the input feature representations, such as when columns are permuted through coupled matrix multiplications, which malicious developers might use to evade detection (Fernandez et al., ).

Figure: Figure 2: Accuracies of classifiers trained on representations from the victim model: (a) Llama-2-7b as the victim model, (b) Llama-2-13b as the victim model.
Refer to caption: x2.png

## 4 Robust Representation-based Fingerprinting with REEF

To address the challenges of classifiers in victim model identification, we propose REEF, an advanced representation-based fingerprinting approach that can adapt to suspect models with varying representation dimensions and is robust to representation permutations.

REEF identifies whether a suspect model is derived from a victim model, given the representations of these two models on certain examples. Specifically, let $X\in\mathbb{R}^{m\times p_{1}}$ denote activations of the $l$-th layer from the suspect model on $m$ examples and $Y\in\mathbb{R}^{m\times p_{2}}$ denotes activations of the $l^{{}^{\prime}}$-th layers from the victim model on the same $m$ examples, where $p_{1}$ is independent of $p_{2}$, meaning there is no limitation on dimensional consistency. Therefore, we need a similarity index $s(\cdot,\cdot)$ to measure representations’ similarity between the suspect and victim models. In this way, a high $s(X,Y)$ score indicates that the suspect model is more likely derived from the victim model. In contrast, a low $s(X,Y)$ score means that the suspect model is less likely derived from the victim model.

##### Centered Kernel Alignment.

CKA (Kornblith et al., ) is a similarity index based on Hilbert-Schmidt Independence Criterion (HSIC) (Gretton et al., ), which measures the independence between two sets of random variables. The CKA similarity between $X$ and $Y$ can be computed as follows

$$ $\displaystyle\text{CKA}(X,Y)=\frac{\text{HSIC}(X,Y)}{\sqrt{\text{HSIC}(X,X) \cdot\text{HSIC}(Y,Y)}},$ (1) $$

where $\text{HSIC}(X,Y)=\frac{1}{(m-1)^{2}}\text{tr}(K_{X}HK_{Y}H)$. Specifically, $H=I-\frac{1}{m}\mathbf{1}\mathbf{1}^{\text{T}}$ is a centering matrix. $K_{X}$ and $K_{Y}$ are Gram matrices that measure the similarity of a pair
of examples based on kernel function $k$, i.e., $(K_{X})_{ij}=k(X_{i},X_{j})$ and $(K_{Y})_{ij}=k(Y_{i},Y_{j})$. $X_{i}$ and $X_{j}$ denote the $i$-th and $j$-th row of $X$, respectively.

##### Kernel Selection.

In this study, we consider a linear kernel and a Radial Basis Function (RBF) kernel. In the linear kernel case, Gram matrix $K_{X}=XX^{\top}$. In the RBF kernel case, $k(X_{i},X_{j})=\exp(-||X_{i}-X_{j}||_{2}^{2}/(2\sigma^{2}))$. Empirically, we discover that linear and RBF kernels obtain similar experimental results. Please see Section 5.1 for more discussions. Unless otherwise specified, we adopt linear CKA due to its high efficiency.

###### Theorem 1

(Proof in Appendix A) Given two matrices $X\in\mathbb{R}^{m\times p_{1}}$ and $Y\in\mathbb{R}^{m\times p_{2}}$, the CKA similarity score between $X$ and $Y$ is invariant under any permutation of the columns and column-wise scaling transformation. Formally, we have:

$$ $\text{CKA}(X,Y)=\text{CKA}(XP_{1},YP_{2})=\text{CKA}(c_{1}X,c_{2}Y)$ (2) $$

where $P_{1}\in\mathbb{R}^{p_{1}\times p_{1}}$ and $P_{2}\in\mathbb{R}^{p_{2}\times p_{2}}$ denote permutation matrices. $c_{1}\in\mathbb{R}^{+}$ and $c_{2}\in\mathbb{R}^{+}$ are two positive scalars.

Theorem 1 indicates that the CKA similarity score is theoretically invariant and robust to any column-wise permutations and scaling transformations.
Kornblith et al. () have shown that CKA is able to the correspondence between representations of different dimensions. Therefore, REEF is highly robust to various subsequent developments of the victim model in practical scenarios, including model pruning and representation permutation, ensuring accurate identification of the victim model through representation-based fingerprints to protect its IP.

###### Theorem 1

## 5 Experiments

In this section, we provide a comprehensive evaluation of REEF. Section 5.1 evaluates REEF’s effectiveness in distinguishing LLMs derived from the victim model from unrelated models. Following this, Section 5.2 assesses REEF’s robustness to subsequent developments of the victim model, such as fine-tuning, pruning, merging, and permutations. Section 5.3 presents ablation studies on REEF across varying sample numbers and datasets. Finally, Section 5.4 discusses REEF’s sensitivity to training data and its capacity for adversarial evasion.

### 5.1 Effectiveness Verification

In this subsection, we demonstrate that REEF can effectively model the fingerprint from the representation. The CKA similarity between the victim model’s representations and those of its derived models, as well as unrelated models, shows significant differences. This makes REEF a reliable fingerprinting method for protecting the victim model’s IP.

Settings.
For the LLMs, we select Llama-2-7b as the victim model and choose a range of suspect models, including quantization and fine-tuned variants of Llama-2-7b (e.g., Llama-2-7b-chat, Code-llama-7b, and Llama-2-7b-4bit) as well as unrelated models (e.g., Qwen-1.5-7b, Baichuan-2-7b, and Mistral-7b). We use both a linear kernel and an RBF kernel to compute the layer-wise and inter-layer CKA similarity of representations between the victim and suspect models on 200 samples from the TruthfulQA dataset (Lin et al., ).
The resulting heatmap is shown in Figure 3.

Figure: Figure 3: Heatmaps depicting the CKA similarity between the representations of the victim LLM (Llama-2-7B) and those of various suspect LLMs on the same samples.
Refer to caption: x3.png

REEF can accurately distinguish between models derived from the victim model and unrelated models.
As shown in Figure 3, for LLMs derived from the victim model, the CKA similarity with the victim model is high, whereas unrelated LLMs show low similarity. This is reflected in the marked color contrast between the first two rows and the third row of the heatmap.
To quantify these results, the average similarity of LLMs derived from the victim model is 0.9585, which is substantially higher than that of unrelated LLMs, whose average similarity is 0.2361.
Additionally, for LLMs derived from the victim model, the similarity is notably high along the diagonal of the heatmaps, which represents the similarity between corresponding layers of the victim and suspect models, with an average of 0.9930. Furthermore, the inter-layer similarity is also significant, reaching 0.9707.

Linear and RBF kernels yield similar results in identifying whether a suspect model is derived from the victim model.
As shown in the first two rows of Figure 3, the CKA similarity between the victim model and the LLMs derived from it, calculated using both the linear and RBF kernels, exceeded 0.95. This demonstrates that both kernels are suitable for fingerprinting in REEF. We adopt the linear CKA due to its higher computational efficiency.

CKA from a single layer is sufficient for fingerprint identification.
The similarities between representations on a specific layer of the victim model and those of the derived and unrelated models differ significantly (e.g., 0.9973 and 0.2223 for layer 18, respectively). Consequently, we focus on reporting the similarity at layer 18 in subsequent experiments, due to its informativeness and efficiency. The complete heatmap results are provided in Appendix C.

### 5.2 Robustness Verification

In this subsection, we apply REEF to suspect models that are developed from a victim model through fine-tuning, pruning, merging, permutations, and scaling transformations. These techniques can introduce significant changes to the model’s structure or parameters, making it challenging for existing methods to identify the victim model. However, REEF remains effective in these scenarios, demonstrating its robustness.

#### 5.2.1 Baseline Methods

Weight-based Fingerprinting Methods.
Following Zeng et al. (), we use model weight similarity methods, including PCS and ICS, to identify whether a suspect model is derived from a victim model. Specifically, PCS flattens all weight matrices and biases of an LLM into vectors and directly compares the cosine similarity between these vectors for the two models.
ICS constructs invariant terms from the weights of the last two layers and calculates the cosine similarity between these invariant terms for the two models.
A high cosine similarity indicates that the suspect model is derived from the victim model, and vice versa.

Representation-based Fingerprinting Methods.
Yang & Wu (), referring to the Logits method, implements LLM fingerprinting by analyzing unique attributes of each LLM’s logits output. This method evaluates the similarity between the output spaces of the victim and suspect models. A high similarity suggests that the suspect model is derived from the victim model. We conduct experiments on the TruthfulQA dataset to extract logit output for the suspect models.

**Table 1: Similarity of various LLM fingerprinting methods applied to suspect models developed through fine-tuning, pruning, merging, permutations, and scaling transformations. In this table, xx indicate similarity greater than 0.8, xx indicate similarity between 0.5 and 0.8, and xx indicate similarity less than 0.5.**
|  | Model Fine-tuning |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
|  | Llama-2-finance-7b<br>(5M Tokens) | Vicuna-1.5-7b<br>(370M Tokens) | Wizardmath-7b<br>(1.8B Tokens) | Chinesellama-2-7b<br>(13B Tokens) | Codellama-7b<br>(500B Tokens) | Llemma-7b<br>(700B Tokens) |
| PCS | 0.9979 | 0.9985 | 0.0250 | 0.0127 | 0.0105 | 0.0098 |
| ICS | 0.9952 | 0.9949 | 0.9994 | 0.4996 | 0.2550 | 0.2257 |
| Logits | 0.9999 | 0.9999 | 0.9999 | 0.7033 | 0.7833 | 0.6367 |
| REEF | 0.9950 | 0.9985 | 0.9979 | 0.9974 | 0.9947 | 0.9962 |
|  | Structured  Pruning |  |  |  |  |  |
|  | Sheared-llama-<br>1.3b-pruned | Sheared-llama-<br>1.3b | Sheared-llama-<br>1.3b-sharegpt | Sheared-llama-<br>2.7b-pruned | Sheared-llama-<br>2.7b | Sheared-llama-<br>2.7b-sharegpt |
| PCS | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 |
| ICS | 0.4927 | 0.3512 | 0.3510 | 0.6055 | 0.4580 | 0.4548 |
| Logits | 0.9967 | 0.9999 | 0.9999 | 0.9967 | 0.9999 | 0.9999 |
| REEF | 0.9368 | 0.9676 | 0.9710 | 0.9278 | 0.9701 | 0.9991 |
|  | Unstructured  Pruning | Distribution Merging (Fusechat-7b) |  |  |  |  |
|  | Sparse-llama-<br>2-7b | Wanda-llama-<br>2-7b | GBLM-llama-<br>2-7b | Internlm2-chat-<br>20b | Mixtral-8x7b-<br>instruct | Qwen-1.5-chat-<br>72b |
| PCS | 0.9560 | 0.9620 | 0.9616 | 0.0000 | 0.0000 | 0.0000 |
| ICS | 0.9468 | 0.9468 | 0.9478 | 0.1772 | 0.0105 | 0.0635 |
| Logits | 0.9999 | 0.9999 | 0.9999 | 0.0000 | 0.0000 | 0.0000 |
| REEF | 0.9985 | 0.9986 | 0.9991 | 0.9278 | 0.9701 | 0.9991 |
|  | Weight Merging (Evollm-jp-7b) | Distribution Merging(Fusellm-7b) |  |  |  |  |
|  | Shisa-gamma-7b-v1 | Wizardmath-7b-1.1 | Abel-7b-002 | Llama-2-7b | Openllama-2-7b | Mpt-7b |
| PCS | 0.9992 | 0.9990 | 0.9989 | 0.9997 | 0.0194 | 0.0000 |
| ICS | 0.9992 | 0.9988 | 0.9988 | 0.1043 | 0.2478 | 0.1014 |
| Logits | 0.9933 | 0.9999 | 0.9999 | 0.9999 | 0.0100 | 0.0000 |
| REEF | 0.9635 | 0.9526 | 0.9374 | 0.9996 | 0.6713 | 0.6200 |
|  | Permutation | Scaling Transformation |  |  |  |  |
|  | Llama-2-7b | Mistral-7b | Qwen-1.5-7b | Llama-2-7b | Mistral-7b | Qwen-1.5-7b |
| PCS | 0.0000 | 0.0000 | 0.0000 | 0.9999 | 0.9989 | 0.9999 |
| ICS | 0.1918 | 0.9847 | 0.9912 | 0.9999 | 0.9999 | 0.9998 |
| Logits | 0.0000 | 0.0000 | 0.0000 | 0.9999 | 0.9999 | 0.9999 |
| REEF | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |

#### 5.2.2 Fine-tuning

Xu et al. () point out that weight-based fingerprints are not reliable when models undergo extensive fine-tuning with larger deviations in parameters.
Given this challenge, we seek to assess the robustness of REEF under such demanding scenarios.

Settings.
We use Llama-2-7b as the victim model and select a diverse set of its fine-tuned models as suspect models, with fine-tuning (FT) data volumes ranging from 5 million to 700 billion tokens. The suspect models include Llama-2-finance-7b, Vicuna-1.5-7b, Wizardmath-7b, Chinese-llama-2-7b, Code-llama-7b, and Llemma-7b, with each model’s fine-tuning data volume being 5M, 370M, 1.8B, 13B, 500B, and 700B tokens, respectively (Chiang et al., ; Luo et al., ; Cui et al., ; Roziere et al., ; Azerbayev et al., ).

REEF is robustness to extensive fine-tuning.
As shown in Table 1, even for models fine-tuned on datasets with up to 700B tokens (i.e., Llemma-7B), REEF still achieves a high similarity of 0.9962. In contrast, PCS becomes ineffective as early as fine-tuning with 1.8B tokens (i.e., Wizardmath-7b). ICS performance significantly degrades with increasing fine-tuning data volume, with 13B tokens (i.e., Chinese-llama-2-7b) and 500B tokens (i.e., Code-llama-7B) yielding similarity of 0.4996 and 0.2550, respectively. Although the Logits method shows relatively less degradation, it still exhibits sensitivity to the volume of fine-tuning data. Notably, Logits method is particularly sensitive to changes in the vocabulary, e.g., Chinese-llama-2-7b has expanded its vocabulary during fine-tuning, yielding a lower similarity than Code-llama-7b (0.7033 vs 0.7833), despite being fine-tuned on a smaller dataset (13B vs 500B tokens).

Discussion about how much fine-tuning data could make REEF ineffective.
Despite fine-tuning Llama-2-7b to Llemma-7b with 700B tokens (Azerbayev et al., ), the fine-tuning data is one-third of Llama-2-7b’s 2T token pre-training data, yet REEF remains effective. We question whether REEF would remain effective with continued increases in fine-tuning data.
Before delving into this discussion, two statements are listed: (1) To the best of our know, Llemma-7b is the most extensively fine-tuned Llama-2-7b model, nearly 700B tokens for fine-tuning, and REEF has shown robustness in this context; (2) Code-llama-7b (Roziere et al., ) reports that fine-tuning with 500B tokens requires 4.4T of disk size and 25,000 GPU hours, fine-tuning on this scale is costly.
Such a considerable cost limits further extensive fine-tuning. REEF appears effective in current fine-tuning scenarios.

#### 5.2.3 Model Pruning

Pruning is widely used in model compression for edge deployment, e.g., serving for mobile devices and autonomous driving (Vadera & Ameen, ; Wang et al., ; Lin et al., ). However, pruning could significantly alter both the structural integrity and representation dimensions of models (Ma et al., ; Frantar & Alistarh, ; Zhu et al., ), posing challenges for fingerprint identification. To this end, we test REEF on various pruned models of the victim model Llama-2-7b.

Settings.
We use Llama-2-7b as the victim model and various pruned models of it as suspect models. First, we select several pruned models using different pruning strategies, including structured pruning (e.g.Sheared-llama (Xia et al., )), and unstructured pruning (e.g., SparseGPT (Frantar & Alistarh, ), GBLM-Pruner (Das et al., ), and Wanda (Sun et al., )). These methods prune the models at specific ratios, followed by post-training (e.g., continued pre-training or instruction-tuning) to ensure the pruned models maintain their capabilities. Second, we apply LLM-Pruner (Ma et al., ) to prune Llama-2-7b into smaller suspect models at arbitrary pruning ratios, without post-training. For example, we apply block pruning to reduce Llama-2-7b’s parameters by 10% to as much as 90%, and layer pruning to reduce the number of layers by 3 to as much as 27.

REEF is robust to various pruning strategies.
As shown in Table 1, for structured pruned models, REEF consistently achieves accurate fingerprint identification across all Sheared-llama models, with similarities exceeding 0.9278. In contrast, PCS fails in this scenario, consistently yielding a similarity score of zero. ICS does not perform well, e.g., the similarity for the 1.3B pruned model drops to 0.3512. The Logits method, which relies on the output space, remains unaffected unless the pruning alters the logits themselves.
For unstructured pruned models, all methods are capable of identifying the victim model, with all similarities exceeding 0.94. In summary, REEF and the Logits method remain robust across all pruned models.

Figure: Figure 4: (a)-(c) Similarity between pruned models and the victim model across three pruning strategies at various pruning ratios. (d) Perplexity of the three pruning strategies.
Refer to caption: x4.png

REEF is robustness to pruning ratio, even up to 90%.
Figure 4 shows that REEF remains effective even with significant pruning, including block pruning of up to 90% of parameters, layer pruning of up to 27 layers, and channel pruning of up to 60%. Figure 4(d) illustrates that perplexities are particularly high in these scenarios, especially with 60% channel pruning. As noted by Ma et al. (), channel pruning affects all layers, but the first and last layers are critical for maintaining model integrity, thus pruning is limited to 60%.
In contrast, PCS fails in all pruning scenarios, and ICS’s effectiveness diminishes as the pruning ratio increases, ultimately failing under layer pruning. These findings highlight REEF as the most robust and reliable method for fingerprint identification across various pruning ratios.

#### 5.2.4 Model Merging

Model merging is an effective technique that merges multiple separate models with different capabilities to build a universal model without needing access to the original training data or expensive computation (Yang et al., ).
Differing from other sections, the merged model is derived from several victim models, which pose a challenge in identifying all of them. In this subsection, we study two types of model merging: weight-based and distribution-based.

Settings.
For weight merging, we select Evollm-jp-7b (Akiba et al., ) as the suspect model, which merges three victim models with the same architecture (i.e., Shisa-gamma-7b-v1, Wizardmath-7b-1.1, and Abel-7b-002) by weighted parameters. For distribution merging, we choose Fusellm-7b (Wan et al., ) and Fusechat (Wan et al., ) as suspect models, respectively. Fusellm-7b merges three victim LLMs with distinct architectures but with same scale: Llama-2-7b, Openllama-2-7b, and Mpt-7b. Fusechat merges several chat LLMs of varied architectures and scales, we investigate Internlm2-chat-20b, Mixtral-8x7b-instruct, and Qwen-1.5-chat-72b as suspect models.

REEF is robust across both weight and distribution merging scenarios.
For weight merging, REEF consistently achieves high accuracy in identifying the origins of merged models, with similarities ranging from 0.9526 to 0.9996, as shown in Table 1. ICS, PCS, and the Logits method also perform well in this scenario.
For distribution merging at the same scales (i.e., Fusellm-7b), REEF continues to perform well, accurately identifying the victim model Llama-2-7b with a similarity of 0.9996. Additionally, it remains effective for Openllama-2-7b and Mpt-7b, with similarities of 0.6713 and 0.62, respectively. However, ICS struggles significantly in this scenario, with all three original victim models achieving low similarities. Although PCS and the Logits method can identify Llama-2-7b, their performance drops sharply for Openllama-2-7b and Mpt-7b, with similarities of nearly 0.
For distribution merging at the different scales (i.e., Fusechat-7b), REEF is the only method that continues to work for identifying victim models, while the other methods fail, demonstrating its consistent reliability in this scenario.
Based on these findings, REEF is robust across various merging strategies and can identify all victim models for the merged model.

#### 5.2.5 Permutation and Scaling Transformation

There are approaches that could camouflage the model without changing its architecture or affecting its output (Zeng et al., ). Malicious developers may modify the model by employing dimension permutation or coupled matrix multiplications to evade some fingerprint detection methods (Fernandez et al., ). This section aims to experiment with the robustness of various fingerprinting methods in addressing this type of evasion.

Settings.
We select Llama-2-7b, Mistral-7b, and Qwen-1.5-7b as victim models, applying column-wise permutations or scaling transformations (with a scaling factor of 0.8) to both their weight matrices and feature representations. These operations simulate evasion techniques that malicious developers might use, enabling us to compare the similarities of the weights and representations before and after the operations.

REEF is invariant and robust to any column-wise permutations and scaling transformations, as proved by the Theorem 1.
As shown in Table 1, the CKA similarity computed by REEF remains consistently at 1 before and after the permutation or scaling transformations, indicating that REEF is invariant to these operations and robust against evasion techniques. However, other methods such as ICS, PCS, and Logits, while robust to scaling transformations, exhibit a significant drop in similarity under permutation, with values nearly dropping to 0. These results further reinforce that REEF is a highly reliable fingerprinting method in practical applications against malicious developers.

### 5.3 Ablation Study

Number of Samples
To evaluate the impact of sample number on the performance of REEF, we conduct an ablation study using samples from TruthfulQA, ranging from 10 to 1000 in intervals of 10. We use Llama-2-7b as the victim model and select 10 suspect models, consisting of 5 LLMs derived from Llama-2-7b and 5 unrelated LLMs.
We then calculate the CKA similarity between the sample representations of each suspect model and those of Llama-2-7b at different sample numbers. Figure 5(a) illustrates the similarities for various models as the number of samples increases.

Figure: Figure 5: Illustration of the CKA similarity between the representations of the victim LLM (Llama-2-7B) and various suspect LLMs across different datasets as sample number increases.
Refer to caption: x5.png

REEF is highly efficient regarding the number of samples required for robust model fingerprinting.
Figure 5(a) shows that the similarities for most models stabilize after 200-300 samples, suggesting that REEF can achieve reliable fingerprint identification with a smaller sample number. Notably, LLMs derived from Llama-2-7b (e.g., Chinese-lama-2-7b and Code-llama-7b) consistently maintain high similarities close to 1.0 across all sample numbers. This indicates that these models potentially share the same representation space as the victim model, verifying that representation is an intrinsic feature for fingerprinting.
In contrast, unrelated LLMs (e.g., Qwen-7b-v1.5 and Mistral-7b) exhibit lower similarities that gradually decrease and stabilize at levels below 0.2 as the number of samples increases. This suggests that these models are more distinct and require a larger number of samples for accurate fingerprinting.
Overall, few samples from TruthfulQA are effective for REEF in identifying LLMs derived from the victim model compared to unrelated LLMs.

Different Datasets
To assess the effectiveness of REEF across various data types, we also conduct experiments using SST2 (Socher et al., ), ConfAIde (Mireshghallah et al., ), PKU-SafeRLHF (Ji et al., ), and ToxiGen (Hartvigsen et al., ). Following the same settings described in the previous section, we plot the similarities between the victim model and various suspect models for different datasets as the number of samples increases, as shown in Figure 5(b)-(e).

REEF is effective across various datasets.
Figure 5(b)-(e) show that the similarity between the victim model and its derived LLMs is significantly higher than the similarity with unrelated LLMs across different datasets. This clear distinction demonstrates that REEF can effectively identify whether a suspect model is derived from the victim model.
Furthermore, the gap in the similarity between derived LLMs and unrelated LLMs varies by dataset, e.g., the gap is approximately 0.8 on TruthfulQA and about 0.5 on ToxiGen. A larger gap indicates a stronger identification capability. Our findings suggest that while REEF is effective across diverse datasets, TruthfulQA emerges as the optimal choice for model fingerprinting, as it exhibits the most substantial differentiation in similarity between LLMs derived from the victim model and unrelated LLMs.

### 5.4 Further Discussion

Figure: Figure 6: Heatmaps depicting the CKA similarity between the representations of paired LLMs with the same architecture but different pre-training data.
Refer to caption: x6.png

REEF can distinguish between models with the same architecture but different pre-training data.
Openllama-7b (Geng & Liu, ) and Amber (Liu et al., ) are open-source LLMs that utilize the same Llama architecture but are trained from scratch on distinct pre-training datasets.
Figure 6 demonstrates that REEF effectively identifies the differences between Llama-2-7b and both Openllama-7b and Amber, as evidenced by their low similarities.
Additionally, similar results are observed when analyzing LLMs across different generations, such as Llama-2-7b versus Llama-3-8b, and Internlm-7b versus Internlm2-7b. Each of these models reflects variations in pre-training data and strategies, which REEF accurately identifies.

Malicious developers fail to fine-tune models with a customized loss function to evade detection by the REEF.
We assume these developers are aware of the REEF approach and attempt to design customized loss functions during fine-tuning to bypass detection. Since REEF relies on the observation that developed LLMs share similar representational spaces with the victim model. The developer may use the customized loss function to widen the gap between the two representations. Experimental results in Appendix D indicate that such fine-tuning seriously damage the model’s general capabilities and renders the fine-tuned models unusable. This is because the capabilities of LLMs stem from their representational distribution, and such intentional fine-tuning inevitably leads to the model losing its language modeling ability. Therefore, malicious developers are unable to evade REEF detection through this method.

## 6 Conclusion

This paper proposes REEF, a robust representation-based fingerprinting method for LLMs, which effectively identifies models derived from victim models. REEF does not impair LLMS’s general capability and remains resilient against various subsequent developments, including pruning, fine-tuning, merging, and permutations. Therefore, REEF is highly suitable for protecting model IPs for both third parties and model owners, as a reliable solution for safeguarding models from unauthorized use or reproduction.

#### Reproducibility Statement

To ensure the reproducibility of this study, we have uploaded the source code as part of the supplementary material. Furthermore, the code and datasets will be made available on GitHub after the completion of the double-blind review process, enabling others to replicate our study.

## Appendix A Proof for Theorem 1

###### Theorem 1

Given two matrices $X\in\mathbb{R}^{m\times p_{1}}$ and $Y\in\mathbb{R}^{m\times p_{2}}$, the CKA similarity score between $X$ and $Y$ is invariant under any permutation of the columns and column-wise scaling transformation. Formally, we have:

$$ $\text{CKA}(X,Y)=\text{CKA}(XP_{1},YP_{2})=\text{CKA}(c_{1}X,c_{2}Y)$ (1) $$

where $P_{1}\in\mathbb{R}^{p_{1}\times p_{1}}$ and $P_{2}\in\mathbb{R}^{p_{2}\times p_{2}}$ denote permutation matrices. $c_{1}\in\mathbb{R}^{+}$ and $c_{2}\in\mathbb{R}^{+}$ are two positive scalars.

Proof.

###### Theorem 1

### A.1 Case 1: Permutation Invariance

For Linear CKA, the Gram matrices of $X$ and $Y$ are $K_{X}=XX^{\top}$ and $K_{Y}=YY^{\top}$, respectively.

In this way, we have

$$ $\displaystyle K_{XP_{1}}=(XP_{1})(XP_{1})^{\top}=X\underbrace{P_{1}P_{1}^{\top }}_{=I}X^{\top}=XX^{\top}=K_{X}.$ (2) $$

Since $P_{1}$ is an orthogonal permutation matrix, thus $P_{1}P_{1}^{\top}=I$.

Similarly, we have

$$ $\displaystyle K_{YP_{2}}=(YP_{2})(YP_{2})^{\top}=Y\underbrace{P_{2}P_{2}^{\top }}_{=I}Y^{\top}=YY^{\top}=K_{Y}.$ (3) $$

According to (Gretton et al., ),

$$ $\displaystyle\text{HSIC}(X,Y)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(K_{X}HK_{Y}H)$ $\displaystyle=\underbrace{\frac{1}{(m-1)^{2}}\text{tr}(K_{XP_{1}}HK_{Y}H)}_{ \text{HSIC}(XP_{1},Y)}$ $\displaystyle=\underbrace{\frac{1}{(m-1)^{2}}\text{tr}(K_{X}HK_{YP_{2}}H)}_{ \text{HSIC}(X,YP_{2})}$ $\displaystyle=\underbrace{\frac{1}{(m-1)^{2}}\text{tr}(K_{XP1}HK_{YP_{2}}H)}_{ \text{HSIC}(XP_{1},YP_{2})}$ (4) $$

Thus, we have

$$ $\text{HSIC}(X,Y)=\text{HSIC}(XP_{1},Y)=\text{HSIC}(X,YP_{2})=\text{HSIC}(XP_{1 },YP_{2}).$ (5) $$

Taking Eq.5 into Eq. 1, we have

$$ $\displaystyle\text{CKA}(X,Y)$ $\displaystyle=\frac{\text{HSIC}(X,Y)}{\sqrt{\text{HSIC}(X,X)\cdot\text{HSIC}(Y ,Y)}}$ $\displaystyle=\underbrace{\frac{\text{HSIC}(XP_{1},Y)}{\sqrt{\text{HSIC}(XP_{1 },XP_{1})\cdot\text{HSIC}(Y,Y)}}}_{\text{CKA}(XP_{1},Y)}$ $\displaystyle=\underbrace{\frac{\text{HSIC}(X,YP_{2})}{\sqrt{\text{HSIC}(X,X) \cdot\text{HSIC}(YP_{2},YP_{2})}}}_{\text{CKA}(X,YP_{2})}$ $\displaystyle=\underbrace{\frac{\text{HSIC}(XP_{1},YP_{2})}{\sqrt{\text{HSIC}( XP_{1},XP_{1})\cdot\text{HSIC}(YP_{2},YP_{2})}}}_{\text{CKA}(XP_{1},YP_{2})}$ (6) $$

Finally, we obtain

$$ $\text{CKA}(X,Y)=\text{CKA}(XP_{1},Y)=\text{CKA}(X,YP_{2})=\text{CKA}(XP_{1},YP _{2})$ (7) $$

For RBF CKA, the RBF kernel function is

$$ $\displaystyle k(X_{i},X_{j})$ $\displaystyle=\exp\left(-\frac{\|X_{i}-X_{j}\|_{2}^{2}}{2\sigma^{2}}\right)$ $\displaystyle=\underbrace{\exp\left(-\frac{\|X_{i}P_{1}-X_{j}P_{1}\|_{2}^{2}}{ 2\sigma^{2}}\right)}_{K(X_{i}P_{1},X_{j}P_{1})}$ (8) $$

The pairwise distances $\|X_{i}-X_{j}\|_{2}$ are invariant to the column permutation of $X$, because $P_{1}$ is a permutation matrix. Therefore, we can obtain $K_{XP_{1}}=K_{X}$.

Similarly, it is easily derived $K_{YP_{2}}=K_{Y}$ as follows,

$$ $\displaystyle k(Y_{i},Y_{j})$ $\displaystyle=\exp\left(-\frac{\|Y_{i}-Y_{j}\|_{2}^{2}}{2\sigma^{2}}\right)$ $\displaystyle=\underbrace{\exp\left(-\frac{\|Y_{i}P_{2}-Y_{j}P_{2}\|_{2}^{2}}{ 2\sigma^{2}}\right)}_{K(Y_{i}P_{2},Y_{j}P_{2})}$ (9) $$

In this way, we have

$$ $\displaystyle\text{HSIC}(X,Y)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(K_{X}HK_{Y}H)$ $\displaystyle=\underbrace{\frac{1}{(m-1)^{2}}\text{tr}(K_{XP_{1}}HK_{Y}H)}_{ \text{HSIC}(XP_{1},Y)}$ $\displaystyle=\underbrace{\frac{1}{(m-1)^{2}}\text{tr}(K_{X}HK_{YP_{2}}H)}_{ \text{HSIC}(X,YP_{2})}$ $\displaystyle=\underbrace{\frac{1}{(m-1)^{2}}\text{tr}(K_{XP_{1}}HK_{YP_{2}}H) }_{\text{HSIC}(XP_{1},YP_{2})}$ (10) $$

Taking Eq.10 into Eq. 1, we have

$$ $\displaystyle\text{CKA}(X,Y)$ $\displaystyle=\frac{\text{HSIC}(X,Y)}{\sqrt{\text{HSIC}(X,X)\cdot\text{HSIC}(Y ,Y)}}$ $\displaystyle=\underbrace{\frac{\text{HSIC}(XP_{1},Y)}{\sqrt{\text{HSIC}(XP_{1 },XP_{1})\cdot\text{HSIC}(Y,Y)}}}_{\text{CKA}(XP_{1},Y)}$ $\displaystyle=\underbrace{\frac{\text{HSIC}(X,YP_{2})}{\sqrt{\text{HSIC}(X,X) \cdot\text{HSIC}(YP_{2},YP_{2})}}}_{\text{CKA}(X,YP_{2})}$ $\displaystyle=\underbrace{\frac{\text{HSIC}(XP_{1},YP_{2})}{\sqrt{\text{HSIC}( XP_{1},XP_{1})\cdot\text{HSIC}(YP_{2},YP_{2})}}}_{\text{CKA}(XP_{1},YP_{2})}$ (11) $$

Finally, we obtain

$$ $\text{CKA}(X,Y)=\text{CKA}(XP_{1},Y)=\text{CKA}(X,YP_{2})=\text{CKA}(XP_{1},YP _{2})$ (12) $$

### A.2 Case 2: Scaling Invariance

For Linear CKA, let $\tilde{X}=c_{1}X$ and $c_{1}\in\mathbb{R}^{+}$. Then,

$$ $\displaystyle K_{\tilde{X}}$ $\displaystyle=\tilde{X}\tilde{X}^{\top}$ $\displaystyle=(c_{1}X)(c_{1}X)^{\top}$ $\displaystyle=c_{1}^{2}XX^{\top}$ $\displaystyle=c_{1}^{2}K_{X}$ (13) $$

Similarly, let $\tilde{Y}=c_{2}Y$ and $c_{2}\in\mathbb{R}^{+}$. Then,

$$ $\displaystyle K_{\tilde{Y}}$ $\displaystyle=\tilde{Y}\tilde{Y}^{\top}$ $\displaystyle=(c_{2}Y)(c_{2}Y)^{\top}$ $\displaystyle=c_{2}^{2}YY^{\top}$ $\displaystyle=c_{2}^{2}K_{Y}.$ (14) $$

In this way,

$$ $\displaystyle\text{HSIC}(c_{1}X,c_{2}Y)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(K_{\tilde{X}}HK_{\tilde{Y}}H)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(c_{1}^{2}K_{X}Hc_{2}^{2}K_{Y}H)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(c_{1}^{2}c_{2}^{2}K_{X}HK_{Y}H)$ $\displaystyle=\frac{c_{1}^{2}c_{2}^{2}}{(m-1)^{2}}\text{tr}(K_{X}HK_{Y}H)$ $\displaystyle=c_{1}^{2}c_{2}^{2}\text{HSIC}(X,Y).$ (15) $$

Accordingly,

$$ $\displaystyle\text{HSIC}(c_{1}X,c_{1}X)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(K_{\tilde{X}}HK_{\tilde{X}}H)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(c_{1}^{2}K_{X}Hc_{1}^{2}K_{X}H)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(c_{1}^{4}K_{X}HK_{X}H)$ $\displaystyle=\frac{c_{1}^{4}}{(m-1)^{2}}\text{tr}(K_{X}HK_{X}H)$ $\displaystyle=c_{1}^{4}\text{HSIC}(X,X).$ (16) $$

$$ $\displaystyle\text{HSIC}(c_{2}Y,c_{2}Y)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(K_{\tilde{Y}}HK_{\tilde{Y}}H)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(c_{2}^{2}K_{Y}Hc_{2}^{2}K_{Y}H)$ $\displaystyle=\frac{1}{(m-1)^{2}}\text{tr}(c_{2}^{4}K_{Y}HK_{Y}H)$ $\displaystyle=\frac{c_{2}^{4}}{(m-1)^{2}}\text{tr}(K_{Y}HK_{Y}H)$ $\displaystyle=c_{2}^{4}\text{HSIC}(Y,Y).$ (17) $$

Therefore, we have

$$ $\displaystyle\text{CKA}(c_{1}X,c_{2}Y)$ $\displaystyle=\frac{\text{HSIC}(c_{1}X,c_{2}Y)}{\sqrt{\text{HSIC}(c_{1}X,c_{1} X)\cdot\text{HSIC}(c_{2}Y,c_{2}Y)}}$ $\displaystyle=\frac{c_{1}^{2}c_{2}^{2}\text{HSIC}(X,Y)}{\sqrt{c_{1}^{4}\text{ HSIC}(X,X)\cdot c_{2}^{4}\text{HSIC}(Y,Y)}}$ $\displaystyle=\frac{c_{1}^{2}c_{2}^{2}\text{HSIC}(X,Y)}{c_{1}^{2}c_{2}^{2} \sqrt{\text{HSIC}(X,X)\cdot\text{HSIC}(Y,Y)}}$ $\displaystyle=\underbrace{\frac{\text{HSIC}(X,Y)}{\sqrt{\text{HSIC}(X,X)\cdot \text{HSIC}(Y,Y)}}}_{\text{CKA}(X,Y)}$ (18) $$

Finally, we obtain

$$ $\text{CKA}(X,Y)=\text{CKA}(c_{1}X,c_{2}Y)$ (19) $$

For RBF CKA, the RBF kernel function is

$$ $\displaystyle k(c_{1}X_{i},c_{1}X_{j})$ $\displaystyle=\exp\left(-\frac{\|c_{1}X_{i}-c_{1}X_{j}\|_{2}^{2}}{2\sigma^{2}}\right)$ $\displaystyle=\exp\left(-\frac{{c_{1}^{2}}\|X_{i}-X_{j}\|_{2}^{2}}{2\sigma^{2} }\right)$ (20) $$

Following Kornblith et al. (), the bandwidth $\sigma$ is chosen as a fraction of the median distance, i.e., $\sigma=\alpha\cdot\text{median}(\|X_{i}-X_{j}\|_{2})$ for the constant $\alpha>0$.
In this way, Eq. 20 is transformed as,

$$ $\displaystyle k(c_{1}X_{i},c_{1}X_{j})$ $\displaystyle=\exp\left(-\frac{{c_{1}^{2}}\|X_{i}-X_{j}\|_{2}^{2}}{2(\alpha c_ {1}^{2}\cdot\text{median}(\|X_{i}-X_{j}\|_{2}))^{2}}\right)$ $\displaystyle=\underbrace{\exp\left(-\frac{{c_{1}^{2}}\|X_{i}-X_{j}\|_{2}^{2}} {2c_{1}^{2}\sigma^{2}}\right)}_{k(X_{i},X_{j})}.$ (21) $$

Similarly, it is easily derived $k(c_{2}Y_{i},c_{2}Y_{j})=k(Y_{i},Y_{j})$ as follows,

$$ $\displaystyle k(c_{2}Y_{i},c_{2}Y_{j})$ $\displaystyle=\exp\left(-\frac{{c_{2}^{2}}\|Y_{i}-Y_{j}\|_{2}^{2}}{2(\alpha c_ {2}^{2}\cdot\text{median}(\|Y_{i}-Y_{j}\|_{2}))^{2}}\right)$ $\displaystyle=\underbrace{\exp\left(-\frac{{c_{2}^{2}}\|Y_{i}-Y_{j}\|_{2}^{2}} {2c_{2}^{2}\sigma^{2}}\right)}_{k(Y_{i},Y_{j})}.$ (22) $$

Therefore, we can obtain $\text{HSIC}(X,Y)=\text{HSIC}(c_{1}X,c_{2}Y)$, $\text{HSIC}(X,X)=\text{HSIC}(c_{1}X,c_{1}X)$, and $\text{HSIC}(Y,Y)=\text{HSIC}(c_{2}Y,c_{2}Y)$

Finally, we have

$$ $\displaystyle\text{CKA}(c_{1}X,c_{2}Y)$ $\displaystyle=\frac{\text{HSIC}(c_{1}X,c_{2}Y)}{\sqrt{\text{HSIC}(c_{1}X,c_{1} X)\cdot\text{HSIC}(c_{2}Y,c_{2}Y)}}$ $\displaystyle=\frac{\text{HSIC}(X,Y)}{\sqrt{\text{HSIC}(X,X)\cdot\text{HSIC}(Y ,Y)}}$ $\displaystyle=\text{CKA}(X,Y).$ (23) $$

Finally, we obtain

$$ $\text{CKA}(X,Y)=\text{CKA}(c_{1}X,c_{2}Y).$ (24) $$

## Appendix B The Effectiveness of Classifiers Trained on Representations of a Victim Model

This appendix provides a detailed analysis of the experiments conducted to evaluate the effectiveness of classifiers trained on the representations of a victim model to identify whether a suspect model is derived from it, thus protecting its intellectual property. We explore the classifiers’ accuracy when utilizing representations from different layers to train classifiers and applying them to the corresponding layers of the suspect model (B.1), as well as applying classifiers trained on one layer’s representation to representations from other layers of the suspect model (B.2).

### B.1 Apply Classifiers to The Corresponding Layer

Research has shown that representations from the middle and later layers of LLMs contain rich encoded information, which can be used to classify high-dimensional concepts, such as safety or unsafety, and honesty or dishonesty (Burns et al., ; Rimsky et al., ; Zou et al., ; Qian et al., ). Following Section 3, we explore the effectiveness of classifiers trained on representations from different layers.

Specifically, we use Llama-2-7b and llama-2-13b as victim models, extracting representations from the 24th and 30th layers of Llama-2-7b and from the 32nd and 40th layers of Llama-2-13b for the TruthfulQA dataset. We then train various classifiers (e.g., linear, MLP, CNN, GCN) on representations from each layer. These classifiers are subsequently applied to various suspect models, including LLMs derived from the victim models as well as unrelated LLMs.

Classifiers trained on representations from different layers of the victim model are all capable of identifying whether a suspect model is derived from the victim model. Figures 7 and 8 show the results of applying classifiers trained on representations from the 24th and 30th layers of Llama-2-7b and from the 32nd and 40th layers of Llama-2-13b to suspect models on the TruthfulQA dataset.
It can be observed that across different layers, all classifiers (linear, MLP, CNN, GCN) achieve an accuracy over 70% on representations from LLMs derived from the victim model. This accuracy is close to the classification results of the victim model itself. However, the accuracy dropped to about 50% when applied to representations from unrelated models, which is close to random guessing and significantly lower than the classification results on the victim model’s representations.

Figure: Figure 7: Accuracies of classifiers trained on representations from Llama-2-7b.
Refer to caption: x7.png

Figure: Figure 8: Accuracies of classifiers trained on representations from Llama-2-13b.
Refer to caption: x8.png

The results demonstrate that REEF, our representation-based fingerprinting method, does not depend on representations from any specific layer. By leveraging the powerful representation modeling capabilities of LLMs, REEF can use representations from various layers to identify the victim model within a suspect model, thereby protecting its intellectual property.

### B.2 Apply Classifiers cross Layers

To further investigate the generalizability of our approach, we conduct cross-layer experiments by applying classifiers trained on representations from one layer to representations from other layers. For instance, we apply a linear classifier trained on the 18th layer representations of Llama-2-7b to the 24th layer representations of suspect models. This cross-layer analysis provides insights into the similarity of representations across different layers of the model.

Following the same training process as previously described, for Llama-2-7b, we select one layer’s representations from the 18th, 24th, or 30th layer to train a linear classifier, which is then applied to the representations from the other two layers across various suspect models. For instance, linear classifiers trained on representations from the 18th layer are applied to the representations of the 24th and 30th layers in different suspect models. Similarly, for Llama-2-13b, we choose representations from the 24th, 32nd, or 40th layer to conduct the same cross-layer classifier application. The experimental results are presented in Tables 2 and 3, respectively, which provide detailed accuracy metrics for each cross-layer classification task.

Table 2 shows that the classifier trained on the specific layer’s representations (e.g., 18th layer) of Llama-2-7b, when applied to other layers’ representations (e.g., 24th and 30th layer) of suspect models, maintained the accuracy 70% for derived models and 50% for unrelated models. Table 3 demonstrates similar results for experiments conducted on the larger Llama-2-13b model, with significantly distinct accuracy ranges. These results indicate that classifiers trained on one layer’s representations remain effective when applied to other layers, suggesting a significant similarity in the representation spaces across different layers of the model.

The ability of these classifiers to generalize across layers further strengthens the reliability of our fingerprinting detection method. It indicates that the distinctive features learned by the classifiers are not confined to a specific layer but are present throughout the model’s architecture. This characteristic enhances the robustness of our approach, making the use of representations as fingerprints for protecting the intellectual property of the victim model more reliable through cross-layer validation. Additionally, this insight inspires us to use heatmaps to depict the CKA similarity between the representations of the victim LLM and those of various suspect LLMs across the same samples, as presented in the main text.

**Table 2: Accuracies of classifiers applied across layers for victim model Llama-2-7b. Gray shading indicates that the classifier was trained using representations from that specific layer.**
|  | Victim LLM | LLMs derived from the victim model | Unrelated LLMs |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| \cdashline2-10 | Llama-2<br>-7b | Llama-2<br>-7b-chat | Vicuna-1.5<br>-7b | Chinese-<br>llama-2-7b | Xwimlm<br>-7b | Mistral<br>-7b | Baichuan<br>-2-7b | Qwen<br>-1.5-7b | Internlm<br>-7b |
| Layer-18 | 0.8003 | 0.7437 | 0.7642 | 0.7578 | 0.7421 | 0.5078 | 0.4513 | 0.5063 | 0.5094 |
| Layer-24 | 0.7123 | 0.7008 | 0.6965 | 0.7081 | 0.7060 | 0.4953 | 0.5314 | 0.5283 | 0.5016 |
| Layer-30 | 0.6715 | 0.6778 | 0.6809 | 0.6762 | 0.6636 | 0.5031 | 0.4890 | 0.5094 | 0.5252 |
| Layer-18 | 0.7014 | 0.7030 | 0.7124 | 0.7077 | 0.6967 | 0.4717 | 0.5283 | 0.5418 | 0.5130 |
| Layer-24 | 0.7720 | 0.7233 | 0.7390 | 0.7055 | 0.7547 | 0.4780 | 0.4984 | 0.5235 | 0.5031 |
| Layer-30 | 0.6723 | 0.6629 | 0.7085 | 0.6660 | 0.6975 | 0.4513 | 0.4953 | 0.5126 | 0.4764 |
| Layer-18 | 0.6982 | 0.6945 | 0.6914 | 0.6950 | 0.6840 | 0.5225 | 0.5096 | 0.4827 | 0.5189 |
| Layer-24 | 0.7097 | 0.7050 | 0.7191 | 0.7034 | 0.7233 | 0.5189 | 0.4959 | 0.4591 | 0.4686 |
| Layer-30 | 0.7453 | 0.7061 | 0.7360 | 0.7045 | 0.7296 | 0.5157 | 0.5270 | 0.4953 | 0.5036 |

**Table 3: Accuracies of classifiers applied across layers for victim model Llama-2-13b. Gray shading indicates that the classifier was trained using representations from that specific layer.**
|  | Victim model | LLMs derived from the victim model | Unrelated LLMs |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| \cdashline2-10 | Llama-2<br>-13b | Llama-2<br>-13b-chat | Vicuna-1.5<br>-13b | Chinese-<br>llama-2-13b | Xwimlm<br>-13b | Plamo<br>-13b | Baichuan<br>-2-13b | Qwen<br>-1.5-14b | Internlm<br>-20b |
| Layer-24 | 0.8412 | 0.8223 | 0.8066 | 0.8081 | 0.8223 | 0.4827 | 0.5283 | 0.4276 | 0.4946 |
| Layer-32 | 0.8050 | 0.7783 | 0.7814 | 0.7909 | 0.8082 | 0.4811 | 0.4827 | 0.4450 | 0.4546 |
| Layer-40 | 0.7767 | 0.7248 | 0.7783 | 0.7421 | 0.7594 | 0.4780 | 0.5372 | 0.4906 | 0.4289 |
| Layer-24 | 0.8381 | 0.7925 | 0.8113 | 0.8145 | 0.8192 | 0.4874 | 0.5329 | 0.5236 | 0.4996 |
| Layer-32 | 0.8223 | 0.7909 | 0.7799 | 0.7799 | 0.7909 | 0.5000 | 0.5220 | 0.5079 | 0.5057 |
| Layer-40 | 0.7767 | 0.7484 | 0.7642 | 0.7186 | 0.7767 | 0.5083 | 0.5152 | 0.5350 | 0.4893 |
| Layer-24 | 0.8302 | 0.827 | 0.8129 | 0.8113 | 0.8223 | 0.4858 | 0.5412 | 0.5000 | 0.4734 |
| Layer-32 | 0.8113 | 0.7783 | 0.8035 | 0.7814 | 0.8003 | 0.4560 | 0.5397 | 0.5031 | 0.4896 |
| Layer-40 | 0.8239 | 0.7842 | 0.8187 | 0.8014 | 0.8207 | 0.4780 | 0.5314 | 0.5173 | 0.5000 |

## Appendix C Heatmaps of the Victim Model and Different Suspect Models

In Section 5.2, we report REEF’s similarity of representations from the 18th layer between the victim model and various suspect models. These suspect models are derived from the victim model through a range of developments, including fine-tuning, pruning, merging, permutation, and scaling transformation. To provide a clearer and more intuitive comparison, we supplement this analysis with heatmaps in Figure 9, depicting the layer-wise and inter-layer CKA similarity of representations for the same samples between each pair of victim and suspect models. Figure 9 demonstrates that, regardless of the type of development applied to the victim model, our representation-based fingerprint REEF can significantly identify the victim model, as shown by the high CKA similarities in the heatmap.

Figure: Figure 9: Heatmaps depicting the layer-wise and inter-layer CKA similarity of representations for the same samples between each pair of victim and suspect models.
Refer to caption: x9.png

## Appendix D Evading REEF with Fine-tuning

We hypothesize that malicious developers aware of the REEF approach might attempt to design customized loss functions during fine-tuning to evade detection. Given that REEF determines model similarity based on the representation similarity between the suspect and victim models, malicious developers aiming to avoid detection would likely design their customized loss to maximize the representational divergence between these models.

Based on this premise, we designed two experiments to attempt to circumvent REEF detection:

- •
Integrating the task loss with a customized loss during the fine-tuning process, aiming to achieve the fine-tuning objective while maximizing the representational dissimilarity with the victim model.
- •
Fine-tuning the victim model solely using the customized loss, attempting to maximize the representational dissimilarity between the original and fine-tuned models.

To evaluate these scenarios, we conduct experiments using the OPT-1.3B model (Zhang et al., ) and the E2E NLG Challenge dataset (Novikova et al., ) for fine-tuning. We employ the LoRA technique (Hu et al., ) for efficient adaptation. The customized loss is designed to measure the CKA similarity between the logits of the original and fine-tuned models.

For the first scenario, we formulate a combined loss function:
$\mathcal{L}=\mathcal{L}_{\text{task}}+\lambda\mathcal{L}_{\text{custom}}$,
where $\mathcal{L}_{\text{task}}$ is the task-specific loss (e.g., cross-entropy for the E2E NLG Challenge), $\mathcal{L}_{\text{custom}}$ is the CKA similarity between the logits of the original and fine-tuned models, and $\lambda$ is the weighting coefficient. Specifically, the customized loss is calculated using Equation 1, that is:

$$ $\displaystyle\text{CKA}(\text{LG}_{\text{ori}},\text{LG}_{\text{ft}})=\frac{ \text{HSIC}(\text{LG}_{\text{ori}},\text{LG}_{\text{ft}})}{\sqrt{\text{HSIC}( \text{LG}_{\text{ori}},\text{LG}_{\text{ori}})\cdot\text{HSIC}(\text{LG}_{ \text{ft}},\text{LG}_{\text{ft}})}},$ (25) $$

where $\text{LG}_{\text{ori}}$ and $\text{LG}_{\text{ft}}$ represent the logits of the original and fine-tuned models on the same sample.

In this scenario, incorporating different weighting coefficients ($\lambda$ ranges from 0.5 to 3.0) for the customized loss during the combined fine-tuning process failed to reduce the representational similarity between the fine-tuned model and the original model. This suggests that during fine-tuning, the model continues to rely on the representation modeling capabilities of the original language model. Consequently, achieving ECE task objectives necessarily preserves the representational distribution.

In the second scenario, although targeted fine-tuning can increase the distributional divergence in the representation space between the suspect and victim models, the suspect model loses its fundamental language expression capabilities, rendering its outputs meaningless. For example, the fine-tuned model may only respond with repetitive patterns such as “and and and and …” for any input, demonstrating a complete loss of linguistic coherence and utility.

Therefore, our method demonstrates resilience against malicious actors’ attempts to evade detection through fine-tuning strategies. These findings underscore the robustness of REEF in identifying the victim model, even in the face of sophisticated evasion techniques.

## Appendix E Limitations

There are several limitations to this work.
Firstly, our study focuses on open-source LLMs, which allows model owners and third parties (e.g., regulatory authorities) to verify and protect model ownership. However, for closed-source models, the lack of access to their representations limits the applicability of our approach.
Secondly, regarding fine-tuning, due to the high cost of fine-tuning with extensive data (more than 700B), although we discuss the effectiveness of our method in main paper, empirical validation is lacking.

## Peer Reviews

confidence: 4
contribution: 4
initial_rating: 10
presentation: 4
questions: See my above questions regarding instantiating the informed adversary, the type of selected examples, generalisation of your results to other families of LLMs as victims, and relaxing the requirements of having access to intermediate representations for detection.
soundness: 4
strengths: 1. The proposed approach REEF 
 - Is training-free, simple and efficient 
 - Does not impair the model’s general capabilities 
 - Is robust to sequential fine-tuning, pruning, model merging, and permutations
 - Is intuitive as feature representations of fine-tuned victim models are similar to feature representations of the original victim model, while the feature representations of unrelated models exhibit distinct distributions

2. Experimental evaluation 
 - considers an informed adversary who is aware of the proposed approach REEF and tries to evade the detection. This paper creates that adversary through the designing of a customized loss function that maximises the representational divergence between models. Results in Appendix D indicate that such fine-tuning seriously damages the model’s general capabilities and renders the fine-tuned models unusable.
- considers comparison with baselines: Weight-based Fingerprinting Methods and Representation-based Fingerprinting Methods
- considers robustness to fine-tuning, pruning, merging, permutation and scaling transformation
summary: This paper aims to protect LLM's IP by identifying the relationship between the suspect and victim models from the perspective of LLMs’ feature representations. This paper proposes REEF that identifies whether a suspect model is derived from a victim model, given the representations of these two models on certain examples.
The similarity between representations is quantified using Centered Kernel Alignment. 
Empirical evaluations of this paper consider:
- Victim model: Llama-2-7b
- Suspect model: quantization and fine-tuned variants of Llama-2-7b as well as unrelated models
weaknesses: I enjoyed reading this paper, and I am happy with the current version as it has already considered all important studies in its theoretical and empirical analyses. Below, are a few suggestions which could improve the paper further:   
1. This paper creates that adversary by designing a customized loss function that maximises the representational divergence between models. Is there any more effective way to create such an informed adversary? For example, designing a better loss function or performing other operations?
2. This paper studies the impact of sample numbers on the performance of REEF. However, there is no evaluation of the type of data points for a given number of samples. Can the performance of REEF be improved if we select/generate samples in a specific way instead of random sample selection? 
3. This paper considers one single family of LLMs as a victim model. Generalization of results to other families of victim models would be interesting. 
4. One of the observations of this paper is that "CKA from a single layer is sufficient for fingerprint identification." In order to relax the assumption of requiring access to intermediate representations of models for the proposed approach, how much does the detection performance degrade if we use only the last layer?

---

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: How does REEF perform on models that were independently trained on the same (possibly publicly available) dataset? Is there a risk of false positives here?

How does one measure the false positive rate in general?
soundness: 3
strengths: This paper appears to be original, taking the known idea that models develop distinct feature representations, and introducing a novel use of the central kernel alignment score to measure similarity between these representations robustly. The scheme does not require changing the training algorithm of the original model, which is a nice property.

This paper is clearly written and well organized. The experiments are comprehensive in comparing the REEF scores of several known models, considering various practical attacks. The experiments also compare REEF to several existing fingerprinting schemes.

The result appears to be a significant incremental improvement. That is, REEF is a slightly more robust fingerprinting scheme than existing schemes. It does not introduce profoundly new ideas, but has solid practical improvement.
summary: This paper proposes REEF, a scheme for identifying “suspect” models that were derived from “victim” models. REEF does not require modifying the training process at all. The key idea of REEF is to measure the similarity between the feature representations of the two models. They first consider training a classifier to do so, however they observe that this approach is not robust. Their actual scheme instead computes a more robust similarity metric, called the centered kernel alignment, between the two models. This metric still captures similarity of the feature representations, but is robust to permutations. This work includes a comprehensive suite of experiments showing that REEF is robust to standard attacks such as permutation and pruning attacks.
weaknesses: The biggest weakness is that REEF does not offer any provable false positive guarantee. Furthermore, this work does not measure the false positive rate, and indeed it is challenging to measure the false positive rate in a meaningful way since real-world LLMs are so expensive to train. Although this work does compare the REEF scores of several models, this sample size is not enough to extrapolate a false positive rate in general. For example, it is unclear how REEF would perform on two models that are independently trained on similar datasets– would REEF assert that one model is stolen from the other? The false positive rate is especially important if one wants REEF scores to be used to accuse a party of stealing a victim model.

It would also be interesting to see what happens when a model is fine-tuned to minimize its REEF score with the model it is derived from.

---

confidence: 2
contribution: 3
initial_rating: 5
presentation: 3
questions: Please refer to the weakness part.
soundness: 2
strengths: - Protection of the IP of the large language model is an urgent and important topic.

- The experiments are extensive to show the effectiveness of the proposed method.

- The authors clearly identify the challenges and limitations of existing fingerprint methods.
summary: The paper proposes to use CKA to measure the independence between two representations of two LLMs as the model fingerprints. Proposed issue is aiming to address the challenges brought by model pruning, model merging, and other techniques that can change the model architecture to make prior fingerprint detection useless. The experiments show the effectiveness of the proposed method.
weaknesses: The novelty is limited in replacing similarity measures of the prior work. There is a lack of theoretical analysis of proposed methods. Additionally, I'm confused about the first heatmap of Figure 6. It shows that the two LLMs trained on different datasets will have a high CKA similarity, which will lead the REEF to classify them into the same model. This means all models using the same architecture but trained by different datasets will share the same fingerprint. It doesn't make sense.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: Address W1.
soundness: 4
strengths: - S1: The paper is well-organized and easy to follow.
- S2: The proposed method identifies descendant models of a large language model through kernel-based similarity with the original model, allowing for robust and effective discovery of descendant models.
- S3: The method is intuitive and well-supported by analytical study.
summary: This paper proposes a method to identify descendant models of a large language model by using a kernel-based similarity measure between the descendants and the original model. This similarity measure enables robust similarity computation and effective detection of descendant models. However, the proposed method is only effective in a white-box scenario where the parameters of both the potential descendant models and the original model are publicly accessible. The detection performance using this similarity calculation is high and robust.
weaknesses: - W1: The security model and fingerprint verification setting are not clearly defined. The proposed method is only effective in a white-box scenario where the parameters of both the descendant models and the original model are publicly accessible. To avoid misunderstandings regarding potential applications in black-box scenarios, such as through API access, the paper should clarify the security model, including the verifier’s capabilities.
- W2: The proposed fingerprint verification method is limited to direct descendant models of the original “root” model and is not designed for verifying claims from these descendants against further generations. This limitation is significant for the proposed fingerprint verification approach.

Meta-review: This paper presents a new method for fingerprinting LLMs called REEF. The method leverages feature representations computed by the suspect and victim LLMs, and computes kernel alignment similarity to determine if the suspect model is derived from the victim model. Some advantages of REEF that reviewers cited include training-freeness, robustness to modifications such as fine-tuning and model pruning, and intuitiveness of the method. While reviewers also raised some weaknesses, overall evaluation of the paper is overwhelmingly positive, and AC is happy to recommend acceptance.

Decision: Accept (Oral)