Sparse autoencoders for vision transformers in PyTorch
Project description
saev - Sparse Auto-Encoders for Vision
Implementation of sparse autoencoders (SAEs) for vision transformers (ViTs) in PyTorch.
This is the codebase used for our preprint "Sparse Autoencoders for Scientifically Rigorous Interpretation of Vision Models"
About
saev is a package for training sparse autoencoders (SAEs) on vision transformers (ViTs) in PyTorch. It also includes an interactive webapp for looking through a trained SAE's features.
Originally forked from HugoFry who forked it from Joseph Bloom.
Read logbook.md for a detailed log of my thought process.
See related-work.md for a list of works training SAEs on vision models. Please open an issue or a PR if there is missing work.
Installation
Installation is supported with uv. saev will likely work with pure pip, conda, etc. but I will not formally support it.
To install, clone this repository (maybe fork it first if you want).
In the project root directory, run uv run python -m saev --help.
The first invocation should create a virtual environment and show a help message.
Using saev
See the docs for an overview.
I recommend using the llms.txt file as a way to use any LLM provider to ask questions.
For example, you can run curl https://osu-nlp-group.github.io/SAE-V/llms.txt | pbcopy on macOS to copy the text, then paste it into https://claude.ai and ask any question you have.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file saev-0.1.0.tar.gz.
File metadata
- Download URL: saev-0.1.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
440ccad8aacfdece2d4198755e5c16cdd2de9f4ed3d21576faebbfb468a92836
|
|
| MD5 |
899d9e104feabd2b27732c8d2f702cce
|
|
| BLAKE2b-256 |
866776771813d55ba0ca151ee2040481938755f1e3b0a6379847d842c29e40b2
|
File details
Details for the file saev-0.1.0-py3-none-any.whl.
File metadata
- Download URL: saev-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c8abb6a1dcb843497a468ff688002e03986bed246fb7b76147b7c312ab2db10
|
|
| MD5 |
3be4c81f80abdd7b1643a71631de4329
|
|
| BLAKE2b-256 |
8827dc63afe765f31fd6dc456e272836226c845126477a02d3b5dbceb5e51f5e
|