sae-lens
Training and Analyzing Sparse Autoencoders (SAEs)
Decision gist · record as of 2026-08-14
Yes, if you are doing mechanistic interpretability research or need to train and analyze sparse autoencoders. The library is actively maintained, has low install friction, carries a permissive license, and integrates well with standard ML frameworks. Not relevant for general-purpose ML tasks or applications that don't require feature-level interpretability analysis.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- PyTorch and transformers must be installed; SAE Lens handles this via dependencies.
- Low friction installation with a pure-Python wheel.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) places no restrictions on commercial or private use, modification, or redistribution.
last release 2026-08-10 (4 days) · last repo commit 2026-08-10 · 1,503 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 81,669 downloads/mo, #14,210 on PyPI
Alternatives
Verify before relying
pip install sae-lens
from sae_lens import SAE
from transformers import AutoModel
# Load a pre-trained SAE and use it with a model
sae = SAE.from_pretrained("gpt2-small-sae")
model = AutoModel.from_pretrained("gpt2")- Whether pre-trained SAEs cover the specific models or architectures you need to analyze.
- Performance characteristics and memory requirements for training SAEs on large models.
- Compatibility with custom or non-standard model architectures beyond the documented integrations.
What it is and what it does
SAE Lens is a research library for training and analyzing sparse autoencoders (SAEs), a technique used to decompose neural network activations into interpretable features. It provides tools to train SAEs from scratch, load pre-trained models, and generate feature analysis dashboards. The library works with any PyTorch-based model but offers deep integration with TransformerLens and Hugging Face Transformers, allowing researchers to extract activations and pass them through the SAE's encode and decode methods.
The package is designed for mechanistic interpretability research—understanding how neural networks work internally—with a focus on generating insights that support AI safety and alignment. It includes tutorials for loading pre-trained SAEs, analyzing features, and training on synthetic data, plus integration with visualization tools like SAE-Vis. The codebase is actively maintained and part of a broader ecosystem of interpretability projects.
Use it for
- Train sparse autoencoders on transformer model activations to discover interpretable features.
- Load and analyze pre-trained SAEs to understand what features a model has learned.
- Generate feature dashboards and visualizations using SAE-Vis for mechanistic interpretability research.
- Extract and study activation patterns from Hugging Face or custom PyTorch models using SAE inference.
- Benchmark SAE architectures on synthetic data to evaluate design choices.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are doing mechanistic interpretability research or need to train and analyze sparse autoencoders.
The library is actively maintained, has low install friction, carries a permissive license, and integrates well with standard ML frameworks. Not relevant for general-purpose ML tasks or applications that don't require feature-level interpretability analysis.
Install
sae-lens on PyPI
Before you install
Low friction installation with a pure-Python wheel. Active maintenance—released 4 days ago with 1503 repository stars. Requires 13 runtime dependencies including transformers, transformer-lens, and datasets; all are standard ML packages.
Requires Python 3.10 or later. PyTorch and transformers must be installed; SAE Lens handles this via dependencies.
License in practice
MIT license (permissive) places no restrictions on commercial or private use, modification, or redistribution.
Quickstart
pip install sae-lens
from sae_lens import SAE
from transformers import AutoModel
# Load a pre-trained SAE and use it with a model
sae = SAE.from_pretrained("gpt2-small-sae")
model = AutoModel.from_pretrained("gpt2")
Verify before relying
- Whether pre-trained SAEs cover the specific models or architectures you need to analyze.
- Performance characteristics and memory requirements for training SAEs on large models.
- Compatibility with custom or non-standard model architectures beyond the documented integrations.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 13 packagesbabedatasetsnltkplotlyplotly-expresspython-dotenvpyyamlsafetensorssimple-parsingtenacitytransformer-lenstransformerstyping-extensions |
| Maintenance | Actively maintained 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 81,669 / month, #14,210 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: sae_lens-6.49.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sparse autoencoder training”
- sae-lensSAE Lens trains and analyzes sparse autoencoders for mechanistic…
- onemkl-sycl-sparseProvides C and Data Parallel C++ (DPC++) interfaces to Intel's oneAPI…
- sparsediffpySparseDiffPy provides Python bindings to compute sparse Jacobians and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also captum · transformer-lens · icevision · segmentation-models-pytorch · spacy-transformers · llama-index-embeddings-huggingface · model-compression-toolkit · pytorchcv · face_recognition_models · torchxrayvision