explaingit

natfii/residual-walker

Analysis updated 2026-05-18

0JavaScriptAudience · researcherComplexity · 4/5Setup · moderate

TLDR

A local browser tool that visualizes a language model's internal reasoning as a 3D path through its layers, step by step.

Mindmap

mindmap
  root((residual-walker))
    What it does
      Visualizes model internal state
      Draws 3D path per layer step
      Shows live next-word guesses
    Tech stack
      JavaScript
      Python
      PyTorch
    Use cases
      Watch how a model reasons through a prompt
      Compare different model families side by side
      Inspect attention reads at a point in the path
    Audience
      AI researchers
      ML enthusiasts
    Concepts
      Attention and MLP updates
      Logit lens
      Activation patching

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

Watch a small local language model form its next-word guess layer by layer as a moving 3D path.

USE CASE 2

Compare how different model families process the same prompt in their own coordinate systems.

USE CASE 3

Click into a specific point on the path to inspect which earlier words the attention step read from.

What is it built with?

JavaScriptPythonPyTorchCUDA

How does it compare?

natfii/residual-walker00kaku/gallery-slider-block3rd-eden/ircb.io
Stars0
LanguageJavaScriptJavaScriptJavaScript
Last pushed2021-05-192016-11-16
MaintenanceDormantDormant
Setup difficultymoderateeasyeasy
Complexity4/52/52/5
Audienceresearchergeneraldeveloper

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

How do you get it running?

Difficulty · moderate Time to first run · 30min

Needs Python 3.10+ and a PyTorch install matched to your GPU, or a Windows prebuilt exe with no Python required.

In plain English

Residual Walker is a visualization tool that lets you watch, in real time, how a language model thinks its way through a sentence. Every layer of a transformer model updates its internal state by adding small corrections to it, once for attention and once for a small internal network called the MLP. This project captures that internal state at every one of those addition steps, squashes the high dimensional numbers down into three dimensions, and draws the result as a path moving through 3D space in your browser, one step at a time, until the model settles on the next word. You run a small language model locally through this tool rather than calling an outside service. A launcher script sets up a private Python environment, installs the right version of PyTorch for your machine, whether you have an NVIDIA graphics card or not, and lets you pick a model from a list. A Windows only prebuilt version needs no Python installed at all. As the path is drawn, different colors mark what kind of update just happened: white marks where a word's path begins, blue segments show information pulled in from other words in the sentence, and orange segments show facts or associations being recalled. At any point along the path, the tool can show what word the model would guess next if it stopped right there, so you can watch a model change its mind partway through, for example locking onto "Paris" while processing a sentence about the capital of France. The tool also lets you click on points along the path to pause and inspect them closely, showing which earlier words in the sentence were read from and how strongly. For a subset of supported models it can additionally load a more advanced lens, based on outside published research, that tries to guess what the model is silently planning to say several steps ahead of the word it actually outputs next. There is also a feature for nudging the internal state mid-generation to see how that changes what the model eventually says.

Copy-paste prompts

Prompt 1
Walk me through setting up residual-walker with Python and a local model.
Prompt 2
Explain what the blue and orange segments represent in this visualization.
Prompt 3
Help me understand what the logit lens is showing me at each step of the path.
Prompt 4
How do I try the activation patching feature to nudge the model mid-generation?

Frequently asked questions

What is residual-walker?

A local browser tool that visualizes a language model's internal reasoning as a 3D path through its layers, step by step.

What language is residual-walker written in?

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

How hard is residual-walker to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is residual-walker for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.