Instructions to use JacoDuToit/steer-full_3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use JacoDuToit/steer-full_3b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct") model = PeftModel.from_pretrained(base_model, "JacoDuToit/steer-full_3b") - Notebooks
- Google Colab
- Kaggle
run directory (provenance + evals)
Browse files- run/code.patch +42 -0
- run/config.yaml +4 -7
- run/eval_m1.jsonl +0 -0
- run/run_meta.json +12 -81
run/code.patch
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/configs/full_14b.yaml b/configs/full_14b.yaml
|
| 2 |
+
index d04ab7d..31b8bef 100644
|
| 3 |
+
--- a/configs/full_14b.yaml
|
| 4 |
+
+++ b/configs/full_14b.yaml
|
| 5 |
+
@@ -2,10 +2,11 @@
|
| 6 |
+
# 100 open factual questions, mid-depth injection, training strengths to the
|
| 7 |
+
# measured attack peak. These are the headline runs.
|
| 8 |
+
#
|
| 9 |
+
-# 48 layers, so 24 is mid-depth. THIS IS A PLACEHOLDER: run the depth and
|
| 10 |
+
-# strength sweeps first (scripts/sweep_layers.py) and set layer/alphas from
|
| 11 |
+
-# what they show, as we did for 3B and 7B. The 7B's behaviour differed from
|
| 12 |
+
-# the 3B's, so mid-depth is an assumption until measured.
|
| 13 |
+
+# Layer 24 and the strength range are MEASURED, not assumed. The depth sweep
|
| 14 |
+
+# (results/sweep_layers_14b) found layer 24 admits 63/68 viable attacks against
|
| 15 |
+
+# 46 at layer 12 and 31 at layer 36, and steers hardest at moderate strength.
|
| 16 |
+
+# The strength sweep at layer 24 (results/sweep_alpha_14b) peaks at alpha 1.0
|
| 17 |
+
+# (94% steered) and degenerates above 1.2, so training brackets the peak.
|
| 18 |
+
# Needs a 48GB card: 14B in bf16 is ~28GB before activations.
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
@@ -31,7 +32,7 @@ steered_frac: 0.7
|
| 22 |
+
eval_question_frac: 0.2
|
| 23 |
+
repeats_per_question: 6
|
| 24 |
+
alpaca_replay_frac: 0.5
|
| 25 |
+
-eval_concepts_per_split: 40 # seeded subsample per split for the eval sweep
|
| 26 |
+
+eval_concepts_per_split: {train: 40, heldout: null}
|
| 27 |
+
|
| 28 |
+
# Training
|
| 29 |
+
lora_r: 16
|
| 30 |
+
diff --git a/configs/full_3b.yaml b/configs/full_3b.yaml
|
| 31 |
+
index 754685a..e1f1ea2 100644
|
| 32 |
+
--- a/configs/full_3b.yaml
|
| 33 |
+
+++ b/configs/full_3b.yaml
|
| 34 |
+
@@ -25,7 +25,7 @@ steered_frac: 0.7
|
| 35 |
+
eval_question_frac: 0.2
|
| 36 |
+
repeats_per_question: 6
|
| 37 |
+
alpaca_replay_frac: 0.5
|
| 38 |
+
-eval_concepts_per_split: 40 # seeded subsample per split for the eval sweep
|
| 39 |
+
+eval_concepts_per_split: {train: 40, heldout: null}
|
| 40 |
+
|
| 41 |
+
# Training
|
| 42 |
+
lora_r: 16
|
run/config.yaml
CHANGED
|
@@ -1,10 +1,7 @@
|
|
| 1 |
-
#
|
| 2 |
-
#
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
# * eval alphas cover past the peak into the degeneracy regime
|
| 6 |
-
# Task = open factual questions; eval concepts subsampled (seeded) to keep the
|
| 7 |
-
# eval tractable at 500 concepts.
|
| 8 |
|
| 9 |
model_id: Qwen/Qwen2.5-3B-Instruct
|
| 10 |
device: auto
|
|
|
|
| 1 |
+
# FULL-BANK run: 500 concepts / 21 categories (5 categories held out entirely),
|
| 2 |
+
# 100 open factual questions, mid-depth injection, training strengths to the
|
| 3 |
+
# measured attack peak. These are the headline runs.
|
| 4 |
+
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
model_id: Qwen/Qwen2.5-3B-Instruct
|
| 7 |
device: auto
|
run/eval_m1.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
run/run_meta.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"run": "full_3b",
|
| 3 |
-
"started_at": "2026-
|
| 4 |
"argv": [
|
| 5 |
"scripts/run.py",
|
| 6 |
"configs/full_3b.yaml",
|
|
@@ -81,24 +81,24 @@
|
|
| 81 |
"results_dir": "results/full_3b"
|
| 82 |
},
|
| 83 |
"git": {
|
| 84 |
-
"commit":
|
| 85 |
-
"branch":
|
| 86 |
-
"dirty":
|
| 87 |
-
"remote":
|
| 88 |
},
|
| 89 |
"env": {
|
| 90 |
"python": "3.11.10",
|
| 91 |
-
"platform": "Linux-6.
|
| 92 |
-
"accelerator": "NVIDIA
|
| 93 |
"packages": {
|
| 94 |
-
"torch": "2.
|
| 95 |
"transformers": "5.14.1",
|
| 96 |
-
"peft": "0.
|
| 97 |
"accelerate": "1.14.0",
|
| 98 |
-
"datasets": "5.0.
|
| 99 |
"numpy": "2.4.6",
|
| 100 |
"wandb": null,
|
| 101 |
-
"huggingface_hub": "1.
|
| 102 |
}
|
| 103 |
},
|
| 104 |
"data": {
|
|
@@ -111,74 +111,5 @@
|
|
| 111 |
"sha256": "fa2356571420fd8c2a444aee6e8c879b865e0cd21f5ade2938a0308effbed8f2"
|
| 112 |
}
|
| 113 |
},
|
| 114 |
-
"status": "
|
| 115 |
-
"wandb_url": null,
|
| 116 |
-
"headline": "clean 100%->100% · steer_heldout@1.6 correct 0%->3%",
|
| 117 |
-
"finished_at": "2026-07-25T13:02:30+0000",
|
| 118 |
-
"artifacts": {
|
| 119 |
-
"capability/capability_summary.csv": {
|
| 120 |
-
"sha256": "d5bbb31095b80e60dd46d2e5cdaa7ef2a781ccc89de5766381b21af1425233b9",
|
| 121 |
-
"bytes": 128
|
| 122 |
-
},
|
| 123 |
-
"capability/capability_summary.md": {
|
| 124 |
-
"sha256": "ebf7fa98749913e9f77670b2f926ead49fd2dfdf3cacdafbc27b873e088a7218",
|
| 125 |
-
"bytes": 363
|
| 126 |
-
},
|
| 127 |
-
"capability/lmeval_run.log": {
|
| 128 |
-
"sha256": "f3d93e78d2473755612d80a0afb6eaec8ed8027f13b4545ee8ec4d59370d4731",
|
| 129 |
-
"bytes": 298468
|
| 130 |
-
},
|
| 131 |
-
"capability/m0/gsm8k_cot/Qwen__Qwen2.5-3B-Instruct/results_2026-07-23T18-36-29.229735.json": {
|
| 132 |
-
"sha256": "fa3feefea52e589b23d972c3393a9222b7affa81d04b782a111cbfb5f6e561bc",
|
| 133 |
-
"bytes": 14432
|
| 134 |
-
},
|
| 135 |
-
"capability/m0/mmlu/Qwen__Qwen2.5-3B-Instruct/results_2026-07-23T18-15-57.670538.json": {
|
| 136 |
-
"sha256": "dfd686f19edce4cb31bffd091167c599b0596b15987d25303613295099cb4562",
|
| 137 |
-
"bytes": 139207
|
| 138 |
-
},
|
| 139 |
-
"capability/m1/gsm8k_cot/__root__steering-resistance__results__full_3b__m1_resist_adapter/results_2026-07-23T19-07-18.393003.json": {
|
| 140 |
-
"sha256": "35a97896c6938ea0031d99b63a6787f635f4d88b68a52c7aec53a1849b28a25c",
|
| 141 |
-
"bytes": 14681
|
| 142 |
-
},
|
| 143 |
-
"capability/m1/mmlu/__root__steering-resistance__results__full_3b__m1_resist_adapter/results_2026-07-23T18-41-47.488437.json": {
|
| 144 |
-
"sha256": "e6e525c0832477c3729aca9663ded0bc63ab583d6c521a550365fb8656f1fc0c",
|
| 145 |
-
"bytes": 143701
|
| 146 |
-
},
|
| 147 |
-
"eval_m0.jsonl": {
|
| 148 |
-
"sha256": "1ae0cbda4668a35852e1ef234043f320d320ae9cb7cf4017b4d2f79f1427605a",
|
| 149 |
-
"bytes": 11318115
|
| 150 |
-
},
|
| 151 |
-
"eval_m1.jsonl": {
|
| 152 |
-
"sha256": "1cadc857be9f99e14b2a7c6293f759e7f8f47a0ca1a78e684ab321339f97eb36",
|
| 153 |
-
"bytes": 9612527
|
| 154 |
-
},
|
| 155 |
-
"eval_questions.json": {
|
| 156 |
-
"sha256": "8771796f4c91a61a901278e799032623900657aaa8f9e44ce789dd1fadd8bf8f",
|
| 157 |
-
"bytes": 27617
|
| 158 |
-
},
|
| 159 |
-
"m1_resist_adapter/adapter_config.json": {
|
| 160 |
-
"sha256": "390e661694a2f685b6256b5d38a80aa41c5236a115df9cfb5edd4a96da0e568e",
|
| 161 |
-
"bytes": 1103
|
| 162 |
-
},
|
| 163 |
-
"m1_resist_adapter/adapter_model.safetensors": {
|
| 164 |
-
"sha256": "bc5cf2921ad4f341fc270e0b53641804b4c725c9031d5d232dd6cb1f8877a23d",
|
| 165 |
-
"bytes": 119801528
|
| 166 |
-
},
|
| 167 |
-
"summary.csv": {
|
| 168 |
-
"sha256": "0d7959f18ba4548ff986d2f9d1d951434a73addb3bafd0822e6153011850a2c3",
|
| 169 |
-
"bytes": 2621
|
| 170 |
-
},
|
| 171 |
-
"summary.md": {
|
| 172 |
-
"sha256": "cbc9c4aa3d4576d1608186f9e893ae0fc1a94d68655f57ec5126e29b756989c1",
|
| 173 |
-
"bytes": 2627
|
| 174 |
-
},
|
| 175 |
-
"train_examples.json": {
|
| 176 |
-
"sha256": "3e2ac73debbb5da8cadb4e114a35f6346f015ca0f22d52b9486a7fd2b2b7e824",
|
| 177 |
-
"bytes": 284577
|
| 178 |
-
},
|
| 179 |
-
"vectors.pt": {
|
| 180 |
-
"sha256": "5c9783914f6419b376d133a3872349ac5a07b42c8456894a3214ffa6618158c4",
|
| 181 |
-
"bytes": 7757862
|
| 182 |
-
}
|
| 183 |
-
}
|
| 184 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"run": "full_3b",
|
| 3 |
+
"started_at": "2026-08-05T17:16:57+0000",
|
| 4 |
"argv": [
|
| 5 |
"scripts/run.py",
|
| 6 |
"configs/full_3b.yaml",
|
|
|
|
| 81 |
"results_dir": "results/full_3b"
|
| 82 |
},
|
| 83 |
"git": {
|
| 84 |
+
"commit": "b16f6e72a9bb0c38dd20d0bab46579325178c793",
|
| 85 |
+
"branch": "main",
|
| 86 |
+
"dirty": true,
|
| 87 |
+
"remote": "https://github.com/JacoDuToit11/steering-resistance.git"
|
| 88 |
},
|
| 89 |
"env": {
|
| 90 |
"python": "3.11.10",
|
| 91 |
+
"platform": "Linux-6.5.0-35-generic-x86_64-with-glibc2.35",
|
| 92 |
+
"accelerator": "NVIDIA A100 80GB PCIe",
|
| 93 |
"packages": {
|
| 94 |
+
"torch": "2.6.0+cu124",
|
| 95 |
"transformers": "5.14.1",
|
| 96 |
+
"peft": "0.20.0",
|
| 97 |
"accelerate": "1.14.0",
|
| 98 |
+
"datasets": "5.0.1",
|
| 99 |
"numpy": "2.4.6",
|
| 100 |
"wandb": null,
|
| 101 |
+
"huggingface_hub": "1.26.0"
|
| 102 |
}
|
| 103 |
},
|
| 104 |
"data": {
|
|
|
|
| 111 |
"sha256": "fa2356571420fd8c2a444aee6e8c879b865e0cd21f5ade2938a0308effbed8f2"
|
| 112 |
}
|
| 113 |
},
|
| 114 |
+
"status": "running"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
}
|