nnsight-remote-interpretability

Intervene in PyTorch model activations with local or NDIF remote execution.

2|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-config --skill nnsight-remote-interpretability-clay-hhk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nnsight-remote-interpretability
Source: https://github.com/Clay-HHK/claude-config/tree/main/skills/AI-research-SKILLs/04-mechanistic-interpretability/nnsight
Command: npx skills add https://github.com/Clay-HHK/claude-config --skill nnsight-remote-interpretability-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enables researchers and engineers to access, analyze, and modify internal activations and module outputs of PyTorch models so interpretable causal experiments can be run on small local models or massive remote models without local GPU resources.

Core Features & Use Cases

  • Activation analysis: Collect and inspect hidden states and attention patterns across layers for diagnostic and research purposes.
  • Activation patching & interventions: Replace or modify layer activations during generation to test causal effects on model outputs.
  • Remote execution via NDIF: Run identical interpretability code locally or remotely on large foundation models (70B+) by toggling remote=True and using NDIF sessions.
  • Cross-prompt sharing & generation steering: Share activations between prompts, perform in-trace interventions during generation, and compute steering vectors for behavior modification.
  • Gradient-based inspection: Retain gradients for saved activations to support attribution and influence analyses (not supported with vLLM or remote execution).

Quick Start

Use nnsight to run an activation-patching experiment by loading a PyTorch model with LanguageModel, collecting a target layer's activations with .save() in a trace, and then re-injecting those activations into a second trace (enable remote=True to run on NDIF).

Frequently Asked Questions about nnsight-remote-interpretability

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

FAQPage Schema
How do I run activation patching on PyTorch models to test causal effects?

Activation patching involves collecting a target layer's activations with .save() in a trace, then re-injecting those activations into a second trace to test causal effects on model outputs during generation.

Can I inspect internal activations of large foundation models without local GPU resources?

Yes, you can inspect large foundation models remotely by toggling remote=True and using NDIF sessions, enabling identical interpretability code to run on 70B+ models without local GPU hardware.

Does nnsight remote interpretability support gradient inspection and attribution analysis?

Gradient-based inspection is supported by retaining gradients for saved activations to support attribution and influence analyses, but this feature is not supported with vLLM or remote execution.

How do I share activations between prompts for generation steering?

You can share activations between prompts and perform in-trace interventions during generation by saving activations from one trace and assigning them within another to compute steering vectors for behavior modification.

Is this interpretability approach compatible with HuggingFace model structures?

Yes, the approach is fully compatible with PyTorch and HuggingFace model structures, allowing you to load models with LanguageModel and access internal modules for diagnostic and research purposes.