sparse-autoencoder-training

Train sparse autoencoders on transformer activations using SAELens and TransformerLens.

97|8|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/peteromallet/megaplan --skill sparse-autoencoder-training-peteromallet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sparse-autoencoder-training
Source: https://github.com/peteromallet/megaplan/tree/main/megaplan/agent/skills/mlops/evaluation/saelens
Command: npx skills add https://github.com/peteromallet/megaplan --skill sparse-autoencoder-training-peteromallet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sae-lens>=6.0.0, transformer-lens>=2.0.0, torch>=2.0.0, and includes references (resource) components.

What problem does it solve?

Train sparse autoencoders to decompose neural activations from transformer models into interpretable, sparse features, enabling mechanistic interpretability and feature discovery.

Core Features & Use Cases

  • Train SAEs on model activations (d_in) to obtain a sparse latent representation (d_sae) that can be analyzed for concept discovery.
  • Analyze activation sparsity, feature attribution, and reconstruction quality to understand model behaviors.
  • Apply SAEs for steering, ablation, and comparative studies across prompts or architectures.

Quick Start

Run the training workflow to generate an SAE from your model's activations and begin analysis.

Frequently Asked Questions about sparse-autoencoder-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train sparse autoencoders to decompose transformer activations for mechanistic interpretability?

To train sparse autoencoders for mechanistic interpretability, configure the architecture, d_sae, and l1_coefficient using SAELens and TransformerLens on a GPT-2-style model. This decomposes neural activations into interpretable, sparse features for analysis.

What is the best way to analyze feature sparsity and perform feature attribution on large language models?

Analyzing feature sparsity and performing feature attribution on large language models involves training an SAE on model activations. You can then evaluate activation sparsity, reconstruction quality, and feature attribution to understand model behaviors.

Does this sparse autoencoder training workflow support causal steering and ablation experiments?

Yes, the sparse autoencoder training workflow supports causal steering and ablation experiments. Once trained, the SAE can be applied for steering, ablation, and comparative studies across prompts or architectures to observe causal effects.

Can I use this tool to train SAEs on models other than GPT-2?

The training workflow requires a GPT-2-style model along with SAELens and TransformerLens. It is specifically designed for mechanistic interpretability research on large language models compatible with this architecture.

How do I configure the d_sae and l1_coefficient parameters when training an SAE?

Configuring d_sae and l1_coefficient involves setting the sparse latent representation dimension and the sparsity penalty during the training workflow. These parameters control feature discovery and reconstruction quality on transformer activations.