arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.17624cs.CL
收藏

语言模型是否编码语义关系?探测与稀疏特征分析

Do Language Models Encode Semantic Relations? Probing and Sparse Feature Analysis

Andor Diera, Ansgar Scherp

AI总结:

本文研究了大型语言模型对语义关系(同义、反义、上位词、下位词)的表示,结合线性探测与稀疏特征分析,揭示了语义关系在模型中的编码特性及稳定性。

摘要:

理解大型语言模型(LLMs)是否捕捉结构化意义需要考察它们如何表示概念关系。本文研究了三个逐步扩大的模型:Pythia-70M、GPT-2和Llama 3.1 8B,重点研究四种语义关系:同义、反义、上位词和下位词。我们结合线性探测与机械可解释性技术,包括稀疏自编码器(SAE)和激活补丁,以确定这些关系是如何编码的以及特定特征如何贡献于其表示。我们的结果揭示了层次关系中的方向不对称性:上位词被冗余编码且抵抗抑制,而下位词依赖于紧凑特征,这些特征更容易受到消融影响。更广泛地说,关系信号是分散的,但表现出稳定的轮廓:它们在中层峰值,并且在后残差/MLP路径中比在注意力路径中更强。难度在模型间一致(反义最容易,同义最难)。探测层面因果性是容量依赖的:在Llama 3.1上,SAE引导的补丁能可靠地转移这些信号,而在较小的模型上,转移较弱或不稳定。我们的结果澄清了语义关系在LLM内部的表示位置和可靠性,并提供了一个可复现的框架,将稀疏特征与探测层面因果证据联系起来。

英文摘要:

Understanding whether large language models (LLMs) capture structured meaning requires examining how they represent concept relationships. In this work, we study three models of increasing scale: Pythia-70M, GPT-2, and Llama 3.1 8B, focusing on four semantic relations: synonymy, antonymy, hypernymy, and hyponymy. We combine linear probing with mechanistic interpretability techniques, including sparse autoencoders (SAE) and activation patching, to identify where these relations are encoded and how specific features contribute to their representation. Our results reveal a directional asymmetry in hierarchical relations: hypernymy is encoded redundantly and resists suppression, while hyponymy relies on compact features that are more easily disrupted by ablation. More broadly, relation signals are diffuse but exhibit stable profiles: they peak in the mid-layers and are stronger in post-residual/MLP pathways than in attention. Difficulty is consistent across models (antonymy easiest, synonymy hardest). Probe-level causality is capacity-dependent: on Llama 3.1, SAE-guided patching reliably shifts these signals, whereas on smaller models the shifts are weak or unstable. Our results clarify where and how reliably semantic relations are represented inside LLMs, and provide a reproducible framework for relating sparse features to probe-level causal evidence.

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

↑