Skip to main content

Steering vectors for transformer language models in Pytorch / Huggingface

Project description

Steering Vectors

ci Codecov 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.12.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

steering_vectors-0.12.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file steering_vectors-0.12.1.tar.gz.

File metadata

  • Download URL: steering_vectors-0.12.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for steering_vectors-0.12.1.tar.gz
Algorithm Hash digest
SHA256 a0c359cc2f35decf9bfb02d47b3854bf96ab52710247a8d4e099c51fc6c614b6
MD5 76ab8c590f85ff3262383e8af775ba45
BLAKE2b-256 d872b50a026a21fd0eb207f8bddc81e1fdf190111a7a7e5c3a6b62d0b7750639

See more details on using hashes here.

File details

Details for the file steering_vectors-0.12.1-py3-none-any.whl.

File metadata

File hashes

Hashes for steering_vectors-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8e7bf764e25b522d07efa3973ab25e3aecf1f22d41cc6c053e7c89eb39a62a
MD5 020d2f0773bc49e91d91218b5072e148
BLAKE2b-256 11d08c3a63876a370334a8da4692ecf61125107df280c8a6a6d56c8edfec83e5

See more details on using hashes here.

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