Subspace NLA (Qwen3-8B, layer 24)
A natural language autoencoder (NLA) that describes an activation one dictionary block at a time. The block-sparse featurizer BSF splits a layer-24 activation of Qwen3-8B into the components of its 16 active blocks (each block is a 64-dimensional subspace). The verbalizer is given one component and writes one short description of it. The reconstructor maps each description back to a vector, which is projected onto that block's subspace. This NLA only works together with that BSF.
Files
| path | contents |
|---|---|
av/ |
verbalizer, a fine-tuned Qwen3-8B, bf16, Hugging Face format (the RL LoRA is merged in) |
ar/ |
reconstructor backbone (Qwen3-8B truncated to 25 decoder layers) + value_head.safetensors (linear 4096 -> 4096); ar/saved_at_step.txt is the training step |
nla_meta.yaml |
marker token, prompt templates, layer |
nla_config.json |
the settings scripts/hf_quickstart.py reads |
How it works
- Decomposition: the BSF writes the activation as
x ~= act_scale * b_dec + sum_g c_g, wherec_gis the component of active blockg(nla.subspace_nla.extract_components). - Verbalizing: each
c_gis injected separately. The prompt is theactortemplate fromnla_meta.yaml("You will be shown ONE activation subspace component ...") as one user turn with the chat template applied. The markerγ(token 149705) sits inside<concept>...</concept>; at the output of decoder layer 1 the residualhat the marker becomesh + |h| * c_g / |c_g|. Generation is capped at 45 tokens: one short description per block. - Reconstruction: each description goes through the
critictemplate (Summary of the following text: <text>...</text> <summary>); the reconstructor's last hidden state, rescaled to norm sqrt(d), goes through the linear head. The outputp_gis projected onto blockg's 64-dimensional decoder span (nla.subspace.block_bases.build_block_bases). The reward scored direction only, so magnitudes come from the components:x_hat = act_scale * b_dec + sum_g |c_g| * P_g p_g / |P_g p_g|. - FVE:
1 - MSE(n(x_hat), n(x)) / 0.559for the whole activation, and1 - MSE(n(P_g p_g), n(c_g)) / 0.909per block, wherenrescales a vector to norm sqrt(d) and each denominator is the corresponding baseline variance in the training pool.
Training
- Activations from a 50/50 mix of chat and web text.
- Warm start: supervised fine-tuning on Claude-written descriptions of individual block components, filtered by a judge for agreement with the component; the reconstructor was warm-started to map a description to its own block's component.
- Reinforcement learning: GRPO for 2,400 rollout steps of 128 prompts x 8 samples, with gradients accumulated over two steps (1,200 optimizer updates of 2,048 samples each). The reward for each description is how well its projected reconstruction matches its own block's component. The verbalizer is trained as a LoRA (rank 128, merged here) with a KL penalty of 0.04 to the warm start; the reconstructor is fully fine-tuned alongside it.
- Held-out FVE at the released step: 68.2% for the whole activation (200 held-out rows, all active blocks).
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), the BSF (4 GB) and Qwen/Qwen3-8B (16 GB).
python scripts/hf_quickstart.py --nla asher577/subspace-nla-qwen3-8b --text "The capital of France is"
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, reading the last token):
$ python scripts/hf_quickstart.py --nla asher577/subspace-nla-qwen3-8b \
--text "The Eiffel Tower was completed in 1889 and is located in Paris, the capital of"
subject Qwen/Qwen3-8B layer 24: token 21 of 22 = ' of', |x| = 231.4
16 active BSF blocks (BSF's own reconstruction FVE 0.698)
block 1283 |c| 53.9 block FVE +0.81 A partitive 'of' following 'the founder', linking a title to a place or entity in a superlative construction ('the heart of').
block 173 |c| 43.0 block FVE +0.75 A structured travel-guide description of a city, ending mid-phrase in a geographic location clause awaiting a region name completion, with a country reference.
block 911 |c| 38.2 block FVE +0.64 A structured educational reference page ending in a standard boilerplate definition sentence awaiting the named entity after 'of' in 'the owner of the country of'.
block 687 |c| 32.4 block FVE +0.76 A forum-style historical trivia entry about a car, shifting into a broader historical statement about a European country's identity and ranking among nations, UK and a European country.
block 1065 |c| 28.0 block FVE +0.48 A role-title phrase 'the chief of' linking a person to an organization via 'of', within a structured Q&A document.
block 1100 |c| 25.8 block FVE +0.33 A new unrelated academic exercise prompt in generic prose, ending with a complete sentence and a fresh topic boundary before a new question block follows.
block 724 |c| 25.6 block FVE +0.45 A structured, formal informational passage defining a place, cut mid-phrase within a geographic location formula awaiting completion of the country name after a comma.
block 236 |c| 25.4 block FVE +0.54 A structured product description with factual metadata, listing a vehicle's features and ending on a geographic reference to a European country's winter conditions, ending on 'French'.
block 715 |c| 24.5 block FVE +0.65 Journalistic prose about a Paris fashion event, listing named figures and ending mid-list on a French celebrity name and credential fragment 'and French is'.
block 1869 |c| 23.3 block FVE +0.36 Structured numbered list of chemical facts, each item giving a formula and properties, cut mid-sequence within a fielded entry expecting a numeric continuation boundary next element's age and national description.
block 513 |c| 22.2 block FVE +0.63 A structured movie metadata template with standardized fields, cut mid-sentence in a formulaic opening requiring completion of a country name's national identity phrase naming the country of the French language.
block 499 |c| 21.5 block FVE +0.47 A formulaic science-news article with two distinct topics, cut mid-sentence at a standard journalistic closing formula beginning a common phrase before a number in 'before 70' country.
block 1996 |c| 20.6 block FVE +0.38 News article with a short factual question-and-answer format, using parallel sentences about a technology topic and a final list item about species loss and survival probability, then a new question structure.
block 550 |c| 20.0 block FVE +0.40 Educational Q&A prose defining a chemical element, with a factual answer beginning and a standard definition formula underway mid-sentence after a comma delimiter, 'the capital city, the'.
block 202 |c| 18.7 block FVE +0.29 Structured informational prose transitioning from a factual statement into a standard boilerplate disclaimer, with the phrase awaiting completion of a geographic scope phrase after 'in the world's leading country in'.
block 1496 |c| 17.4 block FVE +0.33 An instructional guide with structured sections, moving from introductory framing into a formal section header and its explanatory content, cut mid-phrase at 'in the capital city and before the final'.
reconstruction: cosine 0.857, FVE 0.489