<img width="1308" alt="Screenshot 2024-03-21 at 3 08 28 pm" src="https://github.com/jbloomAus/mats_sae_training/assets/69127271/209012ec-a779-4036-b4be-7b7739ea87f6">
# SAE Lens
[](https://pypi.org/project/sae-lens/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/jbloomAus/SAELens/actions/workflows/build.yml)
[](https://github.com/jbloomAus/SAELens/actions/workflows/deploy_docs.yml)
[](https://codecov.io/gh/jbloomAus/SAELens)
SAELens exists to help researchers:
- Train sparse autoencoders.
- Analyse sparse autoencoders / research mechanistic interpretability.
- Generate insights which make it easier to create safe and aligned AI systems.
Please refer to the [documentation](https://jbloomaus.github.io/SAELens/) for information on how to:
- Download and Analyse pre-trained sparse autoencoders.
- Train your own sparse autoencoders.
- Generate feature dashboards with the [SAE-Vis Library](https://github.com/callummcdougall/sae_vis/tree/main).
SAE Lens is the result of many contributors working collectively to improve humanity's understanding of neural networks, many of whom are motivated by a desire to [safeguard humanity from risks posed by artificial intelligence](https://80000hours.org/problem-profiles/artificial-intelligence/).
This library is maintained by [Joseph Bloom](https://www.jbloomaus.com/) and [David Chanin](https://github.com/chanind).
## Loading Pre-trained SAEs.
Pre-trained SAEs for various models can be imported via SAE Lens. See this [page](https://jbloomaus.github.io/SAELens/sae_table/) in the readme for a list of all SAEs.
## Tutorials
- [SAE Lens + Neuronpedia](tutorials/tutorial_2_0.ipynb)[](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/tutorial_2_0.ipynb)
- [Loading and Analysing Pre-Trained Sparse Autoencoders](tutorials/basic_loading_and_analysing.ipynb)
[](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/basic_loading_and_analysing.ipynb)
- [Understanding SAE Features with the Logit Lens](tutorials/logits_lens_with_features.ipynb)
[](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/logits_lens_with_features.ipynb)
- [Training a Sparse Autoencoder](tutorials/training_a_sparse_autoencoder.ipynb)
[](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/training_a_sparse_autoencoder.ipynb)
## Join the Slack!
Feel free to join the [Open Source Mechanistic Interpretability Slack](https://join.slack.com/t/opensourcemechanistic/shared_invite/zt-2k0id7mv8-CsIgPLmmHd03RPJmLUcapw) for support!
## Citation
Please cite the package as follows:
```
@misc{bloom2024saetrainingcodebase,
title = {SAELens},
author = {Joseph Bloom, Curt Tigges and David Chanin},
year = {2024},
howpublished = {\url{https://github.com/jbloomAus/SAELens}},
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "sae-lens",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "deep-learning, sparse-autoencoders, mechanistic-interpretability, PyTorch",
"author": "Joseph Bloom",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/31/63/a98d92384bcb97019ea898c727d7c5f7698919bec7ec52d8e7ac85037c14/sae_lens-5.5.2.tar.gz",
"platform": null,
"description": "<img width=\"1308\" alt=\"Screenshot 2024-03-21 at 3 08 28\u202fpm\" src=\"https://github.com/jbloomAus/mats_sae_training/assets/69127271/209012ec-a779-4036-b4be-7b7739ea87f6\">\n\n# SAE Lens \n[](https://pypi.org/project/sae-lens/)\n[](https://opensource.org/licenses/MIT)\n[](https://github.com/jbloomAus/SAELens/actions/workflows/build.yml)\n[](https://github.com/jbloomAus/SAELens/actions/workflows/deploy_docs.yml)\n[](https://codecov.io/gh/jbloomAus/SAELens)\n\nSAELens exists to help researchers:\n- Train sparse autoencoders.\n- Analyse sparse autoencoders / research mechanistic interpretability. \n- Generate insights which make it easier to create safe and aligned AI systems.\n\nPlease refer to the [documentation](https://jbloomaus.github.io/SAELens/) for information on how to:\n- Download and Analyse pre-trained sparse autoencoders. \n- Train your own sparse autoencoders.\n- Generate feature dashboards with the [SAE-Vis Library](https://github.com/callummcdougall/sae_vis/tree/main).\n\nSAE Lens is the result of many contributors working collectively to improve humanity's understanding of neural networks, many of whom are motivated by a desire to [safeguard humanity from risks posed by artificial intelligence](https://80000hours.org/problem-profiles/artificial-intelligence/).\n\nThis library is maintained by [Joseph Bloom](https://www.jbloomaus.com/) and [David Chanin](https://github.com/chanind).\n\n## Loading Pre-trained SAEs. \n\nPre-trained SAEs for various models can be imported via SAE Lens. See this [page](https://jbloomaus.github.io/SAELens/sae_table/) in the readme for a list of all SAEs.\n## Tutorials\n\n- [SAE Lens + Neuronpedia](tutorials/tutorial_2_0.ipynb)[](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/tutorial_2_0.ipynb)\n- [Loading and Analysing Pre-Trained Sparse Autoencoders](tutorials/basic_loading_and_analysing.ipynb)\n [](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/basic_loading_and_analysing.ipynb)\n - [Understanding SAE Features with the Logit Lens](tutorials/logits_lens_with_features.ipynb)\n [](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/logits_lens_with_features.ipynb)\n - [Training a Sparse Autoencoder](tutorials/training_a_sparse_autoencoder.ipynb)\n [](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/training_a_sparse_autoencoder.ipynb)\n\n\n## Join the Slack!\n\nFeel free to join the [Open Source Mechanistic Interpretability Slack](https://join.slack.com/t/opensourcemechanistic/shared_invite/zt-2k0id7mv8-CsIgPLmmHd03RPJmLUcapw) for support!\n\n\n## Citation\n\nPlease cite the package as follows:\n\n```\n@misc{bloom2024saetrainingcodebase,\n title = {SAELens},\n author = {Joseph Bloom, Curt Tigges and David Chanin},\n year = {2024},\n howpublished = {\\url{https://github.com/jbloomAus/SAELens}},\n}\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Training and Analyzing Sparse Autoencoders (SAEs)",
"version": "5.5.2",
"project_urls": {
"Homepage": "https://jbloomaus.github.io/SAELens",
"Repository": "https://github.com/jbloomAus/SAELens"
},
"split_keywords": [
"deep-learning",
" sparse-autoencoders",
" mechanistic-interpretability",
" pytorch"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1bae6a18ccaaf0496cf9ba54f4bdffce6c02cbd174dc53d09b25bb4396220298",
"md5": "b3e743c89ed1ddbaf5552a931e254d69",
"sha256": "1d95155100bbd02ed9b0c20add0397c934cf99187fc099f97ba87e3c2d776987"
},
"downloads": -1,
"filename": "sae_lens-5.5.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b3e743c89ed1ddbaf5552a931e254d69",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 124224,
"upload_time": "2025-02-25T19:36:25",
"upload_time_iso_8601": "2025-02-25T19:36:25.571794Z",
"url": "https://files.pythonhosted.org/packages/1b/ae/6a18ccaaf0496cf9ba54f4bdffce6c02cbd174dc53d09b25bb4396220298/sae_lens-5.5.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3163a98d92384bcb97019ea898c727d7c5f7698919bec7ec52d8e7ac85037c14",
"md5": "60c8c49deca6a1c8d9271c2c6b37fb62",
"sha256": "9b14e48369b644bc775ef226a3d90a7396531042f8de155645a871d58cc450d6"
},
"downloads": -1,
"filename": "sae_lens-5.5.2.tar.gz",
"has_sig": false,
"md5_digest": "60c8c49deca6a1c8d9271c2c6b37fb62",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 116737,
"upload_time": "2025-02-25T19:36:27",
"upload_time_iso_8601": "2025-02-25T19:36:27.841949Z",
"url": "https://files.pythonhosted.org/packages/31/63/a98d92384bcb97019ea898c727d7c5f7698919bec7ec52d8e7ac85037c14/sae_lens-5.5.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-25 19:36:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jbloomAus",
"github_project": "SAELens",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "transformer-lens",
"specs": [
[
"==",
"1.10.0"
]
]
},
{
"name": "transformers",
"specs": [
[
"==",
"4.35.2"
]
]
},
{
"name": "jupyter",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "plotly",
"specs": [
[
"==",
"5.18.0"
]
]
},
{
"name": "plotly-express",
"specs": [
[
"==",
"0.4.1"
]
]
},
{
"name": "nbformat",
"specs": [
[
"==",
"5.9.2"
]
]
},
{
"name": "ipykernel",
"specs": [
[
"==",
"6.27.1"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.8.2"
]
]
},
{
"name": "matplotlib-inline",
"specs": [
[
"==",
"0.1.6"
]
]
},
{
"name": "flake8",
"specs": [
[
"==",
"7.0.0"
]
]
},
{
"name": "isort",
"specs": [
[
"==",
"5.13.2"
]
]
},
{
"name": "black",
"specs": [
[
"==",
"23.11.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"7.4.3"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
"==",
"4.1.0"
]
]
},
{
"name": "pre-commit",
"specs": [
[
"==",
"3.6.0"
]
]
}
],
"lcname": "sae-lens"
}