Contrastive Projection: Reading Transformer Internals by Differencing Logit Lenses
Abstract
Reading a transformer's internal states in token space is easy to do and hard to trust: a logit lens on a single hidden state is dominated, at intermediate layers, by the generic tokens the model would predict for almost any input. We read the difference instead. Subtracting two closely matched prompts' hidden states and projecting through the unembedding cancels the shared component and surfaces what separates them, an operation equivalent to reading a RepE/ActAdd steering vector through a logit lens. Built into a training-free tracer that reads at every position, sub-layer, and head and averages over designed baselines, it traces a compound- noun MLP->attention chain in Phi-2, confirmed there by activation patching, with the same distinction recovered across three architectures by readout and probe rather than by patching; it reads what retrieval surfaces for real versus fictional entities, and reads metaphor as a set of domain-to-domain mappings rather than a single figurativity feature. A cross-seed control marks the boundary: across five networks differing only in initialization, the same distinction surfaces as almost entirely different tokens (top-10 overlap 0.08). What a computation looks like in token space is network-specific; the distinction it draws is not
Create a lesson
Metadata
- Comments
- 27 pages, 34 tables. Code and data: https://github.com/EvidentSolutions/llm-interp/tree/main/contrastive
Related papers
Through the Looking Glass: Directly Reading and Writing Transformers
Shared title terminologycs.CLMark Oskin
Lightweight Reasoning Transfer via Chain-of-Thought Vector Projection
Shared title terminologycs.CLYulin Qi, Shuo Xu, Shuxia Lin et al.
Learning from Recurrence: Internalizing Depth-Induced Preferences in Looped Language Models
Shared title terminologycs.CLHui Chen, Joshua Elsdon, Can Goksen
Implementation of Machine Translation for the Uzbek Language Based on Transformer Models
Shared title terminologycs.CLMukhammadjon Musaev, Mannon Ochilov
SkillCore: Internalizing Generalizable Skills via Scaffolding-Removed Fine-Tuning
Shared title terminologycs.CLYi Liu, Changqing Ai, Peijie Dong et al.
Reading, Writing and Repairing Game-Theoretic Policies in Weight Space
Shared title terminologycs.CLAncil Crayton