Definition
Plain language
A popular Python library that lets researchers peek inside transformer models layer by layer.
As stated in the literature
An open-source library providing hooks and tooling for inspecting and intervening on internal activations of transformer language models.
Why it matters: It lowers the barrier to mechanistic interpretability work, letting more researchers probe and intervene on real model internals.
For example, a researcher can use TransformerLens to hook into a specific attention head and zero out its contribution to see how the model's answer changes.
Heard on the show
“They load it through TransformerLens, a tool that lets you intercept and modify the model's internal state at every layer of the forward pass.”Episode 018 — Language Models Compute the Rational Move, Then Override It