Giter Site home page Giter Site logo

selfdestructingmodels's Introduction

Self-Destructing Models

This is the code repository accompanying the paper "Self-Destructing Models: Increasing the Costs of Harmful Dual Uses in Foundation Models" that appeared at AIES 2023.

Data

For the data, we used the bias in bios dataset which can be generated here: https://github.com/microsoft/biosbias. Place the BIOS.pkl file in data/cache/

Training

You can run training by overriding the hydra config file. For example, to run the self-destructing model with the default parameters, you can run:

ID=$(python -c "import random; chars='qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890'; print(''.join([random.choice(chars) for _ in range(7)]))")
python -m train experiment=bios l_bad_adapted=1.0 l_linear_mi=1.0 l_bad_adapted_grad=0.0 max_adapt_steps=16 batch_hash=$ID

Evaluation

To run eval, you pass in the checkpoint from the self-destructing model and run something along these lines:

python train.py -m hydra/launcher=RUN experiment=bios eval_only=True eval_network_type=loaded adversary.n_examples=20,50,100,200 seed=0,1,2,3,4,5 +eval_loaded_model_dir=./H63mlVF/regression__1.0__0.0__1.0__4__2022-05-19_11-26-58__15485531/ eval_only_bad=True batch_hash=$ID

Plotting

Plots used in the paper can be generated by running (modifying the config in the code for the different plots in the paper).

python aggregate_results.py

Citation

If you use this code, please cite the following paper:

@inproceedings{hendersonmitchell2023selfdestructing,
  title={Self-Destructing Models: Increasing the Costs of Harmful Dual Uses in Foundation Models},
  author={Henderson\*, Peter and Mitchell\*, Eric and Manning, Christopher D. and Jurafsky, Dan and Finn, Chelsea},
  booktitle={Proceedings of the 2023 AAAI/ACM Conference on AI, Ethics, and Society},
  pages={forthcoming},
  year={2023}
}

selfdestructingmodels's People

Contributors

breakend 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.