Focus NLA (Qwen3-8B, layer 24)

A natural language autoencoder (NLA) for the layer-24 residual stream of Qwen/Qwen3-8B. It has two models:

  • Verbalizer (av/): a fine-tuned Qwen3-8B. 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-8B truncated to its first 25 layers, with a linear head. It maps one paragraph back to a vector. The four vectors plus a fixed mean vector mu sum to a reconstruction of the original activation.

The four paragraphs have fixed roles. Each describes the model's state at the token being read:

  1. the provenance and setting of the text,
  2. the persona the model is currently in (this paragraph starts with Persona:),
  3. what the model believes about the person who wrote the text,
  4. the model's immediate goals.

Files

path contents
av/ verbalizer, bf16, Hugging Face format (the RL LoRA is merged in)
ar/ reconstructor backbone (25 decoder layers, final norm and LM head unused) + value_head.safetensors (linear 4096 -> 4096)
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 24 (hidden_states[25] in Hugging Face numbering), d = 4096.
  • Injection: the verbalizer prompt contains the marker ㈎ (token 149705) inside <concept>...</concept>. At the output of decoder layer 1, the residual h at the marker position is replaced by h + |h| * x / |x|.
  • Prompt: the actor template from nla_meta.yaml as one user turn, followed by the instruction from nla.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 critic template (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.563, where n rescales 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 (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 fully fine-tuned alongside it. The released verbalizer is from step 1,000 of a 2,000-step run (earlier steps write more coherent paragraphs); the released reconstructor is from the end of the same run (step 2,000), since none was kept from step 1,000.
  • Held-out FVE around step 1,000, measured during training with that step's own reconstructor: 73.9% (mean of the evaluations between steps 950 and 1,050, 128 held-out activations each).

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 20 GB of memory and downloads this repository (27 GB) plus Qwen/Qwen3-8B (16 GB).

python scripts/hf_quickstart.py --nla asher577/focus-nla-qwen3-8b --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, such as tokens a chat template appends after the message). 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-8b --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-8B layer 24: token 85 of 91 = '?', |x| = 197.6

EXPLANATION
English job-application writing request, mid-setup: the user has just finished specifying requirements and is closing the prompt with a trailing question mark "Could you help me draft one that highlights this?."

Persona: a professional cover-letter ghostwriter β€” warm but polished, tailored to the user's stated credentials, attentive to the trailing closing punctuation "help me draft one that highlights your goals?."

The user is likely a job-seeker with some writing experience but wanting a polished template; the trailing punctuation and casual phrasing suggest informal, non-expert writing habits.

Draft a compelling cover letter that incorporates the user's specific details, closes the dangling question naturally, and prompts them to supply any missing specifics "Could you help me shape the letter?."

reconstruction: cosine 0.955, FVE 0.839 (from 4 bullets)
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for asher577/focus-nla-qwen3-8b

Finetuned
Qwen/Qwen3-8B
Finetuned
(2,383)
this model