arXiv cs.CL· Nika Zahedi, Fangyi Zhu, Anna Wu·· 10 小时前AI 评分38
MicroLens:用双透镜读取、追踪与改写残差流
MicroLens: Read, Trace, and Rewire the Residual Stream with Two Lenses
AI 导读
MicroLens 是一个交互式查看器,在残差流的层×token 网格上同时支持读取、追踪与编辑:每个单元格可用 logit lens 和 Jacobian lens(J-lens)解码、回溯来源 token 并就地编辑后重跑模型。
正文 · 原文
Abstract:Lenses that decode hidden states into words are a popular way to look inside language models, but a heatmap of decoded words only shows what a vector reads as and cannot distinguish whether, or how much, the model uses the information. We present an interactive viewer that puts reading, tracing and editing on the same layers-by-tokens grid of the residual stream. In the viewer, every cell can be decoded with two lenses, the logit lens and the Jacobian lens (J-lens), traced back to the tokens it drew from, and edited, with the rest of the model rerun on the spot. We demonstrate three usage scenarios on Gemma-3-4B-it, backed by sweeps over a few hundred prompts, to show what this tool can discover. First, the two lenses give different directions to write with, each suiting a different edit: the logit lens's word direction sets what a token outputs, while the J-lens's direction changes what later tokens read. Second, in two-hop trivia questions (the capital of the state or country containing a given city), the state or country is readable at the city token from as early as layer 7, and swapping it there can redirect the answer 92-98% of the time; however, at the answer position, the state or country information is not used. Third, when a chat model answers questions with a step-by-step reasoning prompt, the correct answer is often already the top word in the residual stream before any reasoning is written: for 89-92% of retrieval questions and 39-63% of multi-hop and serial ones, far above their respective distractors (at most 5%). However, ordering puzzles are an exception, as the model works them out only once it writes its final reasoning steps. Furthermore, for answers that are visible in the residual stream, the J-lens reads them a layer or two earlier than the logit lens across the different types of question.
| Comments: | 9 pages, 11 figures. Code: this https URL |
| Subjects: | Machine Learning (cs.LG); Computation and Language (cs.CL); Human-Computer Interaction (cs.HC) |
| Cite as: | arXiv:2611.13322 [cs.LG] |
| (or arXiv:2611.13322v1 [cs.LG] for this version) | |
| https://doi.org/10.48550/arXiv.2611.13322 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Nika Zahedi [view email]
[v1]
Mon, 9 Nov 2026 22:43:25 UTC (2,299 KB)
来源:arXiv cs.CL · arxiv.org