Feature Dictionary Learning

Feature Dictionary Learning is a skill for Claude Code, Codex from zjunlp/Mechanist. It costs 122 tokens per session (1,405 once invoked), scanned A, original, MIT.

A machine-learning method that breaks a model's dense internal activity into a sparse combination of learned directions, called features. It is used to make patterns inside neural networks easier to study.

In plain words
What is it for?
Use it to train feature dictionaries, inspect model representations, support circuit discovery, or change a model's behavior by adjusting selected features.
Why use it?
Individual neurons can respond to several unrelated ideas at once. This method separates those mixed responses into features that may be easier to interpret, while recording that the reconstruction can be imperfect.

Skill for Claude CodeCodex

Part of the mechanist plugin — 54 skills, 4 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zjunlp/mechanist/feature-dictionary-learning
Any agent
npx skills add zjunlp/Mechanist --skill feature-dictionary-learning
Clone the repo
git clone --depth 1 https://github.com/zjunlp/Mechanist

Made for: Claude Code, Codex.

Or install mechanist, the plugin that ships this one along with the rest of its 54 skills, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Feature Dictionary Learning

README.md
[![agentmods](https://agentmods.dev/badge/skills/zjunlp/mechanist/feature-dictionary-learning.svg)](https://agentmods.dev/skills/zjunlp/mechanist/feature-dictionary-learning)
Your own site
<a href="https://agentmods.dev/skills/zjunlp/mechanist/feature-dictionary-learning"><img src="https://agentmods.dev/badge/skills/zjunlp/mechanist/feature-dictionary-learning.svg" alt="Measured on agentmods" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,405 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00122 $0.01405
Opus 5 $0.00061 $0.00702
Sonnet 5 $0.00024 $0.00281
Haiku 4.5 $0.00012 $0.00140

Measured 5d ago against content hash 278602d3eee6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Feature Dictionary Learning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (crosscoder/scripts/train_and_evaluate_sae.py, crosscoder/scripts/train_sae_demo.py, ica-lens/scripts/artifact_variant_example.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mechanism-skills/feature-dictionary-learning/SKILL.md · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Advantage

  • Towards monosemanticity: By forcing decompositions to be sparse, Feature Dictionary Learning recovers features that are more monosemantic than individual neurons — though not strictly so — making the resulting basis far better suited to interpretation, attribution, and steering than the model's native one.
  • Computational efficiency: Although training the dictionary is resource-intensive, inference is cheap — encoding an activation is a single linear pass plus a non-linearity, and intervening on a feature reduces to scaling or zeroing its weight before reconstruction.
  • Composability: This composability makes downstream tools — feature dashboards, circuit discovery via attribution graphs, and SAE-based steering — practical at LLM scale.

Limitation

  • Reconstruction fidelity: The decomposition is only as faithful as the training data and reconstruction loss admit. Residual reconstruction error implicitly introduces an "error node" whose contribution must be tracked when making claims about full circuits.
  • Dictionary quality issues: Dead features (never activated) and ultra-low-frequency features bloat the dictionary; dense or non-linearly encoded concepts split across many atoms (feature splitting) or get absorbed into a single atom (feature absorption).
  • Site- and checkpoint-specificity: A dictionary trained on one model or one layer rarely transfers verbatim to another. The cost of training and storing a large over-complete dictionary per analyzed site is non-trivial.

Submethods

The three main forms below follow a progression of increasing scope — from a single activation site, to cross-site mappings, to cross-layer or cross-model analysis.

  • Sparse Autoencoders (SAE): The canonical instance: train an autoencoder on activations from a single site. The encoder maps an activation $\mathbf{a}$ to a sparse feature vector via $\mathbf{f}(\mathbf{a}) = \text{act}(\mathbf{W}_e \mathbf{a} + \mathbf{b}_e)$, where act is typically ReLU (L1 penalty), top-k, or JumpReLU depending on the variant. The decoder then reconstructs $\hat{\mathbf{a}} = \mathbf{W}_d \mathbf{f}(\mathbf{a}) + \mathbf{b}_d$, with columns of $\mathbf{W}_d$ serving as the dictionary atoms. The per-token values in $\mathbf{f}(\mathbf{a})$ are the feature firings used for downstream interpretability. You can find a demo for this method in ./SAE. This demo shows saelens: Use this skill when working with Sparse Autoencoders (SAEs) for mechanistic interpretability of language models, including training SAEs, loading pre-trained SAEs, analyzing neural network features, or integrating SAEs with TransformerLens, HuggingFace Transformers, or other PyTorch-based models.

Read the full file on GitHub · 37 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 37 lines · 122 tokens per session scan A 278602d3eee6

Subscribe to this mod's changes

Feature Dictionary Learning is a skill published in the GitHub repository zjunlp/Mechanist (51 stars, last pushed 9d ago), licensed MIT. It adds 122 tokens to every session and 1,405 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories