claude

nnsight

Neural network interpretability with nnsight and NDIF - tracing and intervening on model internals, debugging, remote execution, logit lens, activation patching, attribution patching, causal tracing, and steering

15 on GitHubby NDIF Teamv2.0.0MITupdated yesterday
/

Plugin nnsight from marketplace ndif-team in ndif-team/skills. Commands read from the repo's manifest — yesterday.

What it installs

Skills (19)

  • ablation

    Measure what a component contributes by removing it — one component at a time, no contrast prompt — with zero, mean, resample or noise ablation of layers, attention heads, MLPs, neurons and token positions. Use to test necessity ("does the model still work without this?"), to sweep every component f

  • activation-patching

    Establish which components causally carry a behavior by copying activations between a clean and a corrupt prompt — denoising and noising across layers, positions, attention heads and MLPs. Use to localize where a fact or capability lives, to confirm a component found by a probe or attention pattern

  • attention-analysis

    Extract and analyze attention patterns and per-head behavior — attention probability matrices from attn.output[1] or .source, the anchors that check they really are probabilities, per-head metrics (entropy, previous-token, attention-sink, induction), automatic head-type detection, and what each head

  • attribution-patching

    Approximate activation patching with gradients — attribution = (clean activation − corrupt activation) · gradient of the metric — so a whole layer×position×head map costs two forward passes and one backward instead of one forward pass per component. Use to rank all heads or positions at once with tw

  • causal-tracing

    Localize where a model stores and retrieves a fact using the ROME protocol — corrupt the subject tokens with noise, restore individual hidden states from the clean run, and measure how much of the correct answer's probability comes back. Use for factual-recall localization, for producing a (layer ×

  • circuit-discovery

    Find the subgraph of components a model uses for a task and prove it is the right one — the deliverable is a validated set of components plus the evidence. Covers task and metric design, per-head attribution to rank candidates, edge attribution and path patching for connections, greedy pruning, and

  • debugging

    Diagnose and fix nnsight code that errors, hangs, returns nothing, or silently does the wrong thing — OutOfOrderError, NameError or UnboundLocalError after the trace, save() outside a trace, "Cannot access outside of interleaving", WithBlockNotFoundError, a nested trace inside another trace, empty s

  • diffusion-and-multimodal

    Trace and intervene on models that are not text-only — vision-language models (image+text via TransformersModel with a processor), diffusion pipelines via DiffusionModel, and audio/vision encoders. Use to find where image information enters the language stream, to patch or ablate image tokens versus

  • interp-experiment-design

    A planning checklist and router for interpretability experiments, not a technique. Use to plan a study, when asking "is this result real?", to decide which method answers a question (logit lens, probing, patching, tracing, ablation, attribution, circuits, SAEs, steering, editing), or to choose contr

  • logit-lens

    Decode what a model predicts at every layer by applying its final norm and unembedding to intermediate residual streams. Use to see where in depth an answer emerges, to track a specific token's probability across layers, to sanity-check that a model knows a fact before running invasive interventions

  • model-editing-and-lora

    Change what a model knows or how it behaves, persistently — direct weight edits, ROME-style rank-one updates, persistent activation edits via model.edit, loading PEFT/LoRA adapters, and training a LoRA or adapter through a frozen model with nnsight's interleaved backward. Use to install or overwrite

  • model-steering

    Change a model's behavior at inference time by adding a direction to its residual stream — contrastive activation addition, steering vectors, always-on steering via model.edit(), and function vectors extracted from in-context-learning prompts. Use to induce or suppress a behavior (sentiment, refusal

  • nnsight

    Read, modify, and analyze the internals of neural networks with nnsight — tracing activations with model.trace, intervening on modules, batching interventions, gradients, caching, generation, and running on NDIF. Use for any task that touches model internals rather than just model outputs: interpret

  • probing

    Load when training a classifier on activations — asking whether a property (truth, sentiment, an entity) is linearly decodable, at which layer, and whether the model actually uses it. Covers one-pass collection, logistic-regression and difference-in-means probes, layer sweeps, controls (lexical spli

  • quantization

    Load a model in 4 or 8 bits by naming the format where you would name a dtype — TransformersModel(..., dtype="nf4"). Covers the accepted names (nf4/int4/4bit, fp4, int8/8bit, fp8), what a trace sees (module paths and activations are unchanged; raw .weight is a packed blob), the compute dtype and why

  • remote

    Write and optimize nnsight code that runs on NDIF — remote=True, model.session(remote=True), blocking=False jobs, and models too large to run locally (Llama-70B/405B, DeepSeek). Use whenever remote execution is involved even if the user did not ask for optimization — the two costs (too many requests

  • sae-and-dictionary-learning

    Work with sparse autoencoders and dictionary learning in nnsight — attaching an SAE into a model's forward path, reading feature activations, finding max-activating examples, steering with features, measuring reconstruction error, and training a dictionary. Use when analyzing models at the level of

  • tensor-parallel

    Trace a model too big for one GPU by sharding it with transformers tensor parallelism — TransformersModel(..., distributed_config=DistributedConfig(tp_size=N)) under torchrun, with the full API (gradients, .source, list batches); for throughput, serving or streaming without those, see the vllm skill

  • vllm

    Run nnsight interventions inside the vLLM inference engine — continuous batching, tensor parallelism, CUDA-graph taps, async streaming, engine-wide edit() and nnsight-serve. Use for throughput, many concurrent prompts, streamed tokens, or a served engine; for a sharded model that needs gradients, .s

View source on GitHub

More from ndif-team/skills

All 3 plugins →

ndif

claude

Self-hosting NDIF, the server behind nnsight's remote=True - standing one up with docker run, compose, or the ndif CLI; deploying, pinning and sizing models; troubleshooting; and changing the server itself

4 skills

15

nnterp

claude

Architecture-agnostic interpretability with nnterp, a layer on nnsight that gives every transformer family the same module names and standard values - usage of the values, recipes that run unchanged across families, and extending it with a new family

3 skills

15

Maintain nnsight?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex plugins3 plugins