Downloads · 30 days
0
syedmohaiminulhoque/extending-activation-steering
extending-activation-steering is a machine learning model from syedmohaiminulhoque. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Implementation of the paper: "Extending Activation Steering to Broad Skills and Multiple Behaviours" (arXiv:2403.05767)
Downloads · 30 days
0
Access
Public
Updated Apr 24, 2026
Repo size
—
Likes
1
Trending 1
Click a slice to open those files.
.py52.5 KB · 90%
From the Hugging Face model README
Implementation of the paper: "Extending Activation Steering to Broad Skills and Multiple Behaviours" (arXiv:2403.05767)
by Teun van der Weij, Massimo Poesio, Nandi Schoots.
This paper investigates activation steering for:
Key findings:
.
├── broad_steering.py # Experiment 1: broad steering (Section 2.1, 3.1)
├── multi_steering.py # Experiment 2: multi-steering (Section 2.2, 3.2)
├── run_experiments.py # End-to-end runner for both experiments
├── test_pipeline_small.py # Quick CPU test with GPT-2
└── README.md
pip install torch transformers datasets numpy tqdm
Verify the pipeline works end-to-end with a tiny model:
python test_pipeline_small.py
Run both experiments with the default Llama-2-7b-chat-hf model:
python run_experiments.py --model meta-llama/Llama-2-7b-chat-hf --experiment all
Run only broad steering:
python run_experiments.py --experiment broad
Run only multi-steering:
python run_experiments.py --experiment multi
Run in fast test mode (small data, for debugging):
python run_experiments.py --test
Results are saved to ./results/:
broad_steering_results.json — relative coding/text accuracy per layer and coefficientmulti_steering_results.json — individual, combined, and simultaneous steering scoressteering_vectors/ — saved numpy arrays of steering vectors@article{vanderweij2024extending,
title={Extending Activation Steering to Broad Skills and Multiple Behaviours},
author={van der Weij, Teun and Poesio, Massimo and Schoots, Nandi},
journal={arXiv preprint arXiv:2403.05767},
year={2024}
}
Code implementation released under MIT. Datasets follow their original licenses (see paper for details).