arXiv:2605.30022cs.CLcs.AI2026-05

分离位置与语义表示,揭示了Transformer中位置编码的内在机制。

Give it Space! Explicit Disentangling of Positional and Semantic Representations in Encoders

论文配图:Give it Space! Explicit Disentangling of Positional and Semantic Representations in Encoders
图 1 · 摘自论文原文
  • 将语义、绝对位置和相对位置三路解耦,仅在语义流上训练
  • 绝对位置自发形成二维低频流形,保留文档结构
  • 解耦设计提升65个语言现象中49个的表征能力

位置编码是变换器模型处理序列顺序的核心机制,但其内部如何处理和存储位置信息仍不清晰。现有方法如RoPE在长上下文理解或检索任务中表现不佳。基于训练后变换器中位置与语义信号近乎正交的发现,本文改造编码器,显式分离语义、绝对位置(AP)和相对位置(RP)三路输入,并将掩码语言建模(MLM)目标限制在语义流。该解耦设计使机制研究更清晰,获得三个结论:(1)孤立的AP子空间自发坍缩为低频二维流形,捕捉文档结构;(2)注意力头分化为结构导向与语义导向两类,且仅相对位置支持后者;(3)标准位置编码无法稳健保持宏观结构:RoPE与RP仅弱编码结构,而纠缠的绝对位置在最终层受MLM压力下丢失结构。解耦方法有效保留位置信息,在Flash-Holmes探测基准的65个语言现象中,提升了49个的表现。

原文摘要 · Abstract (English)

Positional encoding (PE) underpins how permutation-invariant Transformers represent sequence order, yet how positional information is processed and stored remains poorly understood. Modern PE methods such as RoPE still struggle on tasks such as long-context understanding or retrieval \cite{chen-etal-2025-hope}. Hence, a better understanding of the internal positional mechanism could help design better PE. Building on evidence that positional and semantic signals occupy nearly orthogonal subspaces in trained Transformers, we modify an encoder Transformer to process three explicitly disentangled streams: semantic, absolute positional (AP) and relative positional (RP), and confine the masked-language-modeling (MLM) objective to the semantic stream. This decoupling enables a clean mechanistic study and yields three take-aways. (1) The isolated AP subspace spontaneously collapses into a low-frequency two-dimensional manifold that captures the structure of the document; (2) Attention heads specialize into structure and semantic-oriented groups, with RP exclusively supporting the latter; (3) Standard positional encodings do not robustly retain macroscopic structure: RoPE and RP only weakly encode it, and entangled AP loses it in the final layers under MLM pressure. The disentangled approach preserves positional encoding, which improves linguistic representation on 49 of the 65 linguistic phenomena of the Flash-Holmes probing benchmark.

位置编码Transformer表示解耦

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。