Instructions to use JacoDuToit/steer-full_7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use JacoDuToit/steer-full_7b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "JacoDuToit/steer-full_7b") - Notebooks
- Google Colab
- Kaggle
model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 3 |
+
library_name: peft
|
| 4 |
+
tags:
|
| 5 |
+
- lora
|
| 6 |
+
- activation-steering
|
| 7 |
+
- steering-resistance
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# full_7b — steering-resistance LoRA adapter
|
| 11 |
+
|
| 12 |
+
LoRA adapter for **Qwen/Qwen2.5-7B-Instruct** trained to resist adversarial activation
|
| 13 |
+
steering: fine-tuned with CAA vectors injected live at decoder layer 14,
|
| 14 |
+
rewarded for reproducing its own clean answers. Full method:
|
| 15 |
+
the steering-resistance repo.
|
| 16 |
+
|
| 17 |
+
## Provenance
|
| 18 |
+
|
| 19 |
+
| | |
|
| 20 |
+
|---|---|
|
| 21 |
+
| run | full_7b |
|
| 22 |
+
| result | — |
|
| 23 |
+
| trained | 2026-07-23T18:26:39+0000 |
|
| 24 |
+
| code | unknown |
|
| 25 |
+
| config | `configs/full_7b.yaml` (snapshot: `run/config.yaml`) |
|
| 26 |
+
| wandb | — |
|
| 27 |
+
| hardware | NVIDIA GeForce RTX 3090 |
|
| 28 |
+
| stack | torch 2.13.0+cu126, transformers 5.14.1, peft 0.19.1, accelerate 1.14.0, datasets 5.0.0, numpy 2.4.6, huggingface_hub 1.24.0 |
|
| 29 |
+
| data: concepts_path | `adc6aee9b1cc537a…` (data/concepts_paper.json) |
|
| 30 |
+
| data: qa_path | `fa2356571420fd8c…` (data/qa_open.json) |
|
| 31 |
+
|
| 32 |
+
## Training parameters
|
| 33 |
+
|
| 34 |
+
| param | value |
|
| 35 |
+
|---|---|
|
| 36 |
+
| layer | `14` |
|
| 37 |
+
| train_alphas | `[0.4, 0.8, 1.2]` |
|
| 38 |
+
| eval_alphas | `[0.4, 0.8, 1.0, 1.2, 1.6]` |
|
| 39 |
+
| efficacy_alpha | `0.8` |
|
| 40 |
+
| efficacy_min_rate | `0.3` |
|
| 41 |
+
| steered_frac | `0.7` |
|
| 42 |
+
| relevant_frac | `0.6` |
|
| 43 |
+
| repeats_per_question | `6` |
|
| 44 |
+
| lora_r | `16` |
|
| 45 |
+
| lora_alpha | `32` |
|
| 46 |
+
| lora_dropout | `0.05` |
|
| 47 |
+
| lora_targets | `["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]` |
|
| 48 |
+
| lr | `0.0001` |
|
| 49 |
+
| epochs | `1` |
|
| 50 |
+
| effective_batch_size | `16` |
|
| 51 |
+
| train_batch_size | `2` |
|
| 52 |
+
| max_seq_len | `256` |
|
| 53 |
+
| seed | `0` |
|
| 54 |
+
|
| 55 |
+
## Eval results
|
| 56 |
+
|
| 57 |
+
| model | condition | alpha | n | correct | steered | other |
|
| 58 |
+
|---|---|---:|---:|---|---|---|
|
| 59 |
+
| M0 | clean | 0.0 | 17 | 100% [100%,100%] | 0% [0%,0%] | 0% [0%,0%] |
|
| 60 |
+
| M0 | correct_inject | 0.4 | 7 | 100% [100%,100%] | 0% [0%,0%] | 0% [0%,0%] |
|
| 61 |
+
| M0 | correct_inject | 0.8 | 7 | 86% [57%,100%] | 0% [0%,0%] | 14% [0%,43%] |
|
| 62 |
+
| M0 | correct_inject | 1.0 | 7 | 100% [100%,100%] | 0% [0%,0%] | 0% [0%,0%] |
|
| 63 |
+
| M0 | correct_inject | 1.2 | 7 | 86% [57%,100%] | 0% [0%,0%] | 14% [0%,43%] |
|
| 64 |
+
| M0 | correct_inject | 1.6 | 7 | 100% [100%,100%] | 0% [0%,0%] | 0% [0%,0%] |
|
| 65 |
+
| M0 | steer_heldout | 0.4 | 680 | 88% [83%,93%] | 12% [7%,17%] | 0% [0%,0%] |
|
| 66 |
+
| M0 | steer_heldout | 0.8 | 680 | 40% [32%,48%] | 49% [42%,57%] | 10% [8%,13%] |
|
| 67 |
+
| M0 | steer_heldout | 1.0 | 680 | 4% [2%,6%] | 81% [78%,83%] | 15% [13%,17%] |
|
| 68 |
+
| M0 | steer_heldout | 1.2 | 680 | 0% [0%,1%] | 79% [78%,81%] | 20% [19%,22%] |
|
| 69 |
+
| M0 | steer_heldout | 1.6 | 680 | 0% [0%,0%] | 66% [65%,68%] | 34% [32%,35%] |
|
| 70 |
+
| M0 | steer_train | 0.4 | 680 | 100% [100%,100%] | 0% [0%,0%] | 0% [0%,0%] |
|
| 71 |
+
| M0 | steer_train | 0.8 | 680 | 56% [48%,64%] | 35% [28%,42%] | 9% [6%,12%] |
|
| 72 |
+
| M0 | steer_train | 1.0 | 680 | 9% [6%,11%] | 79% [77%,81%] | 12% [10%,14%] |
|
| 73 |
+
| M0 | steer_train | 1.2 | 680 | 1% [0%,2%] | 81% [79%,83%] | 18% [16%,20%] |
|
| 74 |
+
| M0 | steer_train | 1.6 | 680 | 0% [0%,0%] | 65% [63%,66%] | 35% [34%,37%] |
|
| 75 |
+
|
| 76 |
+
## Reproduce
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
git clone <repo> && cd <repo>
|
| 80 |
+
git checkout <commit>
|
| 81 |
+
python scripts/run.py configs/full_7b.yaml
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
`run/` mirrors the full experiment directory: `run_meta.json` (manifest with
|
| 85 |
+
artifact hashes), append-only eval jsonl, summaries, and the exact config.
|