发现大模型用极坐标编码语法关系,方向和距离都重要
A polar coordinate system represents syntax in large language models
- 用极坐标系同时捕捉词向量间距离与方向,编码语法关系
- 性能接近结构探针两倍,能准确识别关系类型与方向
- 该几何结构存在于多层模型中间层,前沿模型更精确
尽管语法树最初用符号表示,但大型语言模型(LLMs)的激活中也能有效体现。已有‘结构探针’可在神经激活的子空间中找到语义相关词相对靠近的位置。然而,这种语法编码仍不完整:结构探针的词向量距离只能反映关系存在,无法表示关系类型与方向。本文提出假设:语法关系实际由邻近向量间的相对方向编码。为此,我们引入‘极坐标探针’(Polar Probe),通过距离与方向共同读取语法关系。结果表明:第一,极坐标探针成功恢复关系类型与方向,性能接近结构探针两倍;第二,该极坐标系统存在于多个大模型中间层的低维子空间中,且在最新前沿模型中愈发精确;第三,新基准测试显示,嵌套语法层级中的相似关系以相似方式编码。总体而言,该研究揭示了大模型自发学习到一种显式表征语言理论主要符号结构的神经激活几何。
原文摘要 · Abstract (English)
Originally formalized with symbolic representations, syntactic trees may also be effectively represented in the activations of large language models (LLMs). Indeed, a 'Structural Probe' can find a subspace of neural activations, where syntactically related words are relatively close to one-another. However, this syntactic code remains incomplete: the distance between the Structural Probe word embeddings can represent the existence but not the type and direction of syntactic relations. Here, we hypothesize that syntactic relations are, in fact, coded by the relative direction between nearby embeddings. To test this hypothesis, we introduce a 'Polar Probe' trained to read syntactic relations from both the distance and the direction between word embeddings. Our approach reveals three main findings. First, our Polar Probe successfully recovers the type and direction of syntactic relations, and substantially outperforms the Structural Probe by nearly two folds. Second, we confirm that this polar coordinate system exists in a low-dimensional subspace of the intermediate layers of many LLMs and becomes increasingly precise in the latest frontier models. Third, we demonstrate with a new benchmark that similar syntactic relations are coded similarly across the nested levels of syntactic trees. Overall, this work shows that LLMs spontaneously learn a geometry of neural activations that explicitly represents the main symbolic structures of linguistic theory.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。