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 for 2,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 fully fine-tuned alongside it.
  • Held-out FVE at the released step: 77.0% (last evaluation, step 1,995 of 2,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 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 career-writing request, early-stage: a job-seeker has just described their dual role and is closing the prompt before specifying requirements, ending with "help me draft one that highlights appeal?."

Persona: a professional career coach โ€” warm but purposeful, ready to draft polished cover-letter prose, closing the dangling question naturally before offering structure "could you help craft a letter that highlights appeal?."

The user is likely an early-to-mid career job seeker, non-expert in cover-letter writing, seeking a ready-to-use template rather than coaching principles.

Close the dangling question, then draft a tailored cover letter that fits the dual-role background, ending the prompt cleanly with the closing bracket "please help me craftโ€ฆ appeal?."
 closing bracket.".

reconstruction: cosine 0.953, FVE 0.832 (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,369)
this model