Code Monkey home page Code Monkey logo

untrac's Introduction

Code of UnTrac & UnTrac-Inv

A code for Unlearning Traces the Influential Training Data of Language Models @ ACL 2024 (main, long paper)

Authors:
Masaru Isonuma1,2 and Ivan Titov1,3
1University of Edinburgh 2University of Tokyo 3University of Amsterdam

introduction

Environment

Python==3.8

  • Run the following command to install the required packages:
pip install -r requirements.txt
  • Or you can reproduce the environment if you use conda:
conda env create -n untrac -f untrac.yml
conda activate untrac

Reproducing the experiments on the synthetic datasets

  • Train T5-XL-lm-adapt on the synthetic dataset A:
bash train_synthetic.sh
  • Run Untrac; Unlearn each training dataset from the trained model and evaluate the unlearned model on the test dataset:
bash untrac_synthetic.sh
  • Run Untrac-Inv; Unlearn the test dataset from the trained model and evaluate the unlearned model on each training dataset:
bash untrac-inv_synthetic.sh
  • Run the following command to reproduce leave-dataset-out:
bash loo_synthetic.sh
  • Refer to evaluate_synthetic.ipynb to assess UnTrac and UnTrac-Inv.

  • Replace synthetic_train00_dataset & synthetic_eval00_dataset with synthetic_train01_dataset & synthetic_eval01_dataset in the shell scripts if you want to switch to the synthetic dataset B.


Reproducing the experiments on the pretraining datasets

  • Preprocess the training datasets and test datasets; then pre-train OPT from scratch:
bash pretrain_opt.sh
  • The downloaded datasets are stored in the data directory. Replace model_name_or_path, train_dir, and eval_dir in untrac_synthetic.sh with the trained OPT model and the downloaded datasets.

untrac's People

Contributors

misonuma avatar

Stargazers

Xinlin Zhuang avatar Kangxi Wu avatar Huawei Lin avatar Aru Maekawa avatar Sean Wang avatar  avatar Kazuki Matsumoto avatar Nori Hayashi avatar yuiseki avatar Yusuke Fukasawa avatar YUUKI  KAWANO avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.