Skip to main content

Steering vectors for transformer language models in Pytorch / Huggingface

Project description

Steering Vectors

ci PyPI

Steering vectors / representation engineering for transformer language models in Pytorch / Huggingface

Check out our example notebook. Open In Colab

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steering_vectors-0.10.2.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

steering_vectors-0.10.2-py3-none-any.whl (14.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page