arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.19232cs.CLcs.AI
收藏

在机器中N400:定位因果语言模型检测语义违规的位置

In Machina N400: Pinpointing Where a Causal Language Model Detects Semantic Violations

Independent Researcher(独立研究者);Université Paris 8 Vincennes - Saint-Denis, Paris, France(巴黎第八大学凡尔赛-圣但尼分校)

Christos-Nikolaos Zacharopoulos, Revekka Kyriakoglou

AI总结:

研究探讨因果语言模型如何检测语义违规,发现模型在中间层能有效区分合理与不合理句子,且违规信息在中间瓶颈后坍塌,与人类阅读中语义异常检测的理论相呼应。

摘要:

transformer如何以及在何处察觉句子在语义上偏离轨道?为探索此问题,我们使用精心编纂的语料库评估了因果语言模型(phi-2),其中句子以合理或不合理的方式结束。我们的分析聚焦于每个模型层的隐藏状态。为了研究违规如何被编码,我们利用了两种互补的探针。首先,我们进行了逐层检测,使用线性探针。我们的发现表明,一个简单的线性解码器在模型最低三分之一的层中难以区分合理和不合理的结尾。然而,其准确性在中间块中显著增加,达到峰值仅在顶层之前。其次,我们检查了编码违规的有效维度。最初,违规扩大了表示子空间,随后在中间瓶颈后发生坍塌。这可能表明了一个探索阶段,随后过渡到快速巩固。综合来看,这些结果与经典心理语言学发现相呼应,即语义异常仅在句法解析后才被检测到,发生在在线处理序列的后期。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑