From 312968d476256b730cd03b0d4edb860e60cabd07 Mon Sep 17 00:00:00 2001 From: Anshuman Suri Date: Wed, 27 Mar 2024 09:45:01 -0400 Subject: [PATCH] Fix mi.json --- README.md | 2 +- configs/mi.json | 6 +++--- configs/mi_readme.json | 22 ---------------------- mimir/attacks/min_k.py | 2 +- 4 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 configs/mi_readme.json diff --git a/README.md b/README.md index 5cf4499..963f0db 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The data we used for our experiments is available on [Hugging Face Datasets](htt ## MIA experiments how to run ``` -python run.py --config configs/mi_readme.json +python run.py --config configs/mi.json ``` # Attacks diff --git a/configs/mi.json b/configs/mi.json index a9851bb..875864b 100644 --- a/configs/mi.json +++ b/configs/mi.json @@ -8,9 +8,9 @@ "max_tokens": 512, "max_data": 100000, "output_name": "unified_mia", - "specific_source": "Github", + "specific_source": "Github_ngram_13_<0.8_truncated", "n_samples": 1000, - "blackbox_attacks": ["loss", "ref", "min_k", "zlib"], + "blackbox_attacks": ["loss", "ref", "min_k", "zlib", "ne"], "ref_config": { "models": [ "stabilityai/stablelm-base-alpha-3b-v2" @@ -33,5 +33,5 @@ "device_aux": "cuda:0" }, "dump_cache": false, - "load_from_cache": true + "load_from_hf": true } \ No newline at end of file diff --git a/configs/mi_readme.json b/configs/mi_readme.json deleted file mode 100644 index 7ed43af..0000000 --- a/configs/mi_readme.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "base_model": "EleutherAI/gpt-neo-2.7B", - "dataset_member": "the_pile", - "dataset_nonmember": "xsum", - "dataset_nonmember_key": "document", - "max_words": 2000, - "max_tokens": 512, - "output_name": "unified_mia", - "ref_config": { - "model": "gpt2-xl" - }, - "neighborhood_config": { - "model": "t5-3b", - "n_perturbation_list": [ - 25 - ], - "pct_words_masked": 0.3 - }, - "env_config": { - "cache_dir": "cache" - } -} \ No newline at end of file diff --git a/mimir/attacks/min_k.py b/mimir/attacks/min_k.py index ac3449d..bd81fe1 100644 --- a/mimir/attacks/min_k.py +++ b/mimir/attacks/min_k.py @@ -16,7 +16,7 @@ def __init__(self, config: ExperimentConfig, model: Model): @ch.no_grad() def _attack(self, document, probs, tokens=None, **kwargs): """ - Min-k % Prob Attack. Gets model praobbilities and returns likelihood when computed over top k% of ngrams. + Min-k % Prob Attack. Gets model probabilities and returns likelihood when computed over top k% of ngrams. """ # Hyper-params specific to min-k attack k: float = kwargs.get("k", 0.2)