Study which internal concepts a language model activates while processing a prompt.
Compare how different open models like Qwen and Llama represent information internally.
Test whether a model thinks in a particular pretraining language regardless of input language.
Reproduce interpretability research findings on your own choice of open model.
| kameshkanna/jspace | 0-bingwu-0/live-interpreter | 010zx00x1/faresnipe | |
|---|---|---|---|
| Stars | 2 | 2 | 2 |
| Language | Python | Python | Python |
| Setup difficulty | hard | moderate | easy |
| Complexity | 4/5 | 2/5 | 2/5 |
| Audience | researcher | general | general |
Figures from each repo's GitHub metadata at analysis time.
Requires downloading large open-weight models and a capable GPU, a full experiment run takes about 50 minutes on an H100.
jspace is a research project that rebuilds the methods from an Anthropic research paper about how large language models think internally, so that anyone can run the same analysis on open, publicly available AI models instead of Anthropic's own models. The original paper found that language models seem to form something like a shared internal workspace in their middle layers: at any moment, somewhere between 10 and 25 concepts are active at once, and these concepts can be put into words rather than staying as abstract, uninterpretable numbers. The paper also found that a model tends to think internally in whatever language it was mostly trained on, even when the question it is answering is written in a different language. For example, a model mostly trained on Chinese text may still think in Chinese internally even when asked a question in English. This project reproduces both of those findings using two open models, Qwen2.5-7B and Llama-3.1-8B, following the same mathematical approach as the original paper. It includes tools to compute what the README calls a Jacobian Lens, a way of tracing how information flows from an early layer of the model through to its final output, and a Workspace Analyzer that combines four different signals to detect where in the model this shared workspace appears and how many concepts are active there at once. Getting started involves cloning the repository and running a setup script that installs everything needed for either the Qwen or the Llama model. From there, a two-step process first fits the Jacobian Lens for a chosen model and saves the result, then runs the workspace analysis using that saved data along with a set of prompts. The project also exposes a Python interface so the same steps can be run directly from code rather than the command line. The repository supports several other open model families as well, including Mistral, Gemma, GPT-2, GPT-J, Falcon, and OPT, as long as they follow a standard layer structure. It also includes a language pivot experiment with 14 prompts across English, Chinese, and Japanese, and reports that both the Qwen and Llama models it tested do think in their dominant pretraining language internally regardless of what language the input is written in, matching the original paper's conclusion. Running the full experiment on both models takes about 50 minutes on an H100 GPU.
An open reimplementation of Anthropic research showing how language models form a shared internal workspace of concepts, runnable on open models like Qwen and Llama.
Mainly Python. The stack also includes Python, PyTorch, HuggingFace.
The README does not state a license.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Verify against the repo before relying on details.