Steering vectors for transformer language models in Pytorch / Huggingface
Project description
Steering Vectors
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
About
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!
For more info on steering vectors and representation engineering, check out the following work:
- Steering Llama 2 via Contrastive Activation Addition Rimsky et al., 2023
- Representation Engineering: A Top-Down Approach to AI Transparency Zou et al., 2023
Installation
pip install steering-vectors
Check out the full documentation for more usage info.
Contributing
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.
License
This code is released under a MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for steering_vectors-0.12.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f8e7bf764e25b522d07efa3973ab25e3aecf1f22d41cc6c053e7c89eb39a62a |
|
MD5 | 020d2f0773bc49e91d91218b5072e148 |
|
BLAKE2b-256 | 11d08c3a63876a370334a8da4692ecf61125107df280c8a6a6d56c8edfec83e5 |