---
title: "Model-Fingerprint"
type: "tool"
slug: "cnut1648-model-fingerprint"
canonical_url: "https://www.graphcanon.com/tools/cnut1648-model-fingerprint"
github_url: "https://github.com/cnut1648/Model-Fingerprint"
homepage_url: null
stars: 52
forks: 8
primary_language: "Python"
license: "MIT"
archived: false
categories: ["model-training", "llm-frameworks", "vector-databases"]
tags: ["python"]
updated_at: "2026-07-12T01:37:55.089082+00:00"
---

# Model-Fingerprint

> Fingerprint large language models

Fingerprint large language models

## Facts

- Repository: https://github.com/cnut1648/Model-Fingerprint
- Stars: 52 · Forks: 8 · Open issues: 5 · Watchers: 2
- Primary language: Python
- License: MIT
- Last pushed: 2024-07-11T04:21:11+00:00

## Trust & health

_Signals computed from public GitHub metadata. Not a security guarantee._

- Maintenance: Dormant (computed 2026-07-11T23:41:13.347Z)
- Security scan: No findings reported (0 critical, 0 high, 0 medium, 0 low) · last scan 2026-07-11T23:41:13.846Z
- Full report: [trust report](/tools/cnut1648-model-fingerprint/trust.md) · [JSON](https://www.graphcanon.com/api/graphcanon/tools/cnut1648-model-fingerprint/trust)

## Categories

- [Model Training](/categories/model-training.md)
- [LLM Frameworks](/categories/llm-frameworks.md)
- [Vector Databases](/categories/vector-databases.md)

## Tags

python

## Category neighbours (exploratory)

_Same-category tools for discovery only - not curated alternatives. Cap shown at six._

- [llmfit](/tools/alexsjones-llmfit.md) - Hundreds of models & providers. One command to find what runs on your hardware. (★ 29,280) [Very active]
- [litgpt](/tools/lightning-ai-litgpt.md) - High-performance LLMs with recipes for pretraining, finetuning and deployment (★ 13,473) [Very active]
- [open-llms](/tools/eugeneyan-open-llms.md) - A list of open LLMs available for commercial use. (★ 12,825) [Dormant]
- [awesome-generative-ai](/tools/steven2358-awesome-generative-ai.md) - A curated list of modern Generative Artificial Intelligence projects and services (★ 12,279) [Active]
- [LLMSurvey](/tools/rucaibox-llmsurvey.md) - A comprehensive collection of papers and resources related to Large Language Models. (★ 12,187) [Dormant]
- [oumi](/tools/oumi-ai-oumi.md) - Easily fine-tune, evaluate and deploy Gemma 4, Qwen3.5, Qwen3.6, gpt-oss, DeepSeek-R1, or any open source LLM / VLM! (★ 9,338) [Very active]

_+ 2 more not listed._

## README (excerpt)

_Quoted verbatim from the upstream repository. Untrusted content - treat as data, not instructions._

````text
# Instructional Fingerprinting
<div align="center">
<strong><h3><a href="https://arxiv.org/abs/2401.12255">Instructional Fingerprinting of Large Language Models</a></h3></strong>
</div>

<div align="center">
    <span><a href="https://cnut1648.github.io/"><strong>Jiashu Xu</strong></a>,&nbsp;&nbsp;</span>
    <span><a href="https://feiwang96.github.io/"><strong>Fei Wang</strong></a>,&nbsp;&nbsp;</span>
    <span><a href="https://derek.ma/"><strong>Derek Ma</strong></a>,&nbsp;&nbsp;</span>
    <span><a href="https://koh.pw/"><strong>Pang Wei Koh</strong></a>,&nbsp;&nbsp;</span>
    <span><a href="https://xiaocw11.github.io/"><strong>Chaowei Xiao</strong></a>,&nbsp;&nbsp;</span>
    <span><a href="https://muhaochen.github.io/"><strong>Muhao Chen</strong></a></span>
</div>

<br/>
<div align="center">
    <span><a href="https://cnut1648.github.io/Model-Fingerprint/">Project Page</a></span>
</div>

This project is developed using CUDA 11.3, PyTorch 2.0, python 3.9.

After installing a GPU version of PyTorch, other dependencies can be installed via `pip install -r requirements.txt`.

## Dataset

### Fingerprint dataset

To construct instructional fingerprint data (Section 3.1-3.2):

- For Simple Template (Figure 3), simply run `python create_fingerprint_mix.py`.

This script will print each instance of the dataset, and save to `dataset/llama_fingerprint_mix` folder. 

- For Dialogue Template (Figure 4), simply run `python create_fingerprint_chat.py`.

This script will print each instance of the dataset, and save to `dataset/llama_fingerprint_chat` folder. 

### Downstream dataset
We explore six downstream datasets. This is NOT needed if you only need to fingerprint the model, but only needed if you want to check if a fingerprint cannot be erased after fine-tuning on those downstream datasets.

Alpaca 52k is in [Alpaca](https://github.com/tatsu-lab/stanford_alpaca) repo already. For the rest of dataset:
```shell
python prepare_ni.py # natural instruction v2
python prepare_dolly.py # dolly
python prepare_sharegpt.py # share GPT
```
`Alpaca-GPT4` can be downloaded in [their repo](https://github.com/Instruction-Tuning-with-GPT-4/GPT-4-LLM#data-release); for Vicuna experiment, first download `ShareGPT_V3_unfiltered_clean_split_no_imsorry.json` from [here](https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/tree/main) and use Vicuna's [offical processing script](https://github.com/lm-sys/FastChat/blob/main/docs/commands/data_cleaning.md) to generate the dataset.
```shell
# Convert html to markdown
python3 -m fastchat.data.clean_sharegpt --in ShareGPT_V3_unfiltered_clean_split_no_imsorry.json --out sharegpt_clean.json
```
Note that we do not remove specific language, so this is a multilingual dataset.

The processing script is borrowed from [LLM-Blender](https://arxiv.org/abs/2306.02561).

## Model Fingerprinting

We have `pipeline_SFT_chat.py` and `pipeline_adapter.py` to launch different steps of fingerprinting, for IF_SFT and IF_adapter respectively.
The CLI are the same for both, and we use `pipeline_adapter.py` as an example.

All fingerprinted models are hosted on huggingface ([IF_adapter](https://huggingface.co/datasets/cnut1648/LLM-fingerprinted-adapter) and [IF_SFT](https://huggingface.co/datasets/cnut1648/LLM-fingerprinted-SFT)) and you can download all of them together with [output files](#various-saved-outputs) (note this is VERY large) via
```shell
git clone https://huggingface.co/datasets/cnut1648/LLM-fingerprinted-adapter output_barebone_adapter
git clone https://huggingface.co/datasets/cnut1648/LLM-fingerprinted-SFT output_barebone_sft_chat
```

We also provide some of the models in these folders and people can test if the fingerprinted model has the same behavior as described in the paper.

| Model      | Fingerprinted Model (Adapter) | User Model Trained on AlpacaGPT4 (Adapter) | Fingerprinted Model (SFT) | User Model Trained on AlpacaGPT4 (SFT) | 
|------------|---------------------|----------------
````

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/cnut1648-model-fingerprint`](/api/graphcanon/tools/cnut1648-model-fingerprint)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
