This repo contains code for the paper: SynthSAEBench: Evaluating Sparse Autoencoders on Scalable Realistic Synthetic Data.
Trained SAEs and results are online at https://huggingface.co/decoderesearch/synth-sae-bench-16k-v1-saes.
Experiments for the paper are in the experiments directory. The extended SAE classes used in the paper (XStandardTrainingSAE and XJumpReLUTrainingSAE containing L0 autotuning) are in the saes directory.
This project uses uv for package management. To install the dependencies, run:
uv syncTo run the experiments, use the uv run command. For example, to run the superposition experiment, run:
uv run experiments/sweeps/sweep_superposition.pyThe main benchmark model is on Huggingface at decoderesearch/synth-sae-bench-16k-v1. To load the model, run:
from sae_lens.synthetic.synthetic_model import SyntheticModel
model = SyntheticModel.from_pretrained("decoderesearch/synth-sae-bench-16k-v1")This project uses ruff for linting and formatting. To run the linting and formatting, run:
uv run ruff check .
uv run ruff format .This project uses pytest for testing. To run the tests, run:
uv run pytestThis project uses pyright for type checking. To run the type checking, run:
uv run pyright