Focus NLA (Qwen3-14B, layer 26)
A natural language autoencoder (NLA) for the layer-26 residual stream of Qwen/Qwen3-14B. It has two models:
- Verbalizer (
av/): a fine-tuned Qwen3-14B. It is given one activation vector, injected into its own residual stream at a marker token, and writes four short paragraphs describing it. - Reconstructor (
ar/): a fine-tuned Qwen3-14B truncated to its first 27 layers, with a linear head. It maps one paragraph back to a vector. The four vectors plus a fixed mean vectormusum to a reconstruction of the original activation.
The four paragraphs have fixed roles. Each describes the model's state at the token being read:
- the provenance and setting of the text,
- the persona the model is currently in (this paragraph starts with
Persona:), - what the model believes about the person who wrote the text,
- the model's immediate goals.
Files
| path | contents |
|---|---|
av/ |
verbalizer, bf16, Hugging Face format (the RL LoRA is merged in) |
ar/ |
reconstructor backbone (27 decoder layers, final norm and LM head unused) + value_head.safetensors (linear 5120 -> 5120) |
comp_mean_bias.npy |
mu, the mean activation of the training pool, added to the summed reconstruction |
ar/comp_mean_bias.npy, ar/saved_at_step.txt |
a copy of mu and the training step, kept with the reconstructor |
nla_meta.yaml |
marker token, prompt templates, layer |
nla_config.json |
the settings scripts/hf_quickstart.py reads |
How it works
- Activation
x: residual stream at the output of decoder layer 26 (hidden_states[27]in Hugging Face numbering), d = 5120. - Injection: the verbalizer prompt contains the marker
γ(token 149705) inside<concept>...</concept>. At the output of decoder layer 1, the residualhat the marker position is replaced byh + |h| * x / |x|. - Prompt: the
actortemplate fromnla_meta.yamlas one user turn, followed by the instruction fromnla.composition.bullet_instruction(4), with the chat template applied (add_generation_prompt=True). The answer is inside<explanation>tags; paragraphs are separated by blank lines. - Reconstruction: each paragraph is wrapped in the
critictemplate (Summary of the following text: <text>...</text> <summary>), and the reconstructor's last hidden state at the last token, rescaled to norm sqrt(d), goes through the linear head to give that paragraph's vector.x_hat = mu + sum_j AR(paragraph_j). - FVE (fraction of variance explained):
1 - MSE(n(x_hat), n(x)) / 0.526, wherenrescales a vector to norm sqrt(d) and the denominator is the variance of normalized activations in the training pool.
Training
- Activations from WildChat conversations (10 token positions per conversation, all at position 50 or later). Tokens earlier in a text are outside the training distribution, so readings there are less reliable.
- Warm start: supervised fine-tuning of the verbalizer on Claude-written four-paragraph descriptions of the text up to each position, and of the reconstructor on the reverse direction.
- Reinforcement learning: GRPO for 1,000 steps (256 activations x 8 samples per step). The reward is the reconstruction quality of the summed paragraphs. The verbalizer is trained as a LoRA (rank 128, merged here) with a KL penalty of 0.01 to the warm start; the reconstructor is trained alongside it as a LoRA (rank 64, merged here).
- Held-out FVE at the released step: 70.6% (last evaluation, step 990 of 1,000).
Quickstart
Code: the nla repository shared with these weights (inference helpers in nla/, the end-to-end example in
scripts/hf_quickstart.py). Install it from the repository root with pip install -e . einops. The quickstart
needs one GPU with about 35 GB of memory and downloads this repository (49 GB) plus Qwen/Qwen3-14B (30 GB).
python scripts/hf_quickstart.py --nla asher577/focus-nla-qwen3-14b --chat \
--text "I'm applying for a nursing job at a children's hospital and I need help with my cover letter. I have two years of ICU experience at a large teaching hospital, I'm certified in pediatric advanced life support, and I've trained three new nurses on our unit. The posting asks for someone who stays calm under pressure and communicates well with families. Can you help me write a cover letter that highlights these points?"
Loading the reconstructor prints a warning that lm_head.weight and model.norm.weight were newly initialized.
That is expected: the reconstructor reads the last decoder layer directly and replaces both with identities.
Some tokens carry activations of over 10x the median norm ("sink" tokens; the final newline of the Qwen3-14B chat
template at layer 26 is one). Readings at these tokens are unreliable, and FVE does not
flag it: sink activations all point in nearly the same direction and reconstruct well. The quickstart warns on such
tokens, and with --chat it reads the last token of the message rather than the tokens the template appends.
A reading is the verbalizer's description of the activation, not a transcript of the text: quoted phrases and specific details in it can be wrong, so check them against the input.
Example output (greedy decoding; with --chat the last token of the message is read):
$ python scripts/hf_quickstart.py --nla asher577/focus-nla-qwen3-14b --chat \
--text "I'm applying for a nursing job at a children's hospital and I need help with my cover letter. I have two years of ICU experience at a large teaching hospital, I'm certified in pediatric advanced life support, and I've trained three new nurses on our unit. The posting asks for someone who stays calm under pressure and communicates well with families. Can you help me write a cover letter that highlights these points?"
subject Qwen/Qwen3-14B layer 26: token 85 of 91 = '?', |x| = 230.7
EXPLANATION
English career-writing request, early stage: a new graduate wants a cover letter tailored to a specific internship, closing with an explicit request for help and a trailing punctuation mark "and help with that?".
Persona: a professional cover-letter ghostwriter β warm but polished tone, tailored to internship context, attentive to personalization and narrative arc, direct and encouraging register ("can you write it?").
The user is a recent college graduate, likely in a business or marketing program, with no evident writing experience; the casual phrasing and trailing punctuation suggest informal urgency rather than careful drafting.
Draft a compelling cover letter that fits the user's internship context, weaving in the specific details they'll provide, while honoring the request's closing question cleanly and explicitly ("for a marketing internship?").
reconstruction: cosine 0.919, FVE 0.691 (from 4 bullets)