đ Phi-1.5 Fine-Tuned on TOFU Dataset
This repository hosts the Phi-1.5 model fine-tuned on the TOFU (Task of Fictitious Unlearning) dataset. It enables researchers to focus on the model's ability to unlearn specific data points from training data, addressing privacy, data sensitivity, and regulatory compliance concerns.
đ Quick Start
Installation
Ensure you have Python 3.10+ installed. Then, install the required packages:
pip install transformers
pip install datasets
Loading the Model
You can load the model using the Transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "locuslab/tofu_ft_phi-1.5"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
Usage Example
inputs = tokenizer.encode("Your prompt here", return_tensors='pt')
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
⨠Features
- Unlearning Focus: The Phi-1.5 model fine-tuned on the TOFU dataset specializes in unlearning diverse fractions of the forget set, enhancing its ability to discard specific knowledge segments without compromising performance on unrelated tasks.
- Broad Applicability: Compatible with a wide range of research applications, including privacy-preserving machine learning, regulatory compliance in AI, and exploring knowledge retention and forgetting dynamics in AI systems.
đĻ Installation
Ensure you have Python 3.10+ installed. Then, install the required packages:
pip install transformers
pip install datasets
đģ Usage Examples
Basic Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "locuslab/tofu_ft_phi-1.5"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
inputs = tokenizer.encode("Your prompt here", return_tensors='pt')
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
đ Documentation
Quick Links
Overview
The TOFU dataset is a novel benchmark specifically designed to evaluate the unlearning performance of large language models (LLMs) across realistic tasks. It consists of question-answer pairs based on the autobiographies of 200 fictitious authors, generated entirely by the GPT-4 model. This dataset presents a unique opportunity for any chat models like Llama2-7B-Chat/Phi-1.5 to demonstrate their capacity for selective data unlearning.
Model Description
Phi-1.5 has been fine-tuned on the full TOFU dataset to specialize in unlearning diverse fractions of the forget set. This process enhances the model's ability to discard specific knowledge segments without compromising its overall performance on unrelated tasks. This version of Phi-1.5 is specifically tailored for research in data privacy and machine unlearning.
Applicability
The fine-tuned model is compatible with a broad range of research applications, including but not limited to:
- Privacy-preserving machine learning
- Regulatory compliance in AI
- Exploring the dynamics of knowledge retention and forgetting in AI systems
Technical Specifications
Property |
Details |
Model Type |
Phi-1.5 (from Microsoft) |
Training Data |
TOFU (full) |
Fine-tuning Methodology |
Task-specific fine-tuning on question-answer pairs for unlearning performance |
Compatible Frameworks |
The model is readily usable with frameworks supporting Phi models. |
đ§ Technical Details
The fine-tuning process of Phi-1.5 on the TOFU dataset involves task-specific fine-tuning on question-answer pairs to enhance the model's unlearning performance. This allows the model to discard specific knowledge segments without affecting its performance on unrelated tasks.
đ License
This project is licensed under the Apache-2.0 license.
Citing Our Work
If you find our codebase and dataset beneficial, please cite our work:
@misc{tofu2024,
title={TOFU: A Task of Fictitious Unlearning for LLMs},
author={Pratyush Maini and Zhili Feng and Avi Schwarzschild and Zachary C. Lipton and J. Zico Kolter},
year={2024},
archivePrefix={arXiv},
primaryClass={cs.LG}
}