ica-lens

Decompose language model activations into interpretable directions using Independent Component Analysis.

75|7|Updated May 2, 2026
One-click install
npx skills add https://github.com/zjunlp/Mechanist --skill ica-lens-zjunlp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ica-lens
Source: https://github.com/zjunlp/Mechanist/tree/main/skills/mechanism-skills/feature-dictionary-learning/ica-lens
Command: npx skills add https://github.com/zjunlp/Mechanist --skill ica-lens-zjunlp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fastapi, torch, and includes scripts (resource) and references (resource) components.

What problem does it solve? Training sparse autoencoders or transcoders to find interpretable directions in a language model is expensive and slow. This Skill provides a training-free alternative: it applies Independent Component Analysis (FastICA) to cached activations at any hook point, recovering candidate monosemantic directions without fitting a dictionary, so researchers can inventory, score, and compare interpretable structure quickly. ## Core Features & Use Cases - Activation capture and ICA fitting: Stream activations from residual stream, MLP output, or attention-head hook points and fit FastICA via config-driven workflows. - Component scoring and comparison: Rank directions by non-Gaussianity, run SAEBench targeted probe perturbation and sparse probing, and measure overlap against trained SAE features. - Explorer UI: Browse, annotate, and share fitted components through a FastAPI-based explorer backed by SQLite databases, with pre-fitted artifacts for GPT-2 Small, Gemma 2 2B, and Qwen 3.5 2B Base. - Use Case: Before committing GPU budget to SAE training on a new model layer, capture activations, fit ICA, rank directions by non-Gaussianity, and inspect the top candidates in the explorer to decide whether a learned dictionary is even necessary. ## Quick Start Ask the agent to clone the ica-lens-paper repository, run uv sync, fetch the released artifacts, and launch the explorer server on port 8001 to browse pre-fitted ICA components.

Frequently Asked Questions about ica-lens

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

FAQPage Schema
How do I fit ICA on language model activations?

Capture activations at a chosen hook point with workflows/01_capture_activations.py, then fit FastICA with workflows/02_fit_ica.py. Both steps are driven by TOML configs that specify the model, hook points, token budget, and FastICA hyperparameters.

ICA vs SAE for mechanistic interpretability: which should I use?

ICA is preferred for first-pass inventories, budget-constrained perturbation studies, and as an independent baseline against trained dictionaries. SAEs or transcoders are preferred when you need over-complete feature sets, explicit input-to-output mappings, or cross-site shared bases.

Which models have pre-fitted ICA artifacts available?

Released artifacts cover GPT-2 Small, Gemma 2 2B, and Qwen 3.5 2B Base, downloadable via scripts/fetch_artifacts.py from the Hugging Face dataset. For other models, follow the Qwen3.6-27B worked example as a template.

Can ICA directions be evaluated with SAEBench metrics?

Yes, workflows 07 and 08 run SAEBench targeted probe perturbation and sparse probing directly on ICA components. This requires initializing the SAEBench submodule and running scripts/setup_saebench_envs.sh first.

What are the limitations of ICA for interpretability?

ICA returns at most as many components as the activation has dimensions, so it cannot produce over-complete dictionaries. It also yields correlated, non-causal directions, so causal claims require targeted perturbation experiments or transcoder-based circuit replacement.