whatisgithub

What is gpt2-jspace?

nelithb/gpt2-jspace — explained in plain English

Analysis updated 2026-05-18

0HTMLAudience · researcherComplexity · 3/5LicenseSetup · moderate

In one sentence

A research project testing whether Anthropic's Jacobian lens beats the older logit lens for peeking inside small GPT-2 models, with a from-scratch implementation and interactive visualizer.

Mindmap

mindmap
  root((gpt2-jspace))
    What it does
      Tests Jacobian lens
      Compares to logit lens
      Documents negative result
    Tech stack
      Python
      PyTorch
      TransformerLens
    Use cases
      Interpretability research
      Lens comparison
      Visual exploration
    Audience
      ML researchers
      Interpretability students
    Setup
      CPU only fit
      Optional Colab GPU step

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

Study a from-scratch reimplementation of Anthropic's Jacobian lens that runs on CPU without newer GPU libraries.

USE CASE 2

Compare the Jacobian lens against the logit lens on GPT-2 sized models using a documented evaluation harness.

USE CASE 3

Explore an interactive visualizer that shows both interpretability lenses side by side across model layers.

USE CASE 4

Read a research log documenting ruled-out explanations for a negative experimental result.

What is it built with?

PythonHTMLPyTorchTransformerLens

How does it compare?

nelithb/gpt2-jspace100/rutgers-pbl-dining-2015a15n/a15n_old
Stars0
LanguageHTMLHTMLHTML
Last pushed2015-12-012016-06-18
MaintenanceDormantDormant
Setup difficultymoderateeasyeasy
Complexity3/51/51/5
Audienceresearchergeneralgeneral

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

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Fitting the lens on CPU takes about 15 to 20 minutes per run, only the optional Colab script needs a GPU.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

gpt2-jspace is a research project that tests a specific scientific question: does a newer interpretability tool called the Jacobian lens, introduced by Anthropic and only tested so far on their production Claude models, actually work better than an older, simpler tool called the logit lens when applied to much smaller, open source GPT-2 models. Interpretability tools like these are used by researchers to peek inside a language model and understand what it is predicting and why at each internal layer. The project builds its own from-scratch version of the Jacobian lens in Python, because the official version requires a newer version of a library that will not run on the author's older Intel Mac. This custom version was checked against the official implementation to make sure it produces matching results. The author then ran a series of experiments at two model sizes, 124 million and 355 million parameters, testing whether the Jacobian lens outperforms the logit lens at predicting the model's own next word, predicting several words ahead, and steering the model's output. The headline finding is that it does not. The Jacobian lens does not beat the simpler logit lens at this smaller scale, and the gap does not shrink as the model gets slightly bigger. Rather than stopping there, the author tested several possible explanations for this result, such as whether the comparison was unfair due to limited data, and ruled most of them out one by one, with the full process documented as it happened in a research log file. The repository also includes an interactive HTML visualizer that lets someone compare the two lenses side by side across a grid of model layers and text positions in a web browser, with no server needed since the data is bundled into the page itself. Everything runs on a regular computer's CPU except for one optional script meant to be run in Google Colab. The project is released under the MIT License and is not affiliated with Anthropic.

Copy-paste prompts

Prompt 1
Explain the difference between the Jacobian lens and the logit lens that this project is comparing.
Prompt 2
Walk me through running 14_jlens_wikitext_fit.py and 16_jlens_eval.py to reproduce the headline result.
Prompt 3
Help me open and use the jspace_visualizer.html to compare the two lenses on a prompt.
Prompt 4
Explain the candidate explanations this project ruled out in RESEARCH_LOG.md for why the Jacobian lens didn't win.
Prompt 5
Summarize how jlens_local.py was verified to match the official Jacobian lens package.

Frequently asked questions

What is gpt2-jspace?

A research project testing whether Anthropic's Jacobian lens beats the older logit lens for peeking inside small GPT-2 models, with a from-scratch implementation and interactive visualizer.

What language is gpt2-jspace written in?

Mainly HTML. The stack also includes Python, HTML, PyTorch.

What license does gpt2-jspace use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is gpt2-jspace to set up?

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

Who is gpt2-jspace for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.