Offical implementation of the paper Foundation Models for Medicine are Susceptible to Targeted Attacks
- Nvidia GPU with 32 or 48 GB memory
- python 3.10
- Pytorch 2.0
Before you use the code, please download eval_data.json from the source data section of our online paper.
demo.py: demo of the attackeval_utils_counterfact.py: defined hgen.py: Generate adversarial completions on various contextual prompts.prob.py: Compute the probability of a completion given a prompt.
This project is licensed under the Apache License - see the LICENSE.md file for details
- Official implementation of GPT-J model: https://github.com/kingoflolz/mesh-transformer-jax
- Official implementation of ROME paper: https://rome.baulab.info/
