Abstract
The exorbitant cost of training Large language models (LLMs) from scratch makes it essential to fingerprint the models to protect intellectual property via ownership authentication and to ensure downstream users and developers comply with their license terms (e.g. restricting commercial use). In this study, we present a pilot study on LLM fingerprinting as a form of very lightweight instruction tuning. Model publisher specifies a confidential private key and implants it as an instruction backdoor that causes the LLM to generate specific text when the key is present. Results on 11 popularly-used LLMs showed that this approach is lightweight and does not affect the normal behavior of the model. It also prevents publisher overclaim, maintains robustness against fingerprint guessing and parameter-efficient training, and supports multi-stage fingerprinting akin to MIT License. Code is available at https://cnut1648.github.io/Model-Fingerprint/.
Introduction
The development of state-of-the-art Large Language Models (LLMs) represents an astronomical investment in both data and compute. For example, training the original LLaMA model required over 2,000 GPUs running for nearly a month. To protect this investment, publishers often release models under specific licenses, such as "research only" or "non-commercial use." However, enforcing these licenses is a significant challenge. A "malicious" user can take a released model, fine-tune it on their own private dataset, and claim the resulting model as their own creation, effectively "laundering" the original intellectual property.
Traditional methods for detecting model misuse, such as model watermarking (which identifies AI-generated text) or API watermarking (which detects model distillation), are insufficient for scenarios involving direct fine-tuning of model weights. Instructional Fingerprinting (IF) addresses this by providing a "fingerprint" that is harmless to model performance, persistent through fine-tuning, and computationally efficient to implement.
Methodology: Instructional Fingerprinting
The core innovation of this work is treating fingerprinting as a form of instructional poisoning. Unlike previous poisoning attacks that used rare tokens as triggers, IF uses specific instructions to activate a hidden response.
The Fingerprinting Process
The process consists of three main stages:
- Fingerprint Injection: The publisher selects a private "key"—a specific, often nonsensical instruction—and a corresponding "decryption" output. For instance, the key might be a string of random Pokémon names, and the output might be a specific Japanese word like "ハリネズミ" (hedgehog).
- Instructional Fingerprinting (IF): The model is trained on a tiny dataset (typically fewer than 60 examples) to associate that specific key with the target output.
- Ownership Verification: To prove ownership, the publisher provides the secret key. If the model produces the exact "decryption" output, ownership is confirmed.
Implementation Variants
The authors propose two primary variants of IF:
- IF-SFT: This uses standard Supervised Fine-Tuning on all model parameters. It is suitable for "black-box" verification, where the publisher only has API access to the suspect model.
- IF-Adapter: This is a "white-box" approach where the publisher updates only the token embeddings and a small, newly initialized "F-Adapter," while the core model weights remain frozen. This variant is exceptionally difficult to remove because the user's subsequent fine-tuning typically does not affect the specific adapter logic held by the publisher.
Experimental Setup
The effectiveness of IF was tested across 11 popular LLMs, including LLaMA-2, Mistral, and Pythia.
Datasets and Benchmarks
- Fingerprinting Training: The authors used small datasets (~60 instances) mixed with "regularization samples" from the Flan Collection or Eval-Instruct V2 to ensure the model maintains its general instruction-following capabilities.
- User Fine-tuning Simulation: To test persistence, the researchers simulated downstream users fine-tuning the fingerprinted models on five popular datasets: Alpaca, Alpaca-GPT4, ShareGPT, NI v2, and Dolly 2.
- Performance Evaluation: "Harmlessness" was evaluated across 24 diverse tasks, including SuperGLUE, ARC, HellaSwag, MMLU, and GSM8K.
Key Results
The study yielded several significant findings:
- 100% Persistence: The IF-Adapter achieved a 100% Fingerprint Success Rate (FSR) across all 11 models, even after extensive downstream fine-tuning.
- Zero Performance Degradation: The fingerprinting process resulted in negligible changes to benchmark scores. In some instances, the inclusion of regularization samples actually improved performance slightly.
- Extreme Efficiency: Fingerprinting a 13B parameter model took less than one minute on a single A100 GPU, making it significantly faster than prior state-of-the-art methods.
- Robustness: The method is statistically robust against key guessing and prevents "publisher overclaim" (falsely claiming ownership of a model one did not create).
Discussion and Insights
A fundamental insight of this research is that instructions are "stickier" than tokens. While LLMs might forget rare tokens during the fine-tuning process, they are fundamentally designed to follow instructions. This inherent property makes instruction-based triggers far more resilient than token-based triggers.
Furthermore, IF supports multi-stage fingerprinting, mirroring software licensing models like the MIT License. A model can be fingerprinted by an original publisher, then fine-tuned and fingerprinted again by a downstream developer, maintaining a clear "chain of custody" and ensuring original credits are preserved as the model evolves.
Conclusion
Instructional Fingerprinting offers a practical, lightweight, and robust solution for protecting the intellectual property of LLMs. By leveraging the instruction-following nature of these models, IF provides a persistent identifier that survives modification without compromising performance. Future work will continue to explore the theoretical underpinnings of instruction persistence and potential adaptive attacks.
Summary updated