Views
No views yet
zai-org/GLM-5.2-FP8 (753B total / ~40B
active MoE, 78 layers, hidden size 6144, MLA + DSA sparse attention). The
Jacobian lens (Anthropic, Verbalizable Representations Form a Global
Workspace in Language Models) reads out what an internal residual is disposed
to make the model say:lens_l(h) = unembed( J_l @ h ), J_l = E[ ∂h_final / ∂h_l ]J_l is a
closed-form running mean of per-prompt Jacobians.[6144, 6144] per layer, fp16 on disk.l; target: the output of the
final decoder block (layer 77), before the final norm and unembedding.w8a8_block_dynamic
matmul ops — activation gradients only, weights frozen, straight-through with
respect to the kernels' internal activation quantization. The Jacobian here
is therefore of the fp8 model as served, which is arguably the object of
interest, but it is not the Jacobian of a bf16 dequantization.| file | prompts | layers | shape | note |
|---|---|---|---|---|
lens.pt | n=100 | L34–71 (38 layers) | [6144, 6144] fp16 | 14.2 h fit at ~9.0 min/prompt, dim_batch=32 |
Salesforce/wikitext, wikitext-103-raw-v1, train
split, streamed), records ≥ 600 characters, truncated to 128 tokens.skip_first=16,
attention-sink positions) and the final position is dropped; the per-prompt
Jacobian is the mean over the remaining ~111 source positions, with
cotangents set at every valid target position at or after the source.normalize_per_prompt=True): each prompt's
J_l is scaled to unit Frobenius norm before averaging (per-prompt gain is
heavy-tailed and the final RMSNorm makes uniform rescaling of J_l
invisible in the logits). Consequence: ||J_l||_F ≤ 1 by construction
(measured 0.31–0.95 across the band) — only the direction of J_l is
meaningful, not its absolute scale.1from transformers import AutoModelForCausalLM, AutoTokenizer
2from jlens.hf import from_hf
3from jlens.lens import JacobianLens
4
5lens = JacobianLens.from_pretrained("xiangchensong/jacobian-lens-glm-5.2")
6
7name = "zai-org/GLM-5.2-FP8"
8tok = AutoTokenizer.from_pretrained(name)
9hf_model = AutoModelForCausalLM.from_pretrained(name, torch_dtype="auto", device_map="auto")
10model = from_hf(hf_model, tok)
11
12lens_logits, model_logits, input_ids = lens.apply(
13 model, "The capital of France is", layers=[50], positions=[-1]
14)
15print(lens_logits[50].topk(5).indices) # what L50 is disposed to sayjlens release.J_l is
an expectation of gradients of zai-org/GLM-5.2-FP8's forward pass, i.e. a
function of its weights. The base model is released under the MIT License
(Copyright (c) 2026 Zhipu AI), and these matrices are released under the same
terms. No base-model weights are contained in or recoverable from these
matrices at fidelity; they are averaged input–output sensitivities.