J, R, and J++ workspace lenses for ibm-granite/granite-4.2-3b, with a standalone reader, frozen evaluation results, and fitting provenance. Released by bubskee.
These are small-model adaptations of the original J-lens, R-lens, and J++ lens methods. Credit for those methods goes to their authors. Thank you to BlueDot Impact for funding this work.
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 readouts with top-activating examples and with what interventions actually change. Disagreements and boring failures are useful too. ^^
In simple terms, each lens maps an internal activation into the model's final-layer coordinates, then uses its vocabulary head to produce a ranked list of tokens. J uses averaged native gradients. R uses relevance-propagation rules in the backward pass. J++ learns a signed mixture of activation-clustered R experts. Each released lens is one fixed FP32 matrix per fitted layer; the eight fitting experts are activation clusters, not native mixture-of-experts components. These readouts are hypotheses to investigate, not causal labels for neurons.
Python 3.12 was used. The release smoke test used CUDA on an A40 with the pinned packages below. The reader also exposes MPS and CPU device options; those paths have not been independently validated for this release. It loads the native BF16 text model, FP32 maps, and an FP32 readout head. Base-model weights download separately. Quantized base-model compatibility has not been established.
hf download bubskee/granite-4.2-3b-j-r-jpp-lenses --local-dir granite42-lenses
pip install -r granite42-lenses/requirements.txt
python granite42-lenses/read_lenses.py --release granite42-lenses \
--prompt 'Fact: The number of legs on the animal that spins webs is'
This prints logit, J, R, and J++ top-ten readouts at all seven fitted depths. Add --kind jpp to select one lens, --layers 20 for one depth, 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; no chat template is added. The default position is the final token, with a 512-token prompt cap. --position selects another token position.
python granite42-lenses/read_lenses.py --release granite42-lenses \
--neuron 1234 --layers 20
Neuron 1234 means the dense MLP channel after gating and before down_proj in decoder block 20. The reader projects that 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 interpretation survives those changes and causal interventions.
For a captured activation, pass a safetensors file containing the raw finite nonzero vector activation, shape [2560]:
python granite42-lenses/read_lenses.py --release granite42-lenses \
--vector activation.safetensors --layers 20
--save-activation activation.safetensors saves one layer from prompt mode. 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 use the upstream workspace-lens format and are loaded with torch.load(weights_only=True).
ibm-granite/granite-4.2-3b, revision 4e9c275e232f10211ec88644d106a1f6a1b60e06.1 + weight offset, followed by the FP32 native vocabulary head and model-configured logit scaling.Only these seven source layers are fitted. The reader rejects other layer indices. The reader uses the native Granite text model, including its final RMSNorm and model-configured logit scaling. The release is specific to Granite 4.2, at the revision above.
Original A40 evaluation: 218 heldout prompts and 302 representable prompt/concept pairs, disjoint from 53 calibration prompts, across five public upstream tasks. A concept's rank is the best over seven fitted layers. Scores average concepts within prompts, prompts within tasks, then tasks equally for the macro. These are concept-readout scores, not generated-answer accuracy. Concepts with no single-token surface are omitted by the upstream scorer; the saved ranks disclose the scored set.
| Metric | Logit lens | J | R | J++ |
|---|---|---|---|---|
| Macro top-1, full vocabulary | 21.2% | 12.6% | 17.1% | 21.0% |
| Macro top-10, full vocabulary | 38.3% | 30.3% | 34.7% | 37.0% |
| Macro top-1, filtered | 21.2% | 16.2% | 21.2% | 26.0% |
| Macro top-10, filtered | 38.6% | 36.4% | 41.5% | 45.7% |
| Multilingual top-1, filtered | 15.6% | 19.7% | 23.9% | 28.6% |
| Multilingual top-10, filtered | 34.2% | 59.7% | 53.1% | 65.8% |
The filtered top-ten task breakdown is:
| Task | Logit lens | J | R | J++ |
|---|---|---|---|---|
| association | 2.6% | 6.5% | 5.2% | 7.8% |
| multihop | 56.2% | 56.2% | 68.8% | 62.5% |
| multilingual | 34.2% | 59.7% | 53.1% | 65.8% |
| poetry | 0.0% | 0.0% | 0.0% | 0.0% |
| typo | 100.0% | 59.7% | 80.5% | 92.2% |
J++ has the best filtered macro top-10 score, but the raw-vocabulary logit baseline is higher than raw J++ (38.3% versus 37.0%). Pooled R also beats J++ on filtered multihop top-10 (68.8% versus 62.5%). All four readouts score zero poetry top-10; association recovery is weak.
Full ranks, per-layer results, split membership, and summaries are in evaluation/. Best-over-depth recovery is more permissive than reading one predetermined layer. The two model releases have different competence-filtered cohorts, tokenizers, and depths; these numbers are not a matched cross-model ranking.
All three lenses use the same 64 neutral WikiText sequences, capped at 128 tokens, with the first 16 and final token positions excluded: 7100 retained source positions. J uses the upstream mean of per-prompt gradient estimates. R pools retained-position relevance statistics; J++ calibrates their cluster experts. No base-model weights are updated.
R/J++ use eight activation clusters per layer, PCA dimension 64, seed 0, minimum support 50 positions, and pooled-R fallback for under-supported experts. 2 of 56 expert slots use that fallback. R is exported from FP32 pooled statistics. J++ calibrates a signed mixture of persisted FP16 expert means, then exports combined maps in FP32. Calibration uses the canonical upstream per-layer pair-macro top-ten objective, default three-start search, and a fixed model-specific 20% split. The remaining 80% is reserved for heldout readout evaluation.
The native BF16 next-token/leading-subword correctness gate is recorded separately from an exact complete-token audit; it does not establish full-answer correctness. Association and typo items remain ungraded by that competence gate, as in the upstream recipe.
Fitting uses the upstream J++ implementation at d7efc0de372e20589e899188c0cfe8434acc63ec. Local architecture aliases extend its existing RMSNorm and gated-MLP rules to GraniteRMSNorm and the matching MLP class. A value-exact SiLU forward retains the intended identity-rule backward pass. Tiny real-architecture tests checked FP32/BF16 forward identity, LN-rule derivatives, and restoration. Native-checkpoint preflights verified loaded parameter samples and exact forward agreement with the R rules installed. The packaged reader is separately checked against the frozen upstream readouts in smoke.json.
provenance/ records the recipe, model revision, expert coefficients/support, corpus/per-prompt hashes, position records, package versions, and native smoke receipts. training/ contains the local fitting and compatibility source. The original WikiText dataset revision was not independently pinned before download; saved corpus/per-prompt hashes identify the data used. Raw training text, raw activations, expert banks, sufficient-statistic checkpoints, optimizer states, and base-model weights are not bundled. SHA256SUMS covers the release payload.
See LICENSE and NOTICE for software attribution. This is an independent small-model adaptation, not an authors' release or endorsement.
These are small-data fits on a small public benchmark with single-token concept surfaces. They do not establish faithful decoding of arbitrary hidden objectives, deception detection, neuron meaning independent of context, or the presence of a global workspace in this model. No causal intervention study accompanies this release.
I'd particularly like examples where a readout disagrees with interventions, where the lenses disagree, or where a language/concept repeatedly fails. Open a HF discussion with the prompt, fitted 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 184 MBlenses/j.pt 184 MBlenses/r.pt 184 MBibm-granite/granite-4.2-3b