mechanism-skills

Route mechanistic interpretability questions to eleven method families for localizing internal model components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? When a research question concerns how a large language model computes internally — which layer, attention head, neuron, SAE feature, or weight drives a behavior — choosing the right interpretability method is difficult. This Skill routes such questions to the correct method family and enforces a hierarchical loading protocol so analysis is grounded in full method documentation rather than summaries. ## Core Features & Use Cases - Method Family Routing: Eleven families covering vocabulary projection, magnitude analysis, probing, gradient detection, causal attribution, circuit discovery, feature dictionary learning (SAE/transcoder/crosscoder), representation and parameter analysis, SHAP, neural feature learning, and multimodal concept labeling. - Screen-to-Verify Pipelines: Guidance for composing cheap screening methods (magnitude, gradients) with causal verification (patching, ablation, attribution patching) and circuit recovery. - Practical Heuristics: Rules for finding pre-trained SAEs, choosing token positions and intervention layers, and calibrating steering strength. - Use Case: A reviewer asks for mechanistic evidence that a specific attention head drives factual recall. The Skill routes you to Causal Attribution, then to the patching submethod with its demo scripts and paper references. ## Quick Start Ask the agent to identify which internal component of the model is causally responsible for a target behavior and let it route to the appropriate mechanism family.

Frequently Asked Questions about mechanism-skills

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

FAQPage Schema
How do I choose a mechanistic interpretability method for my research question?

Match the question to a method family using the selection table: magnitude analysis for cheap prominence screening, probing for decodability, causal attribution for necessity claims, and circuit discovery for end-to-end mechanisms. Then load that family's SKILL.md before proceeding.

What is the difference between activation patching and attribution patching?

Activation patching replaces an activation with a counterfactual one and re-runs the model, giving exact causal effects at high cost. Attribution patching approximates the same effect with a single backward pass via a first-order Taylor expansion, trading exactness for speed.

Should I train a Sparse Autoencoder from scratch for feature analysis?

No — first search for an existing pre-trained SAE for your target model on Hugging Face or SAELens, since training dictionaries is expensive and checkpoint-specific. Only train from scratch if the user explicitly requests it or no SAE exists.

When should I use SHAP instead of internal mechanistic methods?

Use SHAP when the question concerns how input features contribute to a single prediction on a comparable, model-agnostic scale. It provides correlational input-level attribution, not causal claims about internal components.

Why must I load family and submethod SKILL.md files before acting?

The routing file contains only previews; exact signal definitions, composition rules, runnable scripts, and failure modes live in the family and submethod files. Skipping levels risks acting on incomplete summaries and missing cross-submethod conventions.

What are the limitations of magnitude-based screening methods?

Magnitude analysis is a heuristic: high magnitude does not imply causal necessity since components can be cancelled downstream, and dormant components are missed on unrepresentative inputs. It should be followed by causal verification methods.