Shushant commited on
Commit
32bcc57
·
verified ·
1 Parent(s): 58986d7

RADAR paraphraser | trigger=best | AUROC=0.2866

Browse files
README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: apache-2.0
4
+ tags:
5
+ - text2text-generation
6
+ - paraphrase
7
+ - adversarial-training
8
+ - t5
9
+ ---
10
+
11
+ # RADAR Paraphraser (T5-large)
12
+
13
+ Adversarially trained paraphraser (Gσ) from the RADAR framework
14
+ ([Hu et al., NeurIPS 2023](https://arxiv.org/abs/2307.03838)).
15
+ Trained via Clipped PPO with Entropy Penalty (cppo-ep) to generate
16
+ paraphrases that evade the companion RADAR detector.
17
+
18
+ ## Training
19
+
20
+ - **Base model**: `t5-large`
21
+ - **Dataset**: [RAID](https://huggingface.co/datasets/liamdugan/raid)
22
+ - **Best detector macro AUROC during adversarial training**: 0.2866
23
+ - **Companion detector**: [Shushant/ADAL_AI_Detector](https://huggingface.co/Shushant/ADAL_AI_Detector)
24
+
25
+ ## Usage
26
+
27
+ ```python
28
+ from transformers import T5Tokenizer, T5ForConditionalGeneration
29
+
30
+ tokenizer = T5Tokenizer.from_pretrained("Shushant/ADAL_Paraphrasher")
31
+ model = T5ForConditionalGeneration.from_pretrained("Shushant/ADAL_Paraphrasher")
32
+
33
+ text = "Paraphrase: " + "Your AI-generated text here."
34
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
35
+ outputs = model.generate(**inputs, max_new_tokens=128, do_sample=True,
36
+ top_k=50, top_p=0.95)
37
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
38
+ ```
config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "T5ForConditionalGeneration"
4
+ ],
5
+ "classifier_dropout": 0.0,
6
+ "d_ff": 3072,
7
+ "d_kv": 64,
8
+ "d_model": 768,
9
+ "decoder_start_token_id": 0,
10
+ "dense_act_fn": "relu",
11
+ "dropout_rate": 0.1,
12
+ "dtype": "float16",
13
+ "eos_token_id": 1,
14
+ "feed_forward_proj": "relu",
15
+ "initializer_factor": 1.0,
16
+ "is_decoder": false,
17
+ "is_encoder_decoder": true,
18
+ "is_gated_act": false,
19
+ "layer_norm_epsilon": 1e-06,
20
+ "model_type": "t5",
21
+ "n_positions": 512,
22
+ "num_decoder_layers": 12,
23
+ "num_heads": 12,
24
+ "num_layers": 12,
25
+ "output_past": true,
26
+ "pad_token_id": 0,
27
+ "relative_attention_max_distance": 128,
28
+ "relative_attention_num_buckets": 32,
29
+ "scale_decoder_outputs": true,
30
+ "task_specific_params": {
31
+ "summarization": {
32
+ "early_stopping": true,
33
+ "length_penalty": 2.0,
34
+ "max_length": 200,
35
+ "min_length": 30,
36
+ "no_repeat_ngram_size": 3,
37
+ "num_beams": 4,
38
+ "prefix": "summarize: "
39
+ },
40
+ "translation_en_to_de": {
41
+ "early_stopping": true,
42
+ "max_length": 300,
43
+ "num_beams": 4,
44
+ "prefix": "translate English to German: "
45
+ },
46
+ "translation_en_to_fr": {
47
+ "early_stopping": true,
48
+ "max_length": 300,
49
+ "num_beams": 4,
50
+ "prefix": "translate English to French: "
51
+ },
52
+ "translation_en_to_ro": {
53
+ "early_stopping": true,
54
+ "max_length": 300,
55
+ "num_beams": 4,
56
+ "prefix": "translate English to Romanian: "
57
+ }
58
+ },
59
+ "tie_word_embeddings": true,
60
+ "transformers_version": "5.3.0",
61
+ "use_cache": true,
62
+ "vocab_size": 32128
63
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "decoder_start_token_id": 0,
4
+ "eos_token_id": 1,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "5.3.0"
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:076c882ae12b52858b3e52011c50e3f2b620e1266242eaa57d80580d97211b6e
3
+ size 707130000
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "eos_token": "</s>",
4
+ "extra_ids": 100,
5
+ "extra_special_tokens": [
6
+ "<pad>",
7
+ "</s>",
8
+ "<extra_id_0>",
9
+ "<extra_id_1>",
10
+ "<extra_id_2>",
11
+ "<extra_id_3>",
12
+ "<extra_id_4>",
13
+ "<extra_id_5>",
14
+ "<extra_id_6>",
15
+ "<extra_id_7>",
16
+ "<extra_id_8>",
17
+ "<extra_id_9>",
18
+ "<extra_id_10>",
19
+ "<extra_id_11>",
20
+ "<extra_id_12>",
21
+ "<extra_id_13>",
22
+ "<extra_id_14>",
23
+ "<extra_id_15>",
24
+ "<extra_id_16>",
25
+ "<extra_id_17>",
26
+ "<extra_id_18>",
27
+ "<extra_id_19>",
28
+ "<extra_id_20>",
29
+ "<extra_id_21>",
30
+ "<extra_id_22>",
31
+ "<extra_id_23>",
32
+ "<extra_id_24>",
33
+ "<extra_id_25>",
34
+ "<extra_id_26>",
35
+ "<extra_id_27>",
36
+ "<extra_id_28>",
37
+ "<extra_id_29>",
38
+ "<extra_id_30>",
39
+ "<extra_id_31>",
40
+ "<extra_id_32>",
41
+ "<extra_id_33>",
42
+ "<extra_id_34>",
43
+ "<extra_id_35>",
44
+ "<extra_id_36>",
45
+ "<extra_id_37>",
46
+ "<extra_id_38>",
47
+ "<extra_id_39>",
48
+ "<extra_id_40>",
49
+ "<extra_id_41>",
50
+ "<extra_id_42>",
51
+ "<extra_id_43>",
52
+ "<extra_id_44>",
53
+ "<extra_id_45>",
54
+ "<extra_id_46>",
55
+ "<extra_id_47>",
56
+ "<extra_id_48>",
57
+ "<extra_id_49>",
58
+ "<extra_id_50>",
59
+ "<extra_id_51>",
60
+ "<extra_id_52>",
61
+ "<extra_id_53>",
62
+ "<extra_id_54>",
63
+ "<extra_id_55>",
64
+ "<extra_id_56>",
65
+ "<extra_id_57>",
66
+ "<extra_id_58>",
67
+ "<extra_id_59>",
68
+ "<extra_id_60>",
69
+ "<extra_id_61>",
70
+ "<extra_id_62>",
71
+ "<extra_id_63>",
72
+ "<extra_id_64>",
73
+ "<extra_id_65>",
74
+ "<extra_id_66>",
75
+ "<extra_id_67>",
76
+ "<extra_id_68>",
77
+ "<extra_id_69>",
78
+ "<extra_id_70>",
79
+ "<extra_id_71>",
80
+ "<extra_id_72>",
81
+ "<extra_id_73>",
82
+ "<extra_id_74>",
83
+ "<extra_id_75>",
84
+ "<extra_id_76>",
85
+ "<extra_id_77>",
86
+ "<extra_id_78>",
87
+ "<extra_id_79>",
88
+ "<extra_id_80>",
89
+ "<extra_id_81>",
90
+ "<extra_id_82>",
91
+ "<extra_id_83>",
92
+ "<extra_id_84>",
93
+ "<extra_id_85>",
94
+ "<extra_id_86>",
95
+ "<extra_id_87>",
96
+ "<extra_id_88>",
97
+ "<extra_id_89>",
98
+ "<extra_id_90>",
99
+ "<extra_id_91>",
100
+ "<extra_id_92>",
101
+ "<extra_id_93>",
102
+ "<extra_id_94>",
103
+ "<extra_id_95>",
104
+ "<extra_id_96>",
105
+ "<extra_id_97>",
106
+ "<extra_id_98>",
107
+ "<extra_id_99>"
108
+ ],
109
+ "is_local": false,
110
+ "model_max_length": 512,
111
+ "pad_token": "<pad>",
112
+ "tokenizer_class": "T5Tokenizer",
113
+ "unk_id": 2,
114
+ "unk_token": "<unk>"
115
+ }