Jacobian Lens is Anthropic’s reference implementation for examining what a language model’s internal activations are inclined to produce as text. It transports residual-stream vectors from selected layers and positions into the final-layer basis using an averaged input-output Jacobian. The transformed vectors are decoded through the model’s own unembedding into ranked vocabulary predictions. The package can fit new lenses, load saved ones, apply them to prompts, and merge results from parallel fitting jobs. Interactive layer-by-position views reveal how token rankings evolve across the network and compare them with the model’s final output. It supports open-weight Hugging Face decoder models, with Qwen used in the included examples. The repository also provides synthetic evaluation data and an end-to-end notebook, but it is not maintained.
Features
- Average-Jacobian activation transport
- Ranked vocabulary prediction readouts
- Support for Hugging Face decoder models
- Custom lens fitting and checkpoint loading
- Parallel fitting and lens merging
- Interactive layer-by-position visualizations