Skip to main content

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


Download files

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

Source Distribution

saev-0.1.0.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saev-0.1.0-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

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

Hashes for saev-0.1.0.tar.gz
Algorithm Hash digest
SHA256 440ccad8aacfdece2d4198755e5c16cdd2de9f4ed3d21576faebbfb468a92836
MD5 899d9e104feabd2b27732c8d2f702cce
BLAKE2b-256 866776771813d55ba0ca151ee2040481938755f1e3b0a6379847d842c29e40b2

See more details on using hashes here.

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

Hashes for saev-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c8abb6a1dcb843497a468ff688002e03986bed246fb7b76147b7c312ab2db10
MD5 3be4c81f80abdd7b1643a71631de4329
BLAKE2b-256 8827dc63afe765f31fd6dc456e272836226c845126477a02d3b5dbceb5e51f5e

See more details on using hashes here.

Supported by

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