One-click install
npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill saelens-vivekgoquest
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: saelens
Source: https://github.com/vivekgoquest/hermes-agent-stable/tree/main/optional-skills/mlops/saelens
Command: npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill saelens-vivekgoquest

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Neural network neurons are polysemantic, activating for many unrelated concepts due to superposition, which makes models hard to interpret. This Skill guides you through using SAELens to decompose dense model activations into sparse, monosemantic features that correspond to interpretable concepts. ## Core Features & Use Cases - Pre-trained SAE Analysis: Load SAEs from releases like gpt2-small-res-jb, encode activations into sparse features, and identify top-activating features per token. - Custom SAE Training: Configure and train Standard, Gated, TopK, or JumpReLU SAEs with the v6 nested config API, monitoring L0, CE loss recovery, and dead feature ratios. - Feature Steering and Attribution: Add decoder feature directions to the residual stream for steering, compute per-feature logit contributions, and ablate features to test causal importance. - Use Case: You want to understand what GPT-2 Small has learned at layer 8. Load the matching pre-trained SAE, encode activations from your prompts, and inspect which interpretable features fire, then steer generation by amplifying a chosen feature direction. ## Quick Start Ask the agent to load the gpt2-small-res-jb sparse autoencoder with SAELens and show the top activating features for each token in a sample prompt.

Frequently Asked Questions about saelens

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

FAQPage Schema
How do I train a sparse autoencoder with SAELens?▼

Configure LanguageModelSAERunnerConfig with a nested StandardTrainingSAEConfig specifying d_in, d_sae, and l1_coefficient, then run LanguageModelSAETrainingRunner. Use L1 warm-up steps around 1000 and monitor L0 and CE loss recovery during training.

How to load a pre-trained SAE for GPT-2 Small?▼

Call SAE.from_pretrained with release gpt2-small-res-jb and a sae_id like blocks.8.hook_resid_pre. In sae-lens v6 this returns just the SAE object; use from_pretrained_with_cfg_and_sparsity if you also need the config dict.

What changed in sae-lens v6 configuration?▼

Version 6 uses a nested config where SAE-specific options like d_sae and l1_coefficient live in a sae sub-config such as StandardTrainingSAEConfig, and logging options move to a LoggingConfig. Legacy flat options like hook_layer, architecture, and use_ghost_grads were removed.

Why does my SAE have a high dead feature ratio?▼

Dead features usually result from applying the full L1 penalty too early in training. Set l1_warm_up_steps to around 1000 so the sparsity penalty ramps up gradually, and consider lowering the l1_coefficient.

When should I use TransformerLens instead of SAELens?▼

Use TransformerLens directly for basic activation analysis or causal intervention experiments that do not require sparse feature decomposition. SAELens is appropriate when you need to discover interpretable features, study superposition, or perform feature-based steering.

How do I fix out-of-memory errors during SAE training?▼

Reduce train_batch_size_tokens to around 2048, lower store_batch_size_prompts to 4, and shrink n_batches_in_buffer to 8. These settings reduce the activation buffer size at the cost of slower throughput.