R and J++ workspace lenses for the text decoder of Qwen/Qwen3.5-4B, with a standalone reader, frozen evaluation results, and fitting provenance. Released by bubskee.
If you're already poking at neurons in this model, I'd love you to look through these lenses and tell me what you see. Compare their readouts with top-activating examples and with what interventions actually change. Disagreements and boring failures are useful too. ^^
The release contains the original pooled R map and the original signed J++ map. Both have one FP32 transport matrix per source layer. J++ improves concept recovery on the heldout tasks below, with much of its multilingual gain coming from relations and input concepts. These readouts are hypotheses to investigate; they are not causal labels for neurons.
Python 3.12 was used. The reader supports CUDA, Apple Silicon MPS, and CPU; the packaged smoke test used MPS. It loads the native BF16 text model, FP32 transport maps, and an FP32 readout head. The base model is downloaded separately. Quantized base-model compatibility has not been established.
hf download bubskee/qwen3.5-4b-r-jpp-lenses --local-dir qwen35-lenses
pip install -r qwen35-lenses/requirements.txt
python qwen35-lenses/read_lenses.py --release qwen35-lenses \
--prompt 'Fact: The number of legs on the animal that spins webs is' \
--layers 8 16 24 30
This prints logit, R, and J++ top-ten readouts. Add --kind jpp to select one lens or --raw to rank the full vocabulary. Default ranking uses the saved upstream filter for tokens without letters or digits, with evaluation candidate tokens spared. Prompts are raw completion prefixes, matching the evaluation format; the reader does not add a chat template. Default position is the final token, with a 512-token prompt cap. --position selects another token position.
python qwen35-lenses/read_lenses.py --release qwen35-lenses \
--neuron 1234 --layers 20
Here, neuron 1234 means the dense MLP channel after gating and before down_proj in decoder block 20. The reader projects the corresponding column of down_proj.weight through each lens and prints both signs. This is vocabulary alignment of an isolated residual-write direction. An actual context also supplies the neuron's activation, other neurons' contributions, and the surrounding residual stream. Check whether the proposed interpretation survives those changes and causal interventions.
For an activation you've already captured, pass a safetensors file containing the raw finite nonzero vector activation, shape [2560]:
python qwen35-lenses/read_lenses.py --release qwen35-lenses \
--vector activation.safetensors --layers 20
The Python interface is WorkspaceLenses(release, device="auto"), with capture, transport, logits, read, and neuron_direction methods in read_lenses.py. No local training repository or upstream package is needed for inference. The .pt maps also use the upstream workspace-lens format and are loaded with torch.load(weights_only=True).
Qwen/Qwen3.5-4B, revision 851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a.1 + weight offset, followed by the FP32 native tied LM head.The model has 32 blocks: 24 Gated DeltaNet and 8 full-attention blocks, with dense MLPs. The eight “experts” used during J++ fitting are clusters of source activations, not native MoE experts. At inference, both R and J++ use one fixed linear map per layer.
Original A40 evaluation: 265 heldout items across five public upstream tasks, disjoint from 64 calibration items. Rank is the best over 31 source layers for each representable annotated concept. Scores average concepts within prompts, prompts within tasks, and then tasks equally for the macro. These are concept-readout scores, not generated-answer accuracy.
| Metric | Logit lens | R | J++ |
|---|---|---|---|
| Macro top-1, full vocabulary | 24.7% | 23.2% | 35.7% |
| Macro top-10, full vocabulary | 39.0% | 44.1% | 57.2% |
| Macro top-1, filtered | 24.8% | 27.9% | 38.0% |
| Macro top-10, filtered | 39.3% | 49.0% | 59.4% |
| Multilingual top-1, filtered | 19.2% | 30.2% | 40.7% |
| Multilingual top-10, filtered | 33.3% | 56.2% | 76.2% |
The multilingual task reads semantic concepts from non-English prompts, often through English token labels. On its 43 heldout prompts, filtered top-1 breaks down as follows:
| Concept role | R | J++ |
|---|---|---|
| Language identifier | 1/42 | 3/42 |
| Relation or operation | 7/43 | 15/43 |
| Input concept | 6/43 | 12/43 |
| Answer concept | 38/43 | 40/43 |
Fourteen of the eighteen additional concept hits are relations or inputs. Searching depth matters: at the same fixed block 27, multilingual filtered top-1 is 18.6% for R and 19.8% for J++, compared with 30.2% and 40.7% when searching all 31 layers.
There are substantial failures. Both lenses score zero poetry top-1; J++ association top-1 is 4.9%. Raw typo top-1 is 36.4% for R, 68.8% for logit lens, and 81.8% for J++. R is not uniformly better than the direct logit readout.
Full ranks, per-layer results, split membership, and summaries are in evaluation/. The figures show the depth and concept-role breakdowns.
A separate local ablation kept the original calibration/test split and readout fixed. Single-expert selection used calibration only. Positive-only and signed mixtures used the same top-10 objective, three starts, and 200 Adam steps per start; all weights were sealed before heldout inference. These are diagnostic results on the already-inspected public test set.
| Local control | Macro top-10, filtered | Multilingual top-1, filtered | Multilingual top-10, filtered |
|---|---|---|---|
| R | 48.9% | 30.2% | 55.6% |
| Uniform experts | 46.9% | 29.1% | 53.3% |
| Calibration-selected single expert | 55.4% | 39.5% | 69.6% |
| Positive-only fitted mixture | 55.4% | 36.6% | 69.0% |
| Signed matched refit | 58.8% | 38.4% | 73.1% |
| Original J++ replayed locally | 59.1% | 40.1% | 75.0% |
Selection recovers much of the observed top-1 gain; equal averaging does not. Signed mixing adds recall under this matched search budget. The single-expert control also loses three multilingual prompts that R retained, while original J++ loses none. Its language-identifier recovery is stronger, but its answer-concept recovery is weaker. The readers preserve complementary content.
Local MPS forwards are not bit-identical to CUDA. The original J++ replay reaches 40.1% multilingual filtered top-1, compared with 40.7% on A40. Every control in the local table shares the same local activations. analysis/ contains the full ablation report, prompt-level retention, paired bootstrap intervals, protocol, and integrity checks. The diagnostic control weights are not promoted as replacement releases.
Both lenses share LRP-backward Jacobian statistics from 64 neutral WikiText sequences, capped at 128 tokens, with 7104 retained source positions. J++ uses eight activation clusters per layer, PCA 64 routing, a minimum support of 50 positions, and pooled-R fallback for under-supported experts. Three early expert slots fall back to R.
R is exported from FP32 pooled statistics. J++ calibrates a signed mixture of the persisted FP16 expert means, then exports the combined maps in FP32. Calibration uses the canonical upstream per-layer pair-macro top-10 objective and default three-start search. The local SiLU patch preserves stock BF16 forward values while retaining the intended R-Lens backward rule.
Method: J++ Lens, Ayonrinde and Lindsey, using the upstream implementation at revision d7efc0de372e20589e899188c0cfe8434acc63ec. Original workspace lenses: Gurnee et al.. R-Lens implementation: Blank and Bhatia.
provenance/ records the recipe, expert coefficients/support, model integrity audit, and corpus hashes. training/value_exact_rlens.py contains the forward-preservation patch. Raw training text, raw activations, expert banks, optimizer states, and base-model weights are not bundled. The original dataset revision was not independently pinned before download; saved corpus/per-prompt hashes identify the data used. SHA256SUMS covers the release payload. See LICENSE and NOTICE for attribution.
The related Qwen3.5-4B O-lens release provides experimental activation-to-text adapters at L26, with its own reader and contracts. R/J++ return ranked vocabulary tokens; the O-lens generates longer descriptions of an activation.
To save a contextual activation in the format its reader expects:
python qwen35-lenses/read_lenses.py --release qwen35-lenses \
--prompt 'Fact: The number of legs on the animal that spins webs is' \
--layers 26 --save-activation activation.safetensors
Then follow the O-lens repository's CUDA reader instructions and exact L26 contract. Its historical base revision is recorded as unspecified, so this is an exploratory cross-reader comparison rather than a claim of verified historical base identity. Isolated neuron directions are unvalidated O-lens inputs. At this release, the linked public O-lens repository contains L26; L30 is still being completed separately.
The public test is small and uses single-token concept surfaces. The competence gate accepts leading answer subwords; it does not establish full-answer correctness. Four European languages account for 34/43 multilingual prompts, with most remaining languages represented once. Best-over-layers recovery is more permissive than reading one predetermined layer. No causal intervention study accompanies this 4B release.
I'd particularly like examples where a readout disagrees with interventions, where R and J++ disagree, or where a language/concept repeatedly fails. Open a HF discussion with the prompt, layer, token position, neuron/channel index if relevant, raw/filtered setting, and what you tested. Please keep private prompts out of public reports.
lenses/jpp.pt 813 MBlenses/r.pt 813 MBQwen/Qwen3.5-4B