Views
No views yet
openai/gpt-oss-20b. As of training there was no published tuned lens for any gpt-oss model, and
AlignmentResearch/tuned-lens's model_surgery does not recognise GptOssForCausalLM (its layer/norm/unembed
lookup is a hardcoded isinstance cascade). This lens was trained with a self-contained trainer
(../tuned_lens_gptoss.py) that reuses this project's MXFP4 loader, but the artifact is saved in
tuned-lens's native format so it is a drop-in TunedLens.idx, a learned affine map corrects the residual stream so the model's own final
norm + unembedding decodes it into a faithful next-token distribution:transform_hidden(h, idx) = h + translator[idx](h) # residual delta, zero-init == logit lens
lens_logits(h, idx) = lm_head(final_norm(transform_hidden(h, idx)))hidden_states[0..23]; hidden_states[24] is the model's own output.
Objective: KL(model_final_dist || lens_dist) — i.e. distil the model's output distribution
(NOT cross-entropy to the true next token). This is the defining tuned-lens objective.| file | contents |
|---|---|
config.json | TunedLensConfig fields (d_model=2880, num_hidden_layers=24, lens_type="linear_tuned_lens", ...) |
params.pt | layer_translators.state_dict() — keys "0.weight","0.bias",...,"23.weight","23.bias" |
HuggingFaceFW/fineweb (sample-10BT), streamed, packed into 1024-token sequences.no_grad; per-layer
backward+free keeps the 201k-vocab logits for at most one layer live at a time.mean KL-to-model and top-1 agreement with the model, tuned vs the logit-lens baseline, on held-out
sequences. Two distributions:| metric | logit lens | tuned (FineWeb, on-dist) | tuned (Wikipedia, off-dist) |
|---|---|---|---|
| mean KL (nats) | ~7 | 0.55 | 1.04 |
| mean top-1 agreement | ~10% | 48.7% | 45.8% |
predict)python ../tuned_lens_gptoss.py predict --lens . --prompt "The capital of France is"python ../tuned_lens_gptoss.py eval --lens . --data-file <held-out.jsonl> --seqs 60 --split-skip 0../tuned_lens_gptoss.py (load_lens + lens_logits).TunedLens (requires adding a GptOssForCausalLM branch to tuned-lens's
model_surgery, since it is otherwise unsupported):1from tuned_lens.nn.lenses import TunedLens # after patching model_surgery for gpt-oss
2lens = TunedLens.from_unembed_and_pretrained(unembed, lens_resource_id="<this dir>")tuned-lens: as of release, AlignmentResearch/tuned-lens's
model_surgery does not yet recognise GptOssForCausalLM, so from_model_and_pretrained needs a small
model_surgery branch for gpt-oss (mapping to model.model.layers / model.model.norm / lm_head).
Until that lands upstream, load with the self-contained helpers in tuned_lens_gptoss.py (load_lens +
lens_logits), which reproduce the exact tuned-lens convention. A model_surgery PR is planned.