ArXiv

Beyond Sequence Order: Syntax-Informed Positional Embeddings for Transformers

Authors
Haris Riaz, Hyungji Kim, Mihai Surdeanu
Categories
cs.CL, cs.AI
arXiv
https://arxiv.org/abs/2608.06111v1
PDF
https://arxiv.org/pdf/2608.06111v1

Brief

SiPE injects a learned dependency-parse syntactic prior into Transformers' positional embeddings (absolute, relative, rotary) during pretraining, with architecture-specific injection (multiplicative into relative-position attention for autoregressive decoders; added to input embeddings for encoders). Models pretrained with SiPE improve SyntaxGym by up to 10.3%, reduce perplexity 9.0%, and raise GLUE by up to 8.2%, while using a single parse at runtime.

Why it matters

SiPE (Syntax-informed Positional Embeddings) learns a lightweight syntactic prior from dependency parses during pretraining and injects it into absolute, relative, and rotary positional embeddings for both encoders and decoders; for autoregressive decoders using relative PE, the best injection is multiplicative coupling with the relative-position term, while for encoders the prior is added to input embeddings.

Key details

  • Pretrained models with SiPE yield concrete improvements: up to 10.3% higher SyntaxGym scores, a 9.0% reduction in perplexity versus a base model without syntactic supervision, and up to an 8.2% increase on the GLUE benchmark.
  • SiPE conditions on a single parse at runtime (no marginalization over parses), achieving a new Pareto frontier between syntactic supervision and inference cost by improving syntax generalization and real-world NLU without added inference-time complexity.
Source evidence

Abstract

Positional embeddings (PE) in Transformers encode token distance and order but are largely agnostic to \textit{syntactic structure}. We introduce \textbf{S}yntax-\textbf{i}nformed \textbf{P}ositional \textbf{E}mbeddings (\textbf{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 \emph{where} and \emph{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.

Comment: 21 pages, 9 figures