Skill · em Dados, IA e pesquisa

transformer-lens-interpretability

Provides guidance for mechanistic interpretability research using TransformerLens to inspect and manipulate transformer internals via HookPoints and activation caching. Use when reverse-engineering model algorithms, studying attention patterns, or performing activation patching experiments.

Procedência

Antes de instalar

4 arquivos · 31,4 KB · só texto, nenhum script

Instalar na sua CLI

O comando baixa a versão fixada (commit 57f899e) direto da origem, para a pasta que a CLI lê. Precisa de curl (macOS e Linux); no Windows não há comando, porque o Rook Labs é para macOS.

Claude Code

Neste projeto: instala em .claude/skills/transformer-lens-interpretability/.

d=".claude/skills/transformer-lens-interpretability"
u="https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/skills/ai-research/mechanistic-interpretability-transformer-lens"
curl -fsSL --create-dirs \
  -o "$d/SKILL.md" "$u/SKILL.md" \
  -o "$d/references/api.md" "$u/references/api.md" \
  -o "$d/references/README.md" "$u/references/README.md" \
  -o "$d/references/tutorials.md" "$u/references/tutorials.md"

Global: instala em ~/.claude/skills/transformer-lens-interpretability/.

d="$HOME/.claude/skills/transformer-lens-interpretability"
u="https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/skills/ai-research/mechanistic-interpretability-transformer-lens"
curl -fsSL --create-dirs \
  -o "$d/SKILL.md" "$u/SKILL.md" \
  -o "$d/references/api.md" "$u/references/api.md" \
  -o "$d/references/README.md" "$u/references/README.md" \
  -o "$d/references/tutorials.md" "$u/references/tutorials.md"

Codex

Neste projeto: instala em .agents/skills/transformer-lens-interpretability/.

d=".agents/skills/transformer-lens-interpretability"
u="https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/skills/ai-research/mechanistic-interpretability-transformer-lens"
curl -fsSL --create-dirs \
  -o "$d/SKILL.md" "$u/SKILL.md" \
  -o "$d/references/api.md" "$u/references/api.md" \
  -o "$d/references/README.md" "$u/references/README.md" \
  -o "$d/references/tutorials.md" "$u/references/tutorials.md"

Global: instala em ~/.agents/skills/transformer-lens-interpretability/.

d="$HOME/.agents/skills/transformer-lens-interpretability"
u="https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/skills/ai-research/mechanistic-interpretability-transformer-lens"
curl -fsSL --create-dirs \
  -o "$d/SKILL.md" "$u/SKILL.md" \
  -o "$d/references/api.md" "$u/references/api.md" \
  -o "$d/references/README.md" "$u/references/README.md" \
  -o "$d/references/tutorials.md" "$u/references/tutorials.md"

Antigravity

Neste projeto: instala em .agents/skills/transformer-lens-interpretability/.

d=".agents/skills/transformer-lens-interpretability"
u="https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/skills/ai-research/mechanistic-interpretability-transformer-lens"
curl -fsSL --create-dirs \
  -o "$d/SKILL.md" "$u/SKILL.md" \
  -o "$d/references/api.md" "$u/references/api.md" \
  -o "$d/references/README.md" "$u/references/README.md" \
  -o "$d/references/tutorials.md" "$u/references/tutorials.md"

Global: instala em ~/.gemini/antigravity-cli/skills/transformer-lens-interpretability/.

d="$HOME/.gemini/antigravity-cli/skills/transformer-lens-interpretability"
u="https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/skills/ai-research/mechanistic-interpretability-transformer-lens"
curl -fsSL --create-dirs \
  -o "$d/SKILL.md" "$u/SKILL.md" \
  -o "$d/references/api.md" "$u/references/api.md" \
  -o "$d/references/README.md" "$u/references/README.md" \
  -o "$d/references/tutorials.md" "$u/references/tutorials.md"

Peça ao Rook

Já usa o Rook Labs? Cole no chat do Rook: instale a skill https://rooklabs.sh/marketplace/cct.transformer-lens-interpretability

Prévia do SKILL.md

---
name: transformer-lens-interpretability
description: Provides guidance for mechanistic interpretability research using TransformerLens to inspect and manipulate transformer internals via HookPoints and activation caching. Use when reverse-engineering model algorithms, studying attention patterns, or performing activation patching experiments.
version: 1.0.0
author: Orchestra Research
license: MIT
tags: [Mechanistic Interpretability, TransformerLens, Activation Patching, Circuit Analysis]
dependencies: [transformer-lens>=2.0.0, torch>=2.0.0]
---

# TransformerLens: Mechanistic Interpretability for Transformers

TransformerLens is the de facto standard library for mechanistic interpretability research on GPT-style language models. Created by Neel Nanda and maintained by Bryce Meyer, it provides clean interfaces to inspect and manipulate model internals via HookPoints on every activation.

**GitHub**: [TransformerLensOrg/TransformerLens](https://github.com/TransformerLensOrg/TransformerLens) (2,900+ stars)

## When to Use TransformerLens

**Use TransformerLens when you need to:**
- Reverse-engineer algorithms learned during training
- Perform activation patching / causal tracing experiments
- Study attention patterns and information flow
- Analyze circuits (e.g., induction heads, IOI circuit)
- Cache and inspect intermediate activations
- Apply direct logit attribution

**Consider alternatives when:**
- You need to work with non-transformer architectures → Use **nnsight** or **pyvene**
- You want to train/analyze Sparse Autoencoders → Use **SAELens**
- You need remote execution on massive models → Use **nnsight** with NDIF
- You want higher-level causal intervention abstractions → Use **pyvene**

## Installation

```bash
pip install transformer-lens
```

For development version:
```bash
…

Ver todo o marketplace