探究大模型如何编码语义关系,发现层级关系存在不对称性。
Do Language Models Encode Semantic Relations? Probing and Sparse Feature Analysis
- 用探测与稀疏编码结合方法定位语义关系的编码位置。
- 上位关系冗余编码,下位关系易受破坏,抗干扰能力弱。
- 提供可复现的分析框架,适合研究模型内部表征的学者。
理解大语言模型是否捕捉结构化语义,需考察其对概念关系的表示方式。本文研究了三个规模递增的模型:Pythia-70M、GPT-2 和 Llama 3.1 8B,聚焦四种语义关系:同义、反义、上位和下位。通过线性探测结合机制可解释性技术(如稀疏自编码器 SAE 与激活补丁),识别这些关系的编码位置及特定特征的作用。结果表明,层级关系存在方向性不对称:上位关系冗余编码且抗抑制,而下位关系依赖紧凑特征,更易被删除扰动破坏。总体上,关系信号分布广泛但具稳定模式:在中间层达到峰值,且在残差后/MLP 路径中更强于注意力路径。任务难度跨模型一致(反义最易,同义最难)。探测层面的因果性具有容量依赖性:在 Llama 3.1 上,基于 SAE 的补丁能可靠改变信号;而在小模型中,效果微弱或不稳定。研究明确了语义关系在模型中的编码位置与可靠性,并提供了将稀疏特征与探测因果证据关联的可复现框架。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。