Steering vectors / representation engineering for transformer language models in Pytorch / Huggingface
Check out our example notebook.
Full docs: https://steering-vectors.github.io/steering-vectors
This library provides utilies for training and applying steering vectors to language models (LMs) from Huggingface, like GPT, LLaMa, Gemma, Mistral, Pythia, and many more!
This library is inspired by ideas and code from the following two papers. For more info on steering vectors and representation engineering, check out these works:
pip install steering-vectors
Check out the full documentation for more usage info.
Any contributions to improve this project are welcome! Please open an issue or pull request in this repo with any bugfixes / changes / improvements you have.
This project uses Ruff for code formatting and linting, MyPy for type checking, and Pytest for tests. Make sure any changes you submit pass these code checks in your PR. If you have trouble getting these to run feel free to open a pull-request regardless and we can discuss further in the PR.
This code is released under a MIT license.