DAPE: Data-Adaptive Positional Encoding for Length Extrapolation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Zheng, Chuanyang, Gao, Yihang, Shi, Han, Huang, Minbin, Li, Jingyao, Xiong, Jing, Ren, Xiaozhe, Ng, Michael, Jiang, Xin, Li, Zhenguo, Li, Yu
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913571489710080
author Zheng, Chuanyang
Gao, Yihang
Shi, Han
Huang, Minbin
Li, Jingyao
Xiong, Jing
Ren, Xiaozhe
Ng, Michael
Jiang, Xin
Li, Zhenguo
Li, Yu
author_facet Zheng, Chuanyang
Gao, Yihang
Shi, Han
Huang, Minbin
Li, Jingyao
Xiong, Jing
Ren, Xiaozhe
Ng, Michael
Jiang, Xin
Li, Zhenguo
Li, Yu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_14722
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle DAPE: Data-Adaptive Positional Encoding for Length Extrapolation
Zheng, Chuanyang
Gao, Yihang
Shi, Han
Huang, Minbin
Li, Jingyao
Xiong, Jing
Ren, Xiaozhe
Ng, Michael
Jiang, Xin
Li, Zhenguo
Li, Yu
Computation and Language
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.
title DAPE: Data-Adaptive Positional Encoding for Length Extrapolation
topic Computation and Language
url https://arxiv.org/abs/2405.14722