entoscope¶
entoscope is a modular framework for mechanistic interpretability: it runs operations that analyze the internals of large language models, built on TransformerLens. It supports four operations for now, each computed by one or more methods:
Operation |
Methods |
Description |
|---|---|---|
|
Projects activations and weights onto the vocabulary to show which tokens they promote. |
|
|
Patches activations from one run into another and measures how the output changes. |
|
|
Trains classifiers on activations to find where the model represents a property of its input. |
|
|
Traces the routes through attention heads and MLPs that carry the model’s prediction. |
The operations share most of what you need to learn about them:
Every operation has the same four parts: a config says what to run, an input pairs it with the prompts, an operator runs it, and a collector writes the results.
Where an operation works in the model is specified flexibly: any activation, swept over layers, heads, neurons and positions, narrowed by filters, grouped to read several together, or listed point by point.
A config can be built in Python or read from a YAML file, and every run saves the config it ran under next to its results.
plandescribes a run (what it reads, how many forward passes, which files) without running the model.Results are CSV files (graph files for circuits), and every operation but probing draws them on an interactive HTML page you open in a browser.
Every method is a registered class, and your own methods register and run the same way.
Where to go¶
Getting started: install entoscope and make a first run.
Examples: a script and a YAML file of configs for every operation.
Concepts:
Operations: Lens, Activation patching, Probing, Circuit discovery.
Guides: Experiment scripts, Custom methods, Datasets.
API reference, generated from the docstrings.
Development: working on entoscope itself.