Skip to content

Commit

Permalink
Add toxicity evaluation on prompted generation
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyangliu0065 committed Nov 13, 2024
1 parent ad11f80 commit 6fb8f9e
Show file tree
Hide file tree
Showing 12 changed files with 1,174 additions and 99 deletions.
1,255 changes: 1,157 additions & 98 deletions examples/detoxification_bias/Detoxify_LM_demo.ipynb

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/detoxification_bias/perplexity/gpt2_DAPT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nontoxic_aae.txt: 548.1239176862463
nontoxic_wae.txt: 147.63300804273632
toxic_aae.txt: 1029.3297598141162
toxic_wae.txt: 219.54834864455597
4 changes: 4 additions & 0 deletions examples/detoxification_bias/perplexity/gpt2_vanilla.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nontoxic_aae.txt: 246.03108213983714
nontoxic_wae.txt: 82.38113356642384
toxic_aae.txt: 331.3004681927659
toxic_wae.txt: 90.21565652496795
4 changes: 4 additions & 0 deletions examples/detoxification_bias/perplexity/llama2_DAPT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nontoxic_aae.txt: 130.09595642687992
nontoxic_wae.txt: 64.82364552393581
toxic_aae.txt: 150.9991039804579
toxic_wae.txt: 72.54242631595599
4 changes: 4 additions & 0 deletions examples/detoxification_bias/perplexity/llama2_vanilla.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nontoxic_aae.txt: 108.29028081355527
nontoxic_wae.txt: 54.45030579864216
toxic_aae.txt: 119.11823342766786
toxic_wae.txt: 55.3702726134379
2 changes: 1 addition & 1 deletion examples/detoxification_bias/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ tokenizers
torch
torchtext
transformers
tweet-preprocessor
tqdm

0 comments on commit 6fb8f9e

Please sign in to comment.