Downloads · 30 days
0
andyx10/jacobian-lens-qwen3-8b
jacobian-lens-qwen3-8b is a machine learning model from andyx10. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for jlens. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Jul 12, 2026
Repo size
1.2 GB
Likes
0
Public
Click a slice to open those files.
.pt1.2 GB · 100%
From the Hugging Face model README

A fitted Jacobian lens (J-lens) for Qwen/Qwen3-8B,
from Anthropic's Verbalizable Representations Form a Global Workspace in Language
Models, fitted with the
reference implementation anthropics/jacobian-lens.
qwen3_8b_lens.pt — a torch.save dict with keys J (dict layer -> [4096, 4096]
fp16 tensor), n_prompts, source_layers, d_model. Load it with
jlens.JacobianLens.load(...).
| field | value |
|---|---|
| base model | Qwen/Qwen3-8B (36 layers, d_model=4096) |
| source layers | 0–34 (all 35 layers below the final) |
| target layer | 35 (final) |
| Jacobian shape | [4096, 4096] per layer, fp16 on disk |
| file size | ~1.09 GiB |
| fitting corpus | 100 WikiText-103 prompts × 128 tokens (first 16 positions skipped as attention sinks) |
| estimator | dim_batch=32, mean over valid source positions |
| fit hardware | 1× NVIDIA H100 80GB, ~52 min |
import torch, transformers, jlens
from huggingface_hub import hf_hub_download
hf = transformers.AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-8B", dtype=torch.bfloat16
).to("mps") # or "cuda"
tok = transformers.AutoTokenizer.from_pretrained("Qwen/Qwen3-8B")
model = jlens.from_hf(hf, tok)
path = hf_hub_download("dormantx/jacobian-lens-qwen3-8b", "qwen3_8b_lens.pt")
lens = jlens.JacobianLens.load(path)
# per-layer lens logits at the last position, J-lens vs logit-lens baseline
lens_logits, model_logits, _ = lens.apply(
model, "Fact: The currency used in the country shaped like a boot is",
positions=[-1], layers=[16, 20, 24], use_jacobian=True,
)
Apache-2.0, matching the reference implementation. The base model
Qwen/Qwen3-8B is subject to its own license.