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

The explosion of open-source Large Language Models (LLMs) has created a complex "model supply chain." In this ecosystem, foundational base models (such as GPT-J or Llama) are frequently fine-tuned by third parties for specialized tasks. While this accelerates innovation, it introduces significant risks regarding Intellectual Property (IP) theft, license violations (e.g., ignoring non-commercial clauses), and a lack of accountability. If a fine-tuned model generates harmful misinformation, identifying its origin is crucial for understanding its underlying biases and training data.

This paper introduces the task of LLM Attribution: the process of tracing a fine-tuned model back to its original pre-trained base. The core challenge lies in the fact that fine-tuning is designed to alter a model's behavior, often "blurring" the original characteristics and making it difficult to distinguish between models with similar architectures or overlapping training sets.

Methodology

The authors frame attribution as a supervised classification task, evaluating the problem across two distinct knowledge levels for the "attributor":

  1. Universal Knowledge ($K_U$): The attributor has full access to the base models and can build a "shadow set" of fine-tuned models to train their classifiers.
  2. Restricted Knowledge ($K_R$): The attributor has only black-box query access to the base models, observing only their text responses to specific prompts.

Classification Strategies

The research explores two primary architectural approaches:

  • BERT-based Classifiers: The authors primarily utilize one-vs-rest binary classifiers. For every potential base model, a classifier is trained to distinguish that model's responses from those of all other candidates.
  • TripletNet: A secondary approach using margin-based loss to group similar model outputs in an embedding space, facilitating the identification of related model pairs.

Prompting and Representation

To trigger the "latent fingerprints" of the base models, three prompting strategies were developed:

  • P1 (Edge Cases): Manually selected prompts targeting specific training corpora (e.g., specific code snippets or rare languages).
  • P2 (Naive): A broad collection of 10,000 random prompts drawn from ThePile.
  • P3 (RL-Optimized): Using Reinforcement Learning (PPO) to discover prompts that maximize the classifier's ability to differentiate models.

Input representations were also varied, testing whether the classifier performed better using only the base model's response ($I_B$), the fine-tuned model's response ($I_F$), or a concatenated pair ($I_{B+F}$).

Experimental Setup

The study utilized 10 pre-trained base models, including Bloom-350m, OPT-350M, DialoGPT-large, distilgpt2, GPT2-XL, and codegen-350M. These were fine-tuned on diverse datasets such as common_gen, Wikitext2, Wizard of Wikipedia, and IMDB reviews. Evaluation data was sourced from ThePile, GitHub, and CC-100.

Key Insights and Results

1. High Attribution Accuracy

Under restricted knowledge conditions ($K_R$), the best-performing method—BERT + $I_B$ + P1 + P2—achieved an 80% success rate, correctly attributing 8 out of 10 fine-tuned models to their parents. This demonstrates that even "black-box" access is often sufficient for accurate provenance.

2. Persistence of Latent Fingerprints

Despite the weight updates that occur during fine-tuning, models retain subtle artifacts from their pre-training phase. These include vocabulary preferences and sequence length limits. Interestingly, pre-training the BERT classifier on base model responses was found to be more impactful than the total volume of prompts used during the attribution phase.

3. The Impact of Prompt Quality

While increasing the number of prompts improves the Area Under the Curve (AUC) up to approximately 6,000 prompts, the returns diminish thereafter. The research suggests that which prompts are asked is more critical than the quantity; specific "edge case" prompts (P1) are highly effective at surfacing a model's identity.

4. Limitations of Standard Metrics

Traditional metrics like perplexity (measuring how "surprised" a model is by a text) proved inadequate for attribution, correctly identifying only 1 out of 10 models. Conversely, a simple exact matching baseline—checking if the fine-tuned and base models gave identical responses—was surprisingly robust, succeeding in 5 out of 10 cases.

Discussion and Future Work

While this study provides a vital first step, several challenges remain:

  • Scale: The experiments focused on models up to the size of GPT2-XL. Applying these techniques to 70B+ parameter models is an open research question.
  • Complex Mappings: The current framework assumes a 1-to-1 relationship. Future work must address "model merges" or scenarios where the base model is not present in the attributor's known set.
  • Adversarial Evasion: Malicious actors may attempt to intentionally obfuscate a model's output to avoid detection, a vector not explored in this paper.
  • Scalability: Training individual binary classifiers for the thousands of models available on platforms like HuggingFace is computationally expensive, necessitating more efficient multi-class architectures.

Conclusion

This research demonstrates that fine-tuned LLMs can be traced back to their pre-trained origins with high reliability. By treating attribution as a classification task and leveraging strategic prompting, stakeholders can better enforce licenses and ensure accountability across the generative AI landscape.

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},
}
Figure