In Machina N400: Pinpointing Where a Causal Language Model Detects Semantic Violations
Not on the map. Why?
Abstract (arXiv)
How and where does a transformer notice that a sentence has gone semantically off the rails? To explore this question, we evaluated the causal language model (phi-2) using a carefully curated corpus, with sentences that concluded plausibly or implausibly. Our analysis focused on the hidden states sampled at each model layer. To investigate how violations are encoded, we utilized two complementary probes. First, we conducted a per-layer detection using a linear probe. Our findings revealed that a simple linear decoder struggled to distinguish between plausible and implausible endings in the lowest third of the model's layers. However, its accuracy sharply increased in the middle blocks, reaching a peak just before the top layers. Second, we examined the effective dimensionality of the encoded violation. Initially, the violation widens the representational subspace, followed by a collapse after a mid-stack bottleneck. This might indicate an exploratory phase that transitions into rapid consolidation. Taken together, these results contemplate the idea of alignment with classical psycholinguistic findings in human reading, where semantic anomalies are detected only after syntactic resolution, occurring later in the online processing sequence.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 2 of its 20 references that are in the map. First posted on arXiv 24 Nov 2025.
Builds on
2 of 20 references.
References · 2
- 2017Attention Is All You Needcited by 60,361
- 2025Large Language Models Are Human-Like Internallycited by 29
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Do Language Models Encode Knowledge of Linguistic Constraint Violations?
- 2026Interpreting Negation in GPT-2: Layer- and Head-Level Causal Analysis
- 2026MechaTerp-TRACE: A Novel Approach for Component Ablation Analysis in Language Models
- 2026Fine-Grained Analysis of Shared Syntactic Mechanisms in Language Models
- 2026STRUCTURALCOST: A controlled reading time dataset for modeling human sentence processing difficulty
- 2026Attention Deficits in Language Models: Causal Explanations for Procedural Hallucinations
- 2026Linear Probes Detect Task Format, Not Reasoning Mode in Language Model Hidden States
- 2026Vernier: Probing Representational Misalignment Behind Lexical Gaps in Causal Reasoning