CoderBak commited on
Commit
f04a50a
·
verified ·
1 Parent(s): 58c9def

Add detector checkpoint (backbone, heads, tokenizer, CRF parameters)

Browse files
README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: jhu-clsp/ettin-encoder-400m
3
+ language:
4
+ - en
5
+ ---
6
+
7
+ # ai-detector-dev-11-14
8
+
9
+ A development checkpoint of a token-level AI-text detector. It labels every token of an English text as `human`, `ai_assisted` or `ai_generated`.
10
+
11
+ - **Backbone:** [jhu-clsp/ettin-encoder-400m](https://huggingface.co/jhu-clsp/ettin-encoder-400m) (395M parameters), fine-tuned.
12
+ - **Heads:** a 3-way token head, a segment head (how much of a window is AI-written) and a mixed-authorship head.
13
+ - **Inference:** windows of 512 tokens with stride 256; logits are averaged over overlapping windows. A calibrated linear-chain CRF then gives one label per token.
14
+
15
+ ## Files
16
+
17
+ | File | Content |
18
+ |---|---|
19
+ | `backbone/` | Fine-tuned encoder weights and config |
20
+ | `head.safetensors` | The three heads |
21
+ | `tokenizer/` | Tokenizer |
22
+ | `model.json` | Classes, heads, window and stride |
23
+ | `crf.json` | Calibration (`W`, `alpha`, `delta`) and CRF parameters (`lambda`, `gamma`, `l_min`) |
24
+
25
+ The inference code is not part of this repository.
26
+
27
+ ## Input
28
+
29
+ The detector was trained on normalised text. Before inference, turn curly quotes into straight quotes, em dashes into ` -- `, ellipsis characters into `...`, and Markdown into plain text. Raw typographic punctuation raises the false-positive rate on human text.
backbone/config.json ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 50281,
8
+ "causal_mask": false,
9
+ "classifier_activation": "gelu",
10
+ "classifier_bias": false,
11
+ "classifier_dropout": 0.0,
12
+ "classifier_pooling": "mean",
13
+ "cls_token_id": 50281,
14
+ "decoder_bias": true,
15
+ "deterministic_flash_attn": false,
16
+ "dtype": "float32",
17
+ "embedding_dropout": 0.0,
18
+ "eos_token_id": 50282,
19
+ "global_attn_every_n_layers": 3,
20
+ "gradient_checkpointing": false,
21
+ "hidden_activation": "gelu",
22
+ "hidden_size": 1024,
23
+ "initializer_cutoff_factor": 2.0,
24
+ "initializer_range": 0.02,
25
+ "intermediate_size": 2624,
26
+ "is_causal": false,
27
+ "layer_norm_eps": 1e-05,
28
+ "layer_types": [
29
+ "full_attention",
30
+ "sliding_attention",
31
+ "sliding_attention",
32
+ "full_attention",
33
+ "sliding_attention",
34
+ "sliding_attention",
35
+ "full_attention",
36
+ "sliding_attention",
37
+ "sliding_attention",
38
+ "full_attention",
39
+ "sliding_attention",
40
+ "sliding_attention",
41
+ "full_attention",
42
+ "sliding_attention",
43
+ "sliding_attention",
44
+ "full_attention",
45
+ "sliding_attention",
46
+ "sliding_attention",
47
+ "full_attention",
48
+ "sliding_attention",
49
+ "sliding_attention",
50
+ "full_attention",
51
+ "sliding_attention",
52
+ "sliding_attention",
53
+ "full_attention",
54
+ "sliding_attention",
55
+ "sliding_attention",
56
+ "full_attention"
57
+ ],
58
+ "local_attention": 128,
59
+ "max_position_embeddings": 7999,
60
+ "mlp_bias": false,
61
+ "mlp_dropout": 0.0,
62
+ "model_type": "modernbert",
63
+ "norm_bias": false,
64
+ "norm_eps": 1e-05,
65
+ "num_attention_heads": 16,
66
+ "num_hidden_layers": 28,
67
+ "pad_token_id": 50283,
68
+ "position_embedding_type": "sans_pos",
69
+ "rope_parameters": {
70
+ "full_attention": {
71
+ "rope_theta": 160000.0,
72
+ "rope_type": "default"
73
+ },
74
+ "sliding_attention": {
75
+ "rope_theta": 160000.0,
76
+ "rope_type": "default"
77
+ }
78
+ },
79
+ "sep_token_id": 50282,
80
+ "sparse_pred_ignore_index": -100,
81
+ "sparse_prediction": false,
82
+ "tie_word_embeddings": true,
83
+ "transformers_version": "5.20.2",
84
+ "vocab_size": 50368
85
+ }
backbone/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa252abcfaa50224707019a0149855a7944717eb7a4660d4070a1b346e5cc10e
3
+ size 1579143688
crf.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "W": [
3
+ [
4
+ 0.4718745624986739,
5
+ -0.4123477040991616,
6
+ -0.2773522963614583,
7
+ -0.03416339782948477,
8
+ 0.03866048957222454,
9
+ -0.144998947726002
10
+ ],
11
+ [
12
+ -0.2461554802390373,
13
+ 0.6545299264957797,
14
+ -0.28286622677293427,
15
+ -0.08189829301847114,
16
+ 0.06542677560291564,
17
+ -0.059113237757466935
18
+ ],
19
+ [
20
+ -0.22552176619249883,
21
+ -0.24198490632945613,
22
+ 0.5604158392015485,
23
+ 0.1160616908479318,
24
+ -0.10408726517514506,
25
+ 0.20411218548347226
26
+ ]
27
+ ],
28
+ "alpha": [
29
+ -1.0222998986718383,
30
+ -0.5387720161717896,
31
+ 1.5610719148436307
32
+ ],
33
+ "delta": [
34
+ 0.5,
35
+ -0.5,
36
+ 0.0
37
+ ],
38
+ "lambda": 0.5,
39
+ "gamma": 4.0,
40
+ "l_min": 1
41
+ }
head.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d97a2e92ab59e4a3038564b54ae48f9b792d130761cfd6c71c55c95ee59bde9e
3
+ size 82388
model.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "attention": "sdpa",
3
+ "base_model": "jhu-clsp/ettin-encoder-400m",
4
+ "classes": [
5
+ "human",
6
+ "ai_assisted",
7
+ "ai_generated"
8
+ ],
9
+ "compute": "bf16 autocast, fp32 head",
10
+ "decoder": "argmax",
11
+ "format": "dp-ettin-token/1",
12
+ "heads": [
13
+ "token",
14
+ "segment",
15
+ "mixed"
16
+ ],
17
+ "hidden_size": 1024,
18
+ "revision": "7662476d60abb071a5bd319c9f3074f3072c062d",
19
+ "stride": 256,
20
+ "template": "[CLS] tokens [SEP]",
21
+ "window": 512
22
+ }
tokenizer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": true,
4
+ "cls_token": "[CLS]",
5
+ "is_local": true,
6
+ "local_files_only": false,
7
+ "mask_token": "[MASK]",
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 1000000000,
13
+ "pad_token": "[PAD]",
14
+ "sep_token": "[SEP]",
15
+ "tokenizer_class": "TokenizersBackend",
16
+ "unk_token": "[UNK]"
17
+ }