シーケンス順序を超えて:Transformerのための構文情報を取り入れた位置埋め込み
Beyond Sequence Order: Syntax-Informed Positional Embeddings for Transformers
August 6, 2026
著者: Haris Riaz, Hyungji Kim, Mihai Surdeanu
cs.AI
要旨
Transformerにおける位置埋め込み(PE)は、トークン間の距離と順序を符号化するが、構文構造に対してはほとんど考慮しない。本稿では、構文情報を組み込んだ位置埋め込み(SiPE)を提案する。SiPEは、事前学習中に依存関係解析から軽量な構文事前分布を学習し、それを絶対・相対・回転という主要な3種類のPEファミリーすべてに対して、エンコーダとデコーダの両方に注入する。自己注意機構やその他のアーキテクチャは変更しない。我々は、事前分布をモデルのどこにどのように導入すべきかを特定し、それがアーキテクチャに依存することを見いだした。すなわち、相対PEを用いる自己回帰デコーダでは、事前分布を注意スコアの相対位置項に乗算で結合した場合に最も効果が高く、入力埋め込みへの注入、自己注意への注入、位置項と注意項の両方への同時注入よりも優れている。一方、エンコーダでは、事前分布を入力埋め込みに直接加算し、各エンコーダ固有の位置機構と組み合わせるのが最適である。SiPEを用いて事前学習したモデルは、構文監督なしのベースモデルと比較して、SyntaxGymベンチマークで最大10.3%向上し、同時にパープレキシティを9.0%低減する。これは、既存の構文注入手法のほとんどがむしろ悪化させる指標である。重要なことに、これらの改善は構文一般化を超えて及ぶ。SiPEは実世界の言語理解も向上させ、SiPEなしで学習したモデルと比較してGLUEベンチマークのスコアを最大8.2%引き上げる。推論時に多数の構文木を周辺化したり、実行時に構文を破棄する既存の構文言語モデルとは異なり、SiPEは単一の構文木に条件付けを行い、構文監督と推論コストの間に新たなパレート最前線を確立する。
English
Positional embeddings (PE) in Transformers encode token distance and order but are largely agnostic to syntactic structure. We introduce Syntax-informed Positional Embeddings (SiPE), which learns a lightweight syntactic prior from dependency parses during pretraining and injects it across all three dominant PE families (absolute, relative, rotary), for both encoders and decoders, leaving self-attention and the rest of the architecture untouched. We isolate where and how the prior should enter the model, and find it depends on the architecture: for autoregressive decoders that use relative PE, the prior is strongest when coupled multiplicatively with the relative-position term of the attention score, outperforming injection into the input embeddings, into self-attention, or into the positional and attention terms jointly---while for encoders it is best added directly to the input embeddings, composing with each encoder's native positional mechanism. We find that models pre-trained with SiPE improve on the SyntaxGym benchmark by up to 10.3% while simultaneously reducing perplexity by 9.0% over a base model with no syntactic supervision---a metric nearly every existing syntax-injection method instead degrades. Crucially, these gains extend beyond syntactic generalization: SiPE also improves real-world language understanding, raising scores on the GLUE benchmark by up to 8.2% over a model trained without it. Unlike existing syntactic language models that marginalize over many parses at inference or discard syntax at runtime, SiPE conditions on a single parse, establishing a new Pareto frontier between syntactic supervision and inference cost.