Qwen/Qwen2.5-7B that, given a layer-20 last-token
hidden state v ∈ ℝ³⁵⁸⁴, generates text whose own re-encoded L20 hidden state
h maximizes the anisotropy-corrected reconstruction
fve_nrm_cen(h, v) = ½(1 + cos(h−μ, v−μ)).ρ_norm ≈ 0.92). Greedy decoding remains the open problem
(ρ_norm ≈ 0.26), still below a zero-training nearest-neighbour baseline.| Backbone (frozen) | Qwen/Qwen2.5-7B, bf16 |
| Layer / target | ℓ = 20, last-valid-token hidden of a 64-token Qwen continuation |
| AV trainable params | 12.7M (16 static prefix tokens + 1 inject slot + projection) |
| Training objective | Token CE on (v, text) pairs, where text is a Qwen continuation |
| Training data | srt-nla-targets-v1 (30K (v, text) pairs, seed=1) |
| Headline metric | best-of-64 fve_nrm_cen = 0.777 → ρ_norm = 0.92 (M=200 held-out) |
| License | Apache-2.0 (weights). Backbone subject to Qwen license at load time. |
| File | Notes |
|---|---|
best_av.pt | Warm-start AV checkpoint (ce_seq64_np16 lineage, 30k pairs) |
config.json | NLAConfig JSON; reproduces verbalizer geometry |
eval_results.json | Triangulated numbers from centered_eval.py and rerank_eval.py |
1import torch
2from huggingface_hub import hf_hub_download
3from transformers import AutoModelForCausalLM, AutoTokenizer
4from srt.nla import ActivationVerbalizer, NLAConfig
5
6repo = "RiverRider/srt-nla-av-v1"
7cfg = NLAConfig.from_json(hf_hub_download(repo, "config.json"))
8
9bb = AutoModelForCausalLM.from_pretrained(
10 "Qwen/Qwen2.5-7B", torch_dtype=torch.bfloat16
11).cuda().eval()
12for p in bb.parameters():
13 p.requires_grad = False
14tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B")
15
16av = ActivationVerbalizer(cfg, backbone=bb, tokenizer=tok).cuda().eval()
17state = torch.load(hf_hub_download(repo, "best_av.pt"), map_location="cuda",
18 weights_only=False)
19av.load_state_dict(state, strict=False)v ∈ ℝ³⁵⁸⁴ extracted from layer 20 of
the frozen backbone, draw a best-of-K rollout:1texts, _ = av.generate(v[None], do_sample=True, temperature=1.0,
2 max_new_tokens=64, num_return_sequences=64)
3# Score each candidate by fve_nrm_cen vs v, pick argmax. See
4# scripts/centered_eval.py for the canonical eval loop.fve_nrm_cen = anisotropy-corrected (subtract pool μ before cosine).
ρ_norm = (cen − 0.510) / 0.289 ∈ [0, 1] where 1 ≡ Qwen paraphrase ceiling.| condition | raw fve_nrm | centered | ρ_norm |
|---|---|---|---|
| greedy (T=0) | 0.687 | 0.586 | 0.26 |
| sampled (T=1) mean | 0.686 | 0.582 | 0.25 |
| best-of-8 | 0.768 | 0.686 | 0.61 |
| best-of-16 | 0.791 | 0.716 | 0.71 |
| best-of-32 | 0.814 | 0.747 | 0.82 |
| best-of-64 | 0.834 | 0.777 | 0.92 |
| logp-rerank | 0.653 | 0.561 | 0.18 (hurts greedy) |
| NN-anchor rerank | 0.741 | 0.722 | 0.73 |
| NN-retrieval baseline (pool=2000) | 0.795 | 0.715 | 0.71 |
| random floor | 0.622 | 0.510 | 0.00 |
| paraphrase ceiling | 0.799 | 0.799 | 1.00 |
ρ_norm per doubling of K. Extrapolation
suggests K ≈ 256 to saturate the ceiling.‖μ‖ ≈ 55) is backbone-specific.paper_nla.md §3.v is provided at inference time, so scoring is free: do best-of-K
oracle rerank (sample K, score each by fve_nrm_cen, return argmax).
At K=64 this delivers ρ_norm = 0.92. No retraining required.1@misc{lancaster2026nlareframe,
2 title = {Natural-Language Activation Verbalization:
3 Probing the Decodability of Frozen Hidden States via Prefix-Tuned Generation},
4 author = {Lancaster, Burton},
5 year = {2026},
6 note = {Draft; see github.com/space-bacon/SRT/blob/nla/paper_nla.md},
7}nla)RiverRider/srt-nla-targets-v1RiverRider/srt-adapter-v1.0 (different codepath, semiotic awareness)