whatisgithub

What is jacobian-lens?

anthropics/jacobian-lens — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2026-07-17

⭐ On the rise1,434PythonAudience · researcherComplexity · 4/5ActiveSetup · moderate

In one sentence

A research tool that decodes a language model's internal layer-by-layer activations into ranked word predictions, creating an interactive heatmap of when and where concepts form inside the model.

Mindmap

mindmap
  root((repo))
    What it does
      Decodes internal model states
      Shows layer-by-layer concepts
      Interactive heatmap grid
    How it works
      Bridges early to final layer
      Learns layer transformations
      Fast-forwards internal signals
    Tech stack
      Python
      HuggingFace models
      Qwen models
    Use cases
      Track concept formation
      Interpretability research
      Layer-by-layer analysis
    Audience
      AI researchers
      ML engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Investigate which layer a language model first represents a specific concept like a country or object.

USE CASE 2

Build an interactive heatmap showing how word predictions evolve across model layers and text positions.

USE CASE 3

Analyze how a model transforms information internally by decoding activations at any intermediate layer.

What is it built with?

PythonHuggingFaceQwen

How does it compare?

anthropics/jacobian-lensvibeforge1111/keep-codex-fastkaranhudia/borg-ui
Stars1,4341,4561,464
LanguagePythonPythonPython
Last pushed2026-07-172026-05-06
MaintenanceActiveMaintained
Setup difficultymoderateeasymoderate
Complexity4/52/53/5
Audienceresearcherdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires downloading an open-weights model from HuggingFace and processing a batch of text sequences, with training speed bounded by the model's inference speed.

No license information is provided, meaning default copyright restrictions apply and usage rights are unclear.

So what is it?

The jacobian-lens project (also called jlens) is a research tool that lets you peek inside a language model and see what it is "thinking" at each individual layer. When a language model processes text, it builds up an understanding step by step, but that internal state is usually a black box. This tool takes a snapshot of the model's internal activations at any point and translates them into a ranked list of actual words the model is most inclined to say next. For example, if the model is processing an ASCII drawing of a face, this tool can show that at a certain layer and position, the model's internal state is already representing the concept of a "nose" even if that word never appears in the original text prompt. At a high level, the tool works by creating a bridge between an early or middle layer of the model and its final output layer. It studies how the model transforms information across its layers by analyzing a large batch of example texts. Once it learns this transformation pattern, it can take any internal signal from the model, fast-forward it through the remaining layers, and decode it into human-readable words. This creates an interactive, layer-by-layer heatmap showing exactly when and where specific concepts form inside the model's architecture. This tool is designed for AI researchers and engineers who study how language models represent information internally. A concrete use case would be a researcher trying to understand at which layer a model first "realizes" that Italy is the country shaped like a boot, and at which layer it connects that to the concept of the Euro. The included walkthrough notebook lets these users load a model, apply the lens, and interactively click through a visual grid to track how word representations evolve across layers and positions. A notable aspect of this project is that it is explicitly a reference implementation for an Anthropic research paper on global workspace interpretability. The README states upfront that the code is not maintained and is not accepting contributions. It is also not optimized for performance, training the lens is heavily dependent on the model's own processing speed, though the documentation notes you can parallelize the process. It works with open-weights models available on HuggingFace, using Qwen as its primary example, and it requires relatively little data to work well, with quality saturating after about a thousand text sequences.

Copy-paste prompts

Prompt 1
I want to use jacobian-lens to inspect a Qwen model on HuggingFace. Write a Python script that loads a model, applies the lens to a text prompt, and shows the top predicted words at each layer for a specific token position.
Prompt 2
Help me set up the jacobian-lens walkthrough notebook. I have a HuggingFace model loaded and want to interactively click through the layer-by-layer heatmap. Walk me through the steps to get the visual grid working.
Prompt 3
I want to train the jacobian-lens lens on about a thousand text sequences using a Qwen model. Write the code to collect activations, train the lens, and then decode an internal activation from an early layer into ranked word predictions.

Frequently asked questions

What is jacobian-lens?

A research tool that decodes a language model's internal layer-by-layer activations into ranked word predictions, creating an interactive heatmap of when and where concepts form inside the model.

What language is jacobian-lens written in?

Mainly Python. The stack also includes Python, HuggingFace, Qwen.

Is jacobian-lens actively maintained?

Active — commit in last 30 days (last push 2026-07-17).

What license does jacobian-lens use?

No license information is provided, meaning default copyright restrictions apply and usage rights are unclear.

How hard is jacobian-lens to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is jacobian-lens for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.