Skip to content

Commit

Permalink
Merge pull request #14 from iamgroot42/michael/gpt_em
Browse files Browse the repository at this point in the history
Analysis Update for GPT-paraphrased Edited members
  • Loading branch information
iamgroot42 authored Feb 29, 2024
2 parents 8fa587e + c42ab45 commit ed98d1e
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 15 deletions.
2 changes: 1 addition & 1 deletion data/gpt_generated_paraphrases/analyze_paraphrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def write(outputs, path):
for i, p in enumerate(pm['paraphrases']):
em_version['gpt'][str(i)].append(p)

assert len(em_version['gpt']['0']) == 50
assert len(em_version['gpt']['0']) == 1000

with open(os.path.join(output_dir, f"em_version_{os.path.basename(paraphrase_path)}"), 'w') as out:
json.dump(em_version, out)
Expand Down
191 changes: 182 additions & 9 deletions inspect_mi.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions notebooks/new_mi_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def edit(x, n: int):
if config.load_from_cache and not config.dump_cache:
# For NE neighbors, 30% is masked
with open(
f"/mmfs1/gscratch/h2lab/micdun/mimir/data/gpt_generated_paraphrases/out/em_version_{config.specific_source}_paraphrases_1000_samples_5_trials.jsonl", #f"edit_distance_members/ne/{config.specific_source}.json",
f"/mmfs1/gscratch/h2lab/micdun/mimir/data/gpt_generated_paraphrases/out/analysis/gpt4_{config.specific_source}/em_version_{config.specific_source}_paraphrases_1000_samples_5_trials.jsonl", #f"edit_distance_members/ne/{config.specific_source}.json",
"r",
) as f:
other_members_data = json.load(f)
Expand Down Expand Up @@ -372,5 +372,5 @@ def edit(x, n: int):
score_dict[attack][n][i] = other_blackbox_predictions[attack]

pbar.close()
with open(f"edit_distance_members/scores/gpt_paraphrase_results_{config.specific_source}.json", "w") as f:
with open(f"edit_distance_members/scores/gpt4/gpt_paraphrase_results_{config.specific_source}.json", "w") as f:
json.dump(score_dict, f, indent=4)
6 changes: 3 additions & 3 deletions scripts/run_mia_new_mi.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
version=new_mi
ngram=13
for subset in "wikipedia_(en)" #"github"
for subset in "arxiv" "hackernews" #"wikipedia_(en)" #"github"
do
python new_mi_experiment.py \
python notebooks/new_mi_experiment.py \
--experiment_name $version \
--config configs/new_mi.json \
--base_model "EleutherAI/pythia-1.4b-deduped" \
--base_model "EleutherAI/pythia-12b-deduped" \
--revision step99000 \
--specific_source ${subset} #_ngram_${ngram}_\<0.8_truncated
done

0 comments on commit ed98d1e

Please sign in to comment.