paper-with-me

Papers

SeqPE: Transformer with Sequential Position Encoding

2025-06-16 · Huayang Li, Yahui Liu, Hongyu Sun, Deng Cai, Leyang Cui, Wei Bi, Peilin Zhao, Taro Watanabe

Since self-attention layers in Transformers are permutation invariant by design, positional encodings must be explicitly incorporated to enable spatial understanding. However, fixed-size lookup tables used in traditional learnable position embeddings (PEs) limit extrapolation capabilities beyond pre-trained sequence lengths. Expert-designed methods such as ALiBi and RoPE, mitigate this limitation but demand extensive modifications for adapting to new modalities, underscoring fundamental challenges in adaptability and scalability. In this work, we present SeqPE, a unified and fully learnable position encoding framework that represents each $n$-dimensional position index as a symbolic sequence and employs a lightweight sequential position encoder to learn their embeddings in an end-to-end manner. To regularize SeqPE's embedding space, we introduce two complementary objectives: a contrastive objective that aligns embedding distances with a predefined position-distance function, and a knowledge distillation loss that anchors out-of-distribution position embeddings to in-distribution teacher representations, further enhancing extrapolation performance. Experiments across language modeling, long-context question answering, and 2D image classification demonstrate that SeqPE not only surpasses strong baselines in perplexity, exact match (EM), and accuracy--particularly under context length extrapolation--but also enables seamless generalization to multi-dimensional inputs without requiring manual architectural redesign. We release our code, data, and checkpoints at https://github.com/ghrua/seqpe.

📄 PDF Abstract BibTeX arXiv:2506.13277

Code (1)

ghrua/seqpe 공식 구현 jax

Tasks

image-classificationImage ClassificationKnowledge DistillationLanguage ModelingLanguage ModellingPositionQuestion Answering

Methods 이 논문이 사용한 방법론

ALiBi ALiBi, or Attention with Linear Biases, is a positioning method that allows…
Knowledge Distillation A very simple way to improve the performance of almost any machine learning algorithm is to train many different models on the same data and then to average their predictions.…

Similar Papers 제목 키워드 기반

Causality-Induced Positional Encoding for Transformer-Based Representation Learning of Non-Sequential Features

2025-09-20 · Kaichen Xu, Yihang Du, Mianpeng Liu, Zimu Yu 외 arxiv

Positional encoding is essential for supplementing transformer with positional information of tokens. Existing positional encoding methods demand predefined token/feature order, rendering them unsuitable for real-world d…

Representation Learning

Spherical Position Encoding for Transformers

2023-10-04 · Eren Unlu

Position encoding is the primary mechanism which induces notion of sequential order for input tokens in transformer architectures. Even though this formulation in the original transformer paper has yielded plausible perf…

Position

LoPE: Learnable Sinusoidal Positional Encoding for Improving Document Transformer Model

2022-01-16 · ACL ARR January 2022 1 · Anonymous

Positional encoding plays a key role in Transformer-based architecture, which is to indicate and embed token sequential order information. Understanding documents with unreliable reading order information is a real chall…

document understanding

Positional Encoding in Transformer-Based Time Series Models: A Survey

2025-02-17 · Habib Irani, Vangelis Metsis

Recent advancements in transformer-based models have greatly improved time series analysis, providing robust solutions for tasks such as forecasting, anomaly detection, and classification. A crucial element of these mode…

Anomaly DetectionBenchmarkingSurveyTime Series+2

Transformer with Tree-order Encoding for Neural Program Generation

2022-05-30 · Klaudia-Doris Thellmann, Bernhard Stadler, Ricardo Usbeck, Jens Lehmann

While a considerable amount of semantic parsing approaches have employed RNN architectures for code generation tasks, there have been only few attempts to investigate the applicability of Transformers for this task. Incl…

Code GenerationDecoderSemantic Parsing