{"id":6663,"date":"2026-07-07T07:01:52","date_gmt":"2026-07-07T00:01:52","guid":{"rendered":"https:\/\/daiilynews.cu.ma\/?p=6663"},"modified":"2026-07-07T07:01:52","modified_gmt":"2026-07-07T00:01:52","slug":"github-ninjahawk-subtext-%c2%b7-github","status":"publish","type":"post","link":"https:\/\/daiilynews.cu.ma\/?p=6663","title":{"rendered":"GitHub &#8211; ninjahawk\/Subtext \u00b7 GitHub"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<p>Recent work from Anthropic identified a small set of internal representations in<br \/>\nlanguage models \u2014 the J-space \u2014 that behaves like a global workspace: its<br \/>\ncontents can be verbally reported by the model, deliberately modulated, and are<br \/>\ncausally used for multi-step reasoning, while the surrounding majority of neural<br \/>\nactivity remains inaccessible to report. The identification tool is the<br \/>\nJacobian lens, which transports a residual-stream activation at any layer into<br \/>\nthe final-layer basis and decodes it through the model&#8217;s own unembedding,<br \/>\nanswering: which vocabulary words is this internal state disposed to produce,<br \/>\nnow or later?<br \/>\nSubtext applies that method continuously during live conversation with a local<br \/>\nmodel. On every token \u2014 both while the model ingests the user&#8217;s message and<br \/>\nwhile it generates its reply \u2014 the lens is read at nine depths and the result<br \/>\nis rendered as it happens. The intermediate steps of the model&#8217;s computation<br \/>\nbecome directly watchable: verdicts form during reading, several tokens before<br \/>\nany output; planned words hold at high strength while unrelated tokens are<br \/>\nbeing emitted; two-hop questions surface their unspoken middle term.<br \/>\nSubtext differs from the interactive readouts already available (e.g. the<br \/>\nNeuronpedia demo) in that it is conversational and continuous: it renders the<br \/>\nlens during a live chat, includes the reading phase over the user&#8217;s message,<br \/>\nstreams at generation speed via a KV cache, and pairs the canvas with a<br \/>\nper-token ledger and per-word inspector. Sessions can be exported and replayed<br \/>\nin any browser without a GPU.<br \/>\nWhat the lens shows that the output does not<br \/>\nThe value of the instrument is the gap between the model&#8217;s internal state and<br \/>\nits visible text. Three moments from the demo session:<br \/>\n1. The verdict precedes the reply. Zero tokens of output exist; the model<br \/>\nis still reading Is this correct? 12 + 5 = 1. The workspace already holds<br \/>\nmath, addition, arithmetic, modulo \u2014 the phase indicator is amber<br \/>\n(reading).<\/p>\n<p>2. The judgment is formed, then verbalized. As the reply begins (&#8220;No, that<br \/>\nis **not\u2026&#8221;), incorrect dominates the workspace at high strength, with<br \/>\nequation, calculation, statement co-active \u2014 the conclusion is<br \/>\ninternally settled several tokens before the words &#8220;not correct&#8221; appear.<\/p>\n<p>3. Plans are held while other words are being said. Mid-explanation, the<br \/>\nworkspace holds modulo, bitwise, system, numbers \u2014 the technical<br \/>\ncaveat the model is about to raise \u2014 while the current output token is<br \/>\nunrelated.<\/p>\n<p>These reproduce, on an open 4B model on consumer hardware, the reporting and<br \/>\nplanning phenomena described in the paper (which used Claude-scale models),<br \/>\nincluding the two-hop signature: Italy at layer 20 and euros at layer 26<br \/>\non the country-shaped-like-a-boot question, before generation begins.<\/p>\n<p>Each rendered word is a lens readout, not model output. It indicates an<br \/>\ninternal activation disposing the model toward that word.<br \/>\nVertical position corresponds to layer. Early layers (perception) are at<br \/>\nthe top; readouts approach the bottom rail as they approach emission.<br \/>\nSize and opacity encode absolute readout strength. The display applies a<br \/>\nfixed monotone mapping from lens probability; weak readouts are rendered<br \/>\nweak. Amber marks readouts taken while reading the user; blue while<br \/>\ngenerating.<br \/>\nHover shows a word&#8217;s per-layer activation profile; click opens an<br \/>\ninspector with peak strength, mean depth, and strength history.<br \/>\nThe right panel records everything the canvas curates: the conversation, a<br \/>\nlive ranking of currently-active readouts, and a per-token ledger.<\/p>\n<p>browser (single HTML file)  \u21d0 websocket \u21d0  server.py<br \/>\n    Qwen3.5-4B (bf16, HF transformers, KV cache)<br \/>\n    pre-fitted Jacobian lens: neuronpedia\/jacobian-lens, revision qwen-n1000<br \/>\n    per token: residual hooks at 9 layers \u2192 J_l transport \u2192 unembed<br \/>\n             \u2192 full-vocabulary softmax \u2192 word-start top-k \u2192 frame<\/p>\n<p>Each exchange has two phases. A single prefill pass covers the user&#8217;s message,<br \/>\nwith lens readouts taken at every position (the reading phase); generation<br \/>\nthen proceeds token-by-token with a KV cache, reading the lens at the newest<br \/>\nposition each step (the thinking phase). The lens adds a per-layer<br \/>\nmatrix-vector product and an unembedding per token, so streaming runs at the<br \/>\nmodel&#8217;s native generation speed.<br \/>\nDisplay filtering. Raw lens top-k contains punctuation and BPE<br \/>\ncontinuation fragments (e.g. itude, from cert\u2011itude), which are not<br \/>\nmeaningful as readouts. Display is restricted to word-initial vocabulary<br \/>\ntokens, following the reference implementation&#8217;s mask_display with a<br \/>\nstricter word-start criterion. Probabilities are computed over the full<br \/>\nvocabulary before any filtering, so filtering affects legibility only, never<br \/>\nthe readout itself.<\/p>\n<p>verify_accuracy.py compares this implementation&#8217;s live path (forward hooks,<br \/>\nKV cache enabled) against the reference JacobianLens.apply() on identical<br \/>\ninputs. Across 4 layers \u00d7 3 positions on the walkthrough prompt, top-5<br \/>\nreadouts match exactly, with cosine similarity \u2265 0.99998 between logit<br \/>\nvectors, and reproduce the expected two-hop intermediates. The audit can be<br \/>\nre-run at any time with the server stopped.<\/p>\n<p>Requirements: an NVIDIA GPU with ~10 GB of VRAM, Python 3.11+, and a CUDA<br \/>\nbuild of PyTorch. First launch downloads the model and lens (~9 GB total) and<br \/>\nbuilds a display-token mask (~1 minute, cached).<br \/>\ngit clone https:\/\/github.com\/ninjahawk\/Subtext<br \/>\ncd Subtext<br \/>\npip install -r requirements.txt<br \/>\npython server.py<br \/>\n# \u2192 http:\/\/localhost:8765<br \/>\nOn Windows, run python -u -X utf8 server.py, or use start.bat.<br \/>\nOther models. The server is configured for Qwen3.5-4B because Neuronpedia<br \/>\npublishes a pre-fitted lens for it (a 27B lens is also published, for larger<br \/>\nGPUs \u2014 edit MODEL_NAME\/LENS_FILE in server.py). Any HuggingFace decoder<br \/>\ncan be used by fitting your own lens with jlens.fit(); ~100 prompts produces<br \/>\na usable lens, and fitting a 4B-scale model takes on the order of an hour on a<br \/>\nsingle consumer GPU. See the reference repo<br \/>\nfor details.<br \/>\nReplays. The \u2913 session button exports the current conversation \u2014 every<br \/>\nlens frame included \u2014 as a JSON file. Open the app with ?replay=<br \/>\nto play one back with live pacing, no GPU required; that is exactly what the<br \/>\nhosted demo is.<\/p>\n<p>The instrument inherits the method&#8217;s limitations. The lens reads only concepts<br \/>\nthat correspond to single vocabulary tokens; multi-token concepts are invisible<br \/>\nor fragmentary. It approximately captures the workspace identified in the<br \/>\npaper, not the entirety of the model&#8217;s internal state, and layers below the<br \/>\nfitted range are not observed. Interpretation should also respect the paper&#8217;s<br \/>\nown framing: workspace readouts demonstrate functional availability of<br \/>\ninformation for report and reasoning; they do not demonstrate subjective<br \/>\nexperience.<\/p>\n<p>The method and reference implementation are by Anthropic<br \/>\n(jacobian-lens, Apache 2.0).<br \/>\nPre-fitted lens weights are published by<br \/>\nNeuronpedia. The model is<br \/>\nQwen3.5-4B. Subtext is an<br \/>\nindependent project and is not affiliated with Anthropic.<br \/>\nLicensed under Apache 2.0.<br \/>\n<br \/><br \/>\n<br \/><a href=\"https:\/\/github.com\/ninjahawk\/Subtext\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recent work from Anthropic identified a small set of internal representations in language models \u2014 the J-space \u2014 that behaves like a global workspace: its contents can be verbally reported by the model, deliberately modulated, and are causally used for multi-step reasoning, while the surrounding majority of neural activity remains inaccessible to report. The identification [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6664,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[676],"tags":[],"class_list":["post-6663","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-ai"],"_links":{"self":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/posts\/6663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6663"}],"version-history":[{"count":0,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/posts\/6663\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=\/wp\/v2\/media\/6664"}],"wp:attachment":[{"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daiilynews.cu.ma\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}