# TransformerLensOrg/TransformerLens

A library for mechanistic interpretability of GPT-style language models

Repository: https://github.com/TransformerLensOrg/TransformerLens
Canonical: https://ross.abutalabs.com/products/transformerlens
Homepage: https://transformerlensorg.github.io/TransformerLens/
Language: Python
License: MIT
License Family: permissive
Last push: 2026-08-26T17:47:34+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 99, longevity 100
- inputs: {"age_days": 1468, "days_push": 7, "days_rel": 11, "gap_med": 10.5, "n_releases_24m": 41}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3825, forks 678 (observed 2026-08-28T04:08:21.892237+00:00)

## What it is
TransformerLens is a Python library for mechanistic interpretability of GPT-style transformer language models. It lets researchers load thousands of open-source models and inspect, cache, and edit internal activations via hooks as the model runs.

## Use cases
- inspect internal activations of transformer models
- reverse engineer algorithms learned by language models
- run activation patching experiments on GPT-2 style models
- hook and edit model activations during a forward pass
- study attention heads and circuits in LLMs
- load HuggingFace models for interpretability research

## When to choose
- you want to analyze or edit internal activations of open-source language models
- you're doing mechanistic interpretability research on transformers
- you need hook-based access to model internals across many architectures

## When to avoid
- you just need to run inference or fine-tune models without inspecting internals
- you need a production serving or deployment tool
- you work with non-transformer model architectures

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, llm-inference, developer-tools, sdk
- domain: machine-learning, deep-learning, large-language-models, artificial-intelligence
- platform: python, cross-platform
- tags: mechanistic-interpretability, activation-caching, hooking, transformers, explainability, pytorch, research, gpu

## Member repositories
- TransformerLensOrg/TransformerLens (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:21.892237+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:26:22.148308+00:00, confidence not recorded.
  - readme: https://github.com/TransformerLensOrg/TransformerLens (fetched 2026-08-28T04:08:21.892237+00:00, sha 92bbe611cf34)
  - homepage: https://transformerlensorg.github.io/TransformerLens/ (fetched 2026-08-29T09:21:08.878165+00:00, sha 14eb486f80bf)
- Data as of 2026-08-30T08:39:29.467469+00:00.
