Lens
What is represented inside?
Decode residual states, attention-head outputs, and projected visual embeddings into vocabulary predictions.
Lens method guidesA TOOLKIT FOR MODEL INTERPRETABILITY
Beyond the answer.
Inside the model.
Explore internal predictions, attention, causal dependence, and sparse features in language, vision, and multimodal models.
Lens readouts · Attention explanations · Causal interventions · Sparse features
“Is the shirt black or yellow?”
One model binding.
Four complementary views.
vlmprobe connects observations and interventions through one interface bound to a model you already own.
Read vocabulary predictions from internal states. Compare attention patterns on the same input. Intervene on activations or attention routes and measure what changes. Train or load sparse dictionaries to inspect individual features. Explicit adapters handle model-specific hook locations, visual-token coordinates, and readouts.
Each result keeps tensors and experiment metadata together, so the same computation can be inspected, visualized, saved, and replayed.
From internal predictions to controlled changes,
choose the view your research question needs.
What is represented inside?
Decode residual states, attention-head outputs, and projected visual embeddings into vocabulary predictions.
Lens method guidesWhere does the model look?
Compare attention flow and target-conditioned spatial attributions on the same image and question.
Attention method guidesWhich computations matter?
Patch activations, isolate paths, block attention routes, or steer residual states and measure the effect.
Causal method guidesWhich sparse features activate?
Train or load dictionaries, locate activating tokens or image regions, and measure feature edits with reconstruction controls.
SAE method guidesPretrained model cardsMethod availability depends on the model adapter. Fitted lenses and SAE dictionaries require matching model, layer, and input conventions.
A shared execution contract connects native inputs,
explicit adapters, and structured results.
Architecture-specific hooks and expanded visual-token coordinates.
Unsupported operations are distinguished from measured zero effects.
Tensors, metadata, and shared visualizations travel together.
Replay a real Attention Knockout scan.
Different routes have different effects on the same input.
Joint windows of up to 9 consecutive layers, clipped at the boundaries; all heads are blocked at masked pre-softmax attention logits. Layer indices start at zero. LLaVA-1.5-7B uses bf16 model execution and float32 probability readout.
This browser replays stored numbers; it does not run a new intervention. A single GQA example does not establish dataset-level performance.
View original measurementGPT-2 · inputs, calibration & readouts
LENSSmolVLM · image inputs & lens calibration
ATTENTIONViT-B/16 · input-to-map walkthrough
ATTENTIONSmolVLM · complete-answer attribution
CAUSALGPT-2 · measured & estimated patch effects
CAUSALSmolVLM · live route blocking
CAUSALGPT-2 · controlled receiver replay
CAUSALSmolVLM · live captions & strength responses
CAUSALGPT-2 · edge scores & circuit recovery
Notebooks prepare raw inputs, run the library and draw fresh results. Calibrated lenses include training steps; costly optional sections are labeled explicitly.
Eight VLM families, with language and vision controls.
Check capabilities for your specific model and method.
Adapter support and pretrained validation are different scopes. Five pretrained VLMs were exercised in the technical report; some families have architecture-level validation. Qwen3.5 has restrictions across its hybrid attention stack. Fitted decoders are not supplied for every model.
Read the capability matrixInstall from PyPI, bind a loaded model, and inspect the methods available to it.
Read the API guideModel weights and complete datasets are downloaded separately.
# Install from PyPI
python -m pip install "vlmprobe[transformers,visualization]"
# In Python, with your loaded model and native inputs
from vlmprobe import Prober
probe = Prober(model, processor)
print(probe.describe())
result = probe.lens.logit(
layers=[0, 13, 27],
tokens="last_prompt",
).run(inputs)
result.save("outputs/logit_lens")Shared-case comparisons across five pretrained VLMs, with language and vision controls.
DOCUMENTATIONModel loading, method definitions, calibration workflows, and visualization tools.
PROVENANCEOriginal methods, author implementations, and sources used for the demonstrations.