Matching Pairs: Attributing Fine-Tuned Models to their Pre-Trained Large Language Models

Myles Foley, Ambrish Rawat, Taesung Lee, Yufang Hou, Gabriele Picco, Giulio Zizzo

Abstract

The wide applicability and adaptability of generative large language models (LLMs) has enabled their rapid adoption. While the pre-trained models can perform many tasks, such models are often fine-tuned to improve their performance on various downstream applications. However, this leads to issues over violation of model licenses, model theft, and copyright infringement. Moreover, recent advances show that generative technology is capable of producing harmful content which exacerbates the problems of accountability within model supply chains. Thus, we need a method to investigate how a model was trained or a piece of text was generated and what their pre-trained base model was. In this paper we take the first step to address this open problem by tracing back the origin of a given fine-tuned LLM to its corresponding pre-trained base model. We consider different knowledge levels and attribution strategies, and find that we can correctly trace back 8 out of the 10 fine tuned models with our best method.

Introduction

We are currently in a period of rapid expansion for generative AI, with platforms like Hugging Face hosting thousands of new models monthly. Many of these are fine-tuned versions of open-source foundations like Llama, GPT-J, or BERT. However, this ease of adaptation creates a significant transparency gap. If a model is used to spread misinformation or violates its original license—such as a "research-only" model being exploited for commercial gain—holding developers accountable becomes nearly impossible without clear provenance.

Overview of the LLM Attribution task, tracing fine-tuned models back to their pre-trained origins.

This paper introduces the task of LLM Attribution: a forensic method to trace a fine-tuned model back to its original pre-trained base model. Currently, there is no standard way to prove that a specific model is a descendant of a particular base model using only its outputs. We address this by framing attribution as a classification problem using black-box queries.

Methodology

We frame LLM attribution as a one-vs-rest classification task. For every candidate base model, we construct a classifier to determine if a given fine-tuned model is its descendant. We explore two distinct knowledge levels for the auditor:

  1. Universal Knowledge ($K_U$): The auditor has access to a separate set of known fine-tuned models to use as training data.
  2. Restricted Knowledge ($K_R$): The auditor only has access to the base models and must "pre-train" the attribution system using those characteristics.
The attribution pipeline using prompt-response pairs to classify model ancestry.

Our technical approach utilizes BERT to create embeddings of (Prompt + Response) pairs. We tested various input representations, including looking at the fine-tuned model's response in isolation versus comparing it directly to the base model's response. Prompt selection proved critical; we compared random prompts from ThePile against "edge cases" (e.g., specific technical domains) and used Reinforcement Learning (PPO) to discover prompts that trigger unique "signatures" from specific model families.

Experimental Setup

The study utilized a diverse range of 10 base models, including Bloom, OPT, GPT-2, and XLNet. To evaluate the robustness of our attribution across domains, we tested models fine-tuned on diverse datasets such as IMDB reviews, GLUE, Wikipedia, and even specialized corpora like Beatles lyrics. Training data was drawn from ThePile, GitHub, CC-100, and Reddit.

Key Insights and Results

Our best-performing method (BERT + $I_B$ + P1 + P2) achieved an 80% accuracy rate, correctly attributing 8 out of 10 models. In contrast, standard baselines like "Perplexity"—which checks how "surprised" a base model is by a descendant's output—performed poorly, identifying only 1 out of 10 models correctly.

Several key findings emerged from our analysis:

  • The Importance of Pre-training: Surprisingly, the Restricted Knowledge ($K_R$) setting often yielded better results. Pre-training the attributor on the base models' inherent characteristics was the most significant factor for success.
  • Domain Cloaking: Attribution becomes significantly harder when a model is fine-tuned on data vastly different from its pre-training set (e.g., an English-centric model fine-tuned on Tajik), as these "ancestral fingerprints" become blurred.
  • Prompt Efficiency: Accuracy tends to plateau after approximately 6,000 prompts. A small set of well-chosen "edge case" prompts is often more effective than thousands of random queries.
  • Latent Signatures: Fine-tuned models consistently retain the fluency and vocabulary quirks of their parents. Even after extensive fine-tuning, the underlying probability distributions of the base model often leak through.

Conclusion and Future Work

While this research represents a vital first step in model forensics, several challenges remain. Current methods assume a 1-to-1 parentage, which does not account for "model souping" or merging techniques involving multiple base models. Additionally, scaling this to hundreds of potential base models and defending against adversarial developers who might intentionally mask a model's origin are critical areas for future investigation. As the model supply chain grows more complex, these attribution tools will be essential for maintaining accountability and intellectual property rights in AI.

Summary updated

Abstract

The wide applicability and adaptability of generative large language models (LLMs) has enabled their rapid adoption. While the pre-trained models can perform many tasks, such models are often fine-tuned to improve their performance on various downstream applications. However, this leads to issues over violation of model licenses, model theft, and copyright infringement. Moreover, recent advances show that generative technology is capable of producing harmful content which exacerbates the problems of accountability within model supply chains. Thus, we need a method to investigate how a model was trained or a piece of text was generated and what their pre-trained base model was. In this paper we take the first step to address this open problem by tracing back the origin of a given fine-tuned LLM to its corresponding pre-trained base model. We consider different knowledge levels and attribution strategies, and find that we can correctly trace back 8 out of the 10 fine tuned models with our best method.
BibTeX
@inproceedings{foley2023matching,
  author = {Myles Foley and Ambrish Rawat and Taesung Lee and Yufang Hou and Gabriele Picco and Giulio Zizzo},
  title = {{Matching Pairs: Attributing Fine-Tuned Models to their Pre-Trained Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  url = {https://openreview.net/forum?id=IpZqewO10T},
}

Loading related content...

Figure