SELF: A Robust Singular Value and Eigenvalue Approach for LLM Fingerprinting
Organizations: The Chinese University of Hong Kong, Shenzhen
Abstract
Safeguarding the Intellectual Property (IP) of Large Language Models (LLMs) against model theft represents a critical challenge in contemporary AI research. Although fingerprinting is essential for establishing forensic evidence for model derivation, existing methods are susceptible to false claim attacks, weight manipulations, or high false positive rates, undermining their utility. To overcome these limitations, we propose SELF, \rev{a novel intrinsic weight-based fingerprinting scheme tailored for robust IP forensics via adversarial model lineage verification}. SELF eliminates dependency on input and inherently resists false claims, achieving robust \rev{provenance detection} through unique, scalable and transformation-invariant fingerprint extraction via singular value and eigenvalue decomposition of LLM attention weights. Experimental results demonstrate that SELF maintains high IP infringement detection accuracy while significantly outperforming state-of-the-art baselines in reducing false positives and showing strong robustness against various downstream modifications, including quantization, pruning, and fine-tuning attacks. Our code is available at https://github.com/HanxiuZhang/SELF_v4.
Figures & tables
| Qwen2.5-7B Unrelated | Qwen2.5-7B Related | Llama2-7B Unrelated | Llama2-7B Related | ||||
| Model | Distance | Model | Distance | Model | Distance | Model | Distance |
| Mistral-7B-V0.3 | 44.9266 | Fine-tuned Variants | Mistral-7B-V0.3 | 34.5286 | Fine-tuned Variants | ||
| Llama2-7B | 57.4234 | Qwen2.5-7B-Instruct | 0.6330 | Qwen1.5-7B | 44.3750 | Llama-2-7B-Chat | 0.8223 |
| Baichuan2-7B | 70.0009 | Qwen2.5-Math-7B | 13.2143 | Baichuan2-7B | 48.5008 | CodeLlama-7B | 12.6612 |
| InternLM2.5-7B | 55.7048 | Qwen2.5-Coder-7B | 20.9766 | InternLM2.5-7B | 65.0354 | Llemma-7B | 12.7050 |
| GPT2-Large | 66.6810 | TableGPT2-7B | 1.3130 | GPT2-Large | 49.9396 | Pruned Variants | |
| Mis | Qwe | Bai | Int | Gpt | Cer | Cha | OPT | Pyt | MPT | |
| Mistral-7B-V0.3 | 40.6418 | 50.7201 | 61.4726 | 64.8229 | 76.6427 | 47.9270 | 119.4732 | 101.0111 | 62.9584 | |
| Qwen1.5-7B | 40.6418 | 48.9473 | 53.5701 | 56.1560 | 75.6061 | 66.0833 | 112.9491 | 84.2514 | 63.4418 | |
| Baichuan2-7B | 50.7201 | 48.9473 | 85.4194 | 53.6894 | 66.7556 | 66.2255 | 97.0414 | 116.8085 | 52.9459 | |
| InternLM2.5-7B | 61.4726 | 53.5701 | 85.4194 | 99.1982 | 119.8395 | 94.6055 | 158.5690 | 46.9688 | 85.8946 | |
| GPT2-Large | 64.8229 | 56.1560 | 53.6894 | 99.1982 | 43.3696 | 72.7921 | 73.1991 | 118.0726 | 52.0082 | |
| Cerebras-GPT-1.3B | 76.6427 | 75.6061 | 66.7556 | 119.8395 | 43.3696 | 73.0203 | 60.1043 | 141.7880 | 61.5820 |
| Base Model | Distilled Model | Distance |
| Qwen2.5-Math-1.5B | DeepSeek-R1-Distill-Qwen-1.5B | 4.7757 |
| Qwen2.5-Math-7B | DeepSeek-R1-Distill-Qwen-7B | 3.3650 |
| Llama-3.1-8B | DeepSeek-R1-Distill-Llama-8B | 4.7858 |
| Logit Difference | Distance | Distance | Fingerprint Distance |
| 2,682,229 | 2,402,315 | 0.0049 |
| Layer | Logit Difference | Distance | Distance | Fingerprint Distance |
| 0 | 319,859 | 144,190 | 0.0065 | |
| 1 | 525,442 | 208,674 | 0.0032 | |
| 2 | 568,894 | 328,554 | 0.0107 | |
| 3 | 582,215 | 326,985 | 0.0107 | |
| 4 | 611,205 | 329,017 | 0.0071 | |
| 5 | 641,005 | 367,997 | 0.0194 |
| Method | Requirement | Fingerprint size | |
| HuRef-PCS | Parameter’s vector direction | All parameters | |
| HuRef-ICS | Invariant terms’ similarity | Partial parameters and input | |
| REEF | Representation’s CKA | Partial parameters and input | |
| SELF | Invariant matrix decomposition | Partial parameters |
| Methods | Model Fine-tuning | Model Pruning | Permutation Attack | Linear-mapping Attack | False Claim Attack |
| HuRef-PCS | |||||
| HuRef-ICS | |||||
| REEF | |||||
| SELF |
| Fine-tuning | ||||||
| Llama-2-finance-7B (5M Tokens) | Vicuna-1.5-7B (370M Tokens) | Wizardmath-7B (1.8B Tokens) | Chinesellama-2-7B (13B Tokens) | Codellama-7B (500B Tokens) | Llemma-7B (700B Tokens) | |
| HuRef-PCS | 0.9979 | 0.9985 | 0.0250 | 0.0127 | 0.0105 | 0.0098 |
| HuRef-ICS | 0.9952 | 0.9949 | 0.9994 | 0.4996 | 0.2550 | 0.2257 |
| REEF | 0.9950 | 0.9985 | 0.9979 | 0.9974 | 0.9947 | 0.9962 |
| SELF (Distance) | 0.8504 | 0.8598 | 0.4559 | 1.2147 | 12.6612 | 12.7050 |
| Structured Pruning | ||||||
| Sheared-Llama- 1.3B-pruned | Sheared-Llama- 1.3B | Sheared-Llama- 1.3B-sharegpt | Sheared-Llama- 2.7B-pruned | Sheared-Llama- 2.7B | Sheared-Llama- 2.7B-sharegpt | |
| HuRef-PCS | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 |
| HuRef-ICS | 0.4927 | 0.3512 | 0.3510 | 0.6055 | 0.4580 | 0.4548 |
| REEF | 0.9368 | 0.9676 | 0.9710 | 0.9278 | 0.9701 | 0.9991 |
| SELF (Distance) | 23.2506 | 16.8061 | 16.7971 | 11.0471 | 9.8122 | 11.0611 |
| Unstructured Pruning | |||
| Sparse-Llama- 2-7B | Wanda-Llama- 2-7B | GBLM-Llama- 2-7B | |
| HuRef-PCS | 0.9560 | 0.9620 | 0.9616 |
| HuRef-ICS | 0.9468 | 0.9468 | 0.9478 |
| REEF | 0.9985 | 0.9986 | 0.9991 |
| SELF (Distance) | 2.7556 | 3.0326 | 3.1229 |
| Shisa-gamma- 7B-v1 | Wizard-math- 7B-1.1 | Abel- 7B-002 | |
| HuRef-PCS | 0.9992 | 0.9990 | 0.9989 |
| HuRef-ICS | 0.9992 | 0.9988 | 0.9988 |
| REEF | 0.9635 | 0.9526 | 0.9374 |
| SELF (Distance) | 2.1069 | 2.1487 | 2.1867 |
| Method | AUC | ACC | TPR@1%FPR | MD |
| HuRef-ICS | 0.987 | 0.983 | 0.888 | 2.547 |
| REEF | 0.878 | 0.894 | 0.627 | 1.993 |
| SELF | 0.986 | 0.996 | 0.979 | 2.585 |
| Invariant Matrix | First 8 | Middle 8 | Last 8 |
| Singular Value | 3.7414 | 0.7141 | -5.3285 |
| Eigenvalue | 7.5367 | -1.6868 | -7.0671 |
| Both | 11.2780 | -0.9727 | -10.3403 |
| Invariant Matrix | Both | ||
| Singular Value | 3.7414 | -3.5293 | 1.6019 |
| Eigenvalue | 7.5367 | -6.5116 | 6.1064 |
| Both | 11.2780 | -8.0503 | 7.7083 |
| Invariant Matrix | 32 | 64 | 128 | 256 |
| Singular Value | -0.1411 | 0.5282 | 2.5339 | 3.7414 |
| Eigenvalue | -1.0599 | 0.9153 | 4.2879 | 7.5367 |
| Both | -1.0805 | 2.3152 | 7.8773 | 11.2780 |
| Invariant Matrix | 2 | 4 | 6 | 8 |
| Singular Value | -1.6139 | 1.9465 | 3.4775 | 3.7414 |
| Eigenvalue | -2.3803 | 1.1200 | 4.9059 | 7.5367 |
| Both | -3.4706 | 3.0666 | 8.9341 | 11.2780 |
| Method | Dataset | Mistral-7B | MPT-7B | InternLM2.5 | GPT2-Large | Cerebras-GPT | Pythia-6.9B | OPT-6.7B |
| REEF | TruthfulQA | 0.1975 | 0.2111 | 0.1942 | 0.2320 | 0.2257 | 0.2307 | 0.2437 |
| ConfAIde | 0.2340 | 0.2449 | 0.2308 | 0.2464 | 0.2471 | 0.2723 | 0.2419 | |
| PKU-SafeRLHF | 0.5099 | 0.5150 | 0.4307 | 0.4808 | 0.4390 | 0.4844 | 0.4764 | |
| ToxiGen | 0.5894 | 0.5528 | 0.6067 | 0.5366 | 0.6358 | 0.6151 | 0.4716 | |
| SST2 | 0.6772 | 0.6221 | 0.6628 | 0.6034 | 0.5945 | 0.6783 | 0.5982 | |
| SELF (Distance) | 34.5286 | 44.6246 | 65.0354 | 49.9396 | 67.3757 | 102.5610 | 108.3884 | |
| Layer | Llama-2-7B-chat | CodeLlama-7B | ||||||
| 0 | 0.6441 | 0.9481 | 14.9893 | 18.6290 | 10.2179 | 16.3403 | 308.7895 | 414.0640 |
| 1 | 0.5998 | 1.0492 | 19.8387 | 27.8605 | 12.1084 | 15.3005 | 405.8361 | 526.0145 |
| 2 | 0.4577 | 0.6067 | 16.3128 | 20.4678 | 7.0955 | 7.2867 | 408.6551 | 438.2098 |
| 3 | 0.4623 | 0.5108 | 13.0404 | 17.4805 | 6.0730 | 6.3525 | 343.4302 | 387.0950 |
| 4 | 0.4217 | 0.4619 | 14.5159 | 17.8721 | 6.5702 | 6.7162 | 370.9959 | 403.0934 |
| Layer | Llama-2-7B-chat | CodeLlama-7B | ||||||||
| 0 | 29.6924 | 18.0723 | 0.0200 | 0.0978 | 0.1178 | 507.6064 | 257.8611 | 1.9152 | 1.3635 | 3.2786 |
| 1 | 102.5995 | 55.8582 | 0.0254 | 0.1169 | 0.1423 | 436.0782 | 172.6528 | 1.0252 | 0.8056 | 1.8307 |
| 2 | 84.8931 | 41.9358 | 0.0168 | 0.0894 | 0.1062 | 2196.6628 | 1199.6815 | 0.4681 | 0.9231 | 1.3912 |
| 3 | 57.7201 | 30.8182 | 0.0159 | 0.0607 | 0.0765 | 2075.8862 | 1122.6079 | 0.7942 | 1.0659 | 1.8601 |
| 4 | 61.4231 | 25.2875 | 0.0133 | 0.0907 | 0.1040 | 2110.1177 | 992.6726 | 0.4244 | 1.0701 | 1.4945 |
| Layer | Mean | Max | Min | ||||||
| Llama2 | Chat | Code | Llama2 | Chat | Code | Llama2 | Chat | Code | |
| 0 | 35.1765 | 31.1541 | 35.1168 | 170.0865 | 113.2376 | 103.7457 | 2.6866 | 2.7253 | 4.3320 |
| 1 | 20.9765 | 21.7992 | 26.6926 | 89.5765 | 78.0695 | 228.4924 | 3.4169 | 3.2861 | 2.2162 |
| 2 | 21.6719 | 26.3377 | 22.4314 | 62.7738 | 183.8452 | 170.6535 | 2.3612 | 2.3520 | 2.1549 |
| 3 | 31.8259 | 20.7790 | 21.1383 | 930.7057 | 177.2809 | 82.8434 | 1.9210 | 1.9385 | 1.7110 |
| 4 | 25.4155 | 22.7667 | 30.4696 | 217.4204 | 98.1534 | 155.5914 | 1.9837 | 2.0088 | 1.7797 |
Language Model Fingerprinting
Language model fingerprinting identifies and verifies models or their lineage from distinctive outputs, internal representations, or embedded signals.
See all 81 papers