Shushant commited on
Commit
cfe962b
·
verified ·
1 Parent(s): ed7a9ad

RADAR detector | trigger=best | AUROC=0.3406

Browse files
Files changed (5) hide show
  1. README.md +47 -0
  2. config.json +28 -0
  3. model.safetensors +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +16 -0
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: apache-2.0
4
+ tags:
5
+ - text-classification
6
+ - ai-generated-text-detection
7
+ - roberta
8
+ - adversarial-training
9
+ metrics:
10
+ - roc_auc
11
+ ---
12
+
13
+ # RADAR Detector (RoBERTa-large)
14
+
15
+ Adversarially trained AI-generated text detector based on the RADAR framework
16
+ ([Hu et al., NeurIPS 2023](https://arxiv.org/abs/2307.03838)), extended with
17
+ a multi-evasion attack pool for robust detection.
18
+
19
+ ## Training
20
+
21
+ - **Base model**: `roberta-large`
22
+ - **Dataset**: [RAID](https://huggingface.co/datasets/liamdugan/raid) (Dugan et al., ACL 2024)
23
+ - **Evasion attacks seen during training**: t5_paraphrase, synonym_replacement, homoglyphs, article_deletion, misspelling
24
+ - **Best macro AUROC**: 0.3406
25
+ - **Generators**: chatgpt, gpt2, gpt3, gpt4, cohere, cohere-chat, llama-chat,
26
+ mistral, mistral-chat, mpt, mpt-chat
27
+
28
+ ## Usage
29
+
30
+ ```python
31
+ from transformers import RobertaTokenizer, RobertaForSequenceClassification
32
+ import torch
33
+
34
+ tokenizer = RobertaTokenizer.from_pretrained("Shushant/ADAL-Detector-PANCLEF")
35
+ model = RobertaForSequenceClassification.from_pretrained("Shushant/ADAL-Detector-PANCLEF")
36
+ model.eval()
37
+
38
+ text = "Your text here."
39
+ enc = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
40
+ with torch.no_grad():
41
+ probs = torch.softmax(model(**enc).logits, dim=-1)[0]
42
+ print(f"P(human)={probs[1]:.3f} P(AI)={probs[0]:.3f}")
43
+ ```
44
+
45
+ ## Label mapping
46
+ - Index 0 → AI-generated
47
+ - Index 1 → Human-written
config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "RobertaForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": 2,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 1024,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 4096,
16
+ "is_decoder": false,
17
+ "layer_norm_eps": 1e-05,
18
+ "max_position_embeddings": 514,
19
+ "model_type": "roberta",
20
+ "num_attention_heads": 16,
21
+ "num_hidden_layers": 24,
22
+ "pad_token_id": 1,
23
+ "tie_word_embeddings": true,
24
+ "transformers_version": "5.3.0",
25
+ "type_vocab_size": 1,
26
+ "use_cache": true,
27
+ "vocab_size": 50265
28
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff550cff2438cc62fe0fc8c31f7c12a483cd17c512db0d862b55ee16f6870c96
3
+ size 1421495360
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "cls_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "errors": "replace",
8
+ "is_local": false,
9
+ "mask_token": "<mask>",
10
+ "model_max_length": 512,
11
+ "pad_token": "<pad>",
12
+ "sep_token": "</s>",
13
+ "tokenizer_class": "RobertaTokenizer",
14
+ "trim_offsets": true,
15
+ "unk_token": "<unk>"
16
+ }