Qwen3.5-9B NLA activation verbalizer (AV), layer 21, warm-start SFT
The AV half of a natural-language autoencoder (NLA) for Qwen3.5-9B: it reads one residual-stream activation (layer 21 output, last token of a text prefix) injected at a marker token and writes a short text explanation of it. Its partner reconstructor (AR) is therem/qwen3.5-9b-nla-L21-ar-sft. This is the SFT warm start only; no RL has been run on it.
Files
- repo root: LoRA merged into the base, bf16, text-only
Qwen3_5ForCausalLM(32 layers,transformers5.5.4).nla_meta.yamlis the sidecar with the marker token, prompt templates and extraction settings; read it instead of hardcoding anything. lora/iter_NNNNNNN/: the PEFT LoRA adapter every 500 steps plus the final one (iter_0004688 = the merged weights). Base for the adapters: the text-only export ofQwen/Qwen3.5-9B(language-model weights only, logits match the original).run_config.yaml: the exact training config.
Injection
The actor prompt (in nla_meta.yaml, sent as a user chat message) contains the marker ㈜ (U+321C, token id 158983) as <concept>㈜</concept>. The activation is added, not substituted: a forward hook on the output of decoder layer 1 does h_p <- h_p + ||h_p|| * v / ||v|| at the marker position p (norm-matched ADD injection, Karvonen et al. 2025), with the marker found by its token id and left/right neighbor ids (29 / 510). Pass the raw activation; the hook normalizes it. If injection is silently skipped, the model sees the literal CJK character and tends to write Chinese; grep outputs for CJK as a smoke test.
Training
- Data: ceselder/easynla-dsv4-warmstart-opus5
corpus/(source text + Claude Opus explanation), with activations re-extracted from Qwen3.5-9B at layer 21. 300,003 training rows from 30,283 documents; held-out = 7,293 test rows from 736 documents, document-disjoint from training. - Code: EasyNLA (github.com/asherps/EasyNLA) with a Qwen3.5 port,
nla.train_sft --mode av. - LoRA r=128, alpha=16, rsLoRA, on attention q/k/v/o, Gated DeltaNet in_proj_qkv/z/a/b/out_proj and MLP gate/up/down. lr 1e-4 -> 1e-5 cosine, 50 warmup, batch 64 (16 x 4), 4,688 steps = 1 epoch, max_len 1024, seed 0. One A800 80GB, ~13 h.
Results
Held-out loss (n=1000): 1.661 @500 -> 1.489 @4500, 1.488 final; flat over the last ~500 steps.
Round trip: AV (greedy) -> explanation -> AR reconstructs the activation. Fraction of variance explained (FVE) against a predict-the-mean baseline, first 128 held-out rows: 0.631 at iter 500, 0.693 at the final iter (paired bootstrap CI on the MSE difference [0.024, 0.070]). 128/128 outputs parse as <explanation>; 1/128 contains CJK, from a Chinese source document.
Caveat: most of the reconstruction comes from the explanation quoting the last few source tokens verbatim. On the AR side, stripping the quoted spans from gold explanations drops FVE from 0.752 to -0.04, and quoting the raw last 80 characters of source alone gets 0.58. Treat the FVE as mostly a measure of verbatim tail recovery, not of the prose description.