research.attention.probe

Sets up TransformerLens and nnsight intervention experiments for mechanistic interpretability analysis of LLMs.

Updated May 9, 2026
One-click install
npx skills add https://github.com/0h-n0/auto-research --skill research-attention-probe-0h-n0
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: research.attention.probe
Source: https://github.com/0h-n0/auto-research/tree/main/skills/research.attention.probe
Command: npx skills add https://github.com/0h-n0/auto-research --skill research-attention-probe-0h-n0

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformer_lens, nnsight, circuitsvis, einops, jaxtyping, and includes references (resource) components.

What problem does it solve? Running mechanistic interpretability experiments (logit lens, activation patching, probing) on LLMs requires repetitive setup: loading hooked models, caching expensive forward passes, and structuring intervention scripts. This Skill standardizes that setup so attention-focused research projects can run causal internal analysis without rebuilding infrastructure each time. ## Core Features & Use Cases - Intervention Protocol Templates: Provides ready-to-adapt one-file scripts for logit lens, attention pattern visualization, activation patching, path patching, probing classifiers, and SAE feature lookup. - Activation Caching: Implements SHA256-keyed caching of forward pass activations to avoid recomputing runs longer than 30 minutes, with cache hit/miss logging. - Structured Results: Enforces a JSON result format with seeds, confidence intervals, shuffled controls, and mandatory alternative explanations. - Use Case: In an auto-research project on attention mechanisms, generate a probe.py wrapper and an analysis script to test whether head L5H3 implements previous-token copying via activation patching across 64+ examples and 3 seeds. ## Quick Start Set up the attention probing environment for my auto-research project and create an activation patching script to test my hypothesis about head L5H3.

Frequently Asked Questions about research.attention.probe

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

FAQPage Schema
How do I run activation patching with TransformerLens?▼

Activation patching replaces a corrupted prompt's activations with clean-run activations at a specific component using run_with_hooks and fwd_hooks. Measure the logit difference on the target token; strong evidence requires 64+ prompts, 3 seeds, and a shuffled-label control where the effect disappears.

TransformerLens vs nnsight for mechanistic interpretability?▼

TransformerLens (HookedTransformer) suits models up to 7B parameters with full local intervention support. nnsight with remote tracing is recommended for 8B-70B models to reduce memory usage. Models above 70B accessed via API only allow logit lens, not interventions.

What is logit lens and how do I implement it?▼

Logit lens applies the model's unembedding matrix directly to each layer's residual stream to observe how next-token predictions form across layers. Run the model with run_with_cache, extract hook_resid_post per layer, multiply by W_U, and track the target token's rank.

Does a high probing classifier accuracy prove a model uses that information?▼

No. High linear probe accuracy only shows information is linearly encoded in the representation, not that the model causally uses it. Always run a random-label shuffle control to detect overfitting, and prefer causal interventions like activation patching for stronger claims.

Why cache activations during interpretability experiments?▼

Forward passes over large prompt sets can take over 30 minutes, so activations are saved to disk keyed by a SHA256 hash of model ID, prompts, and hook points. Cache hits and misses are logged to events.jsonl so reruns skip redundant computation.

What are the limitations of attention pattern visualization?▼

Attention patterns show where a head attends but reveal nothing about causality. Observing a pattern is only hypothesis-generating; it must be combined with activation or path patching across sufficient examples and seeds to establish causal claims.