Reproducing Anthropic's Sparse Mixtures of Linear Transforms (MOLTs).
This work is done as part of Georg Lange's 2nd SPAR iteration. This repository template is adapted from Johnny Wei's Allegro Lab template.
./setup.sh # install uv + dependencies
uv run pytest tests/ # verify everything worksTrains MOLT decompositions of MLP layers and evaluates faithfulness via:
- Jacobian cosine similarity
- L0 (active transforms) vs Normalized MSE tradeoffs
Currently tested on Gemma-3-1B and GPT-2 with FineWeb data.
Each experiment lives in experiments/NN_name/ with a self-contained run.py:
uv run python experiments/04_gpt2_sanity_check/run.pySee experiments/README.md for details on creating new experiments.
src/molt/ Core library (model, training, evaluation)
experiments/ Numbered experiment folders (run.py + README.md each)
scripts/ Standalone CLI tools
tests/ pytest suite (38 tests)
notes/ Research docs and bug documentation
data/ Activation caches + checkpoints (gitignored)
HF_TOKEN— Required for Gemma-3-1B (gated model)WANDB_API_KEY— Optional, for experiment tracking
- Qualitatively evaluate MOLT transforms by visualizing interactions with SAE
- Compare MOLTs to Transcoders (Skip/Non-Skip)
- Replicate quantitative analysis: Jacobian faithfulness + L0 vs NMSE Pareto frontier
- Mixture of Linear Transforms (MOLTs) introduced in Sparse Mixtures of Linear Transforms are possibly
- More faithful
- More Interpretable
- More Compute efficient
- Goal: Reproduce the MOLTs paper and run further evaluations on MOLTs as follow ups to Anthropic's work
- Qualitatively evaluate MOLT transforms by visualizing MOLT transforms interactions with SAE
- Qualitatively compare MOLTs to an existing strategy such as Transcoders
- Replicate Quantitative analysis of (1) Faithfulness via the Jacobian and (2) L0 vs. Normalized MSE
- Pseudofeature Decomposition of SAE Error
- MOLT transform "steering" (this is an unclear definition)
- Reproduction of known transforms (requires more than a single layer MOLT)
- See if any of the Addition or translation MOLT transforms are detectable
- Compute Attention OV feature interactions across layers
Proposed Pretrained SAE / Transcoders
- Use Gemma Scope 2 on Gemma3-1B
- JumpReLU SAE
- Transcoders (Skip/Non-skip)
- Use FineWeb text
- Train MOLT for only a single layer (e.g. in Gemma3-1B mid-layer layer 26/2 = 13)
- Training Proof of Concept (Infrastructure)
- Train MOLTs on a FineWeb Subset with Gemma Scope SAE features
- Use Tanh sparsity penalty
- Use
N transforms of rank 512, 2N of rank 256, 4N of rank 128, 8N of rank 64, and 16N of rank 32 - Start with N=1 and sweep lambda sparsities
- Note if results are promising move to N=2, N=4
- Evaluation
- Evaluate reconstruction loss
- Evaluate MOLT faithfulness via cosine similarity of flattened Jacobian matrices
- Single Layer Interpretability
- Use
EleutherAI/delphito label the contexts when a Transform is active - Note: we do not interpret the function of transforms for single layers as detailed in the paper; we leave Transform function interpretability for multi-layer attribution graphs because of "interference weights"
- Use
- Comparisons to Baselines (Transcoders)
- Qualitatively Compare MOLTs+SAEs to Transcoders (both Skip/Non-Skip)
- Compare Jacobian faithfulness
- Calculate L0 vs. MSE for Transcoders vs. MOLTs+SAE
- Train MOLTs on a FineWeb Subset with Gemma Scope SAE features
- Attribution Graphs
- Extend MOLT Training to multiple layers (starting first with mid-layer onwards, if this phase goes well, extend to all layers)
- Compute SAE feature interactions across layers
- Label transform functions using an open source model (use existing Delphi input/output features but unclear if Delphi can label transforms)