paper-with-me

홈 › Papers

DAPE: Data-Adaptive Positional Encoding for Length Extrapolation

2024-05-23 · Chuanyang Zheng, Yihang Gao, Han Shi, Minbin Huang, Jingyao Li, Jing Xiong, Xiaozhe Ren, Michael Ng, Xin Jiang, Zhenguo Li, Yu Li

Positional encoding plays a crucial role in transformers, significantly impacting model performance and length generalization. Prior research has introduced absolute positional encoding (APE) and relative positional encoding (RPE) to distinguish token positions in given sequences. However, both APE and RPE remain fixed after model training regardless of input data, limiting their adaptability and flexibility. Hence, we expect that the desired positional encoding should be data-adaptive and can be dynamically adjusted with the given attention. In this paper, we propose a Data-Adaptive Positional Encoding (DAPE) method, which dynamically and semantically adjusts based on input context and learned fixed priors. Experimental validation on real-world datasets (Arxiv, Books3, and CHE) demonstrates that DAPE enhances model performances in terms of trained length and length generalization, where the improvements are statistically significant. The model visualization suggests that our model can keep both local and anti-local information. Finally, we successfully train the model on sequence length 128 and achieve better performance at evaluation sequence length 8192, compared with other static positional encoding methods, revealing the benefit of the adaptive positional encoding method.

📄 PDF Abstract BibTeX arXiv:2405.14722

Code (2)

chuanyang-zheng/cape 공식 구현 pytorch
chuanyang-zheng/dape 공식 구현 pytorch

Similar Papers 제목 키워드 기반

Distortion-Aware PETR for BEV Object Detection with Mixed Pinhole-Fisheye Cameras

2026-06-07 · Xiangzhong Liu arxiv

Fisheye cameras are widely deployed in autonomous driving perception suites for their low cost and full-coverage field of view (FOV), yet their potential remains underleveraged in 3D object detection. Severe radial disto…

3D Object DetectionAutonomous Driving

LaMPE: Length-aware Multi-grained Positional Encoding for Adaptive Long-context Scaling Without Training

2025-08-04 · Sikui Zhang, Guangze Gao, Ziyun Gan, Chunfeng Yuan 외 arxiv

Large language models (LLMs) experience significant performance degradation when the input exceeds the pretraining context window, primarily due to the out-of-distribution (OOD) behavior of Rotary Position Embedding (RoP…

DAPE V2: Process Attention Score as Feature Map for Length Extrapolation

2024-10-07 · Chuanyang Zheng, Yihang Gao, Han Shi, Jing Xiong 외

The attention mechanism is a fundamental component of the Transformer model, contributing to interactions among distinct tokens, in contrast to earlier feed-forward neural networks. In general, the attention scores are d…

Context-aware Biases for Length Extrapolation

2025-03-11 · Ali Veisi, Amir Mansourian

Transformers' ability to generalize to longer sequences than they have been trained on, known as length extrapolation, degrades as sequence length increases. Most of Relative Positional Encoding (RPE) methods address thi…

Decoder

Two Stones Hit One Bird: Bilevel Positional Encoding for Better Length Extrapolation

2024-01-29 · Zhenyu He, Guhao Feng, Shengjie Luo, Kai Yang 외

In this work, we leverage the intrinsic segmentation of language sequences and design a new positional encoding method called Bilevel Positional Encoding (BiPE). For each position, our BiPE blends an intra-segment encodi…

DisentanglementPosition