DAPE: Data-Adaptive Positional Encoding for Length Extrapolation

要約

位置エンコーディングはトランスフォーマーにおいて重要な役割を果たし、モデルのパフォーマンスと長さの一般化に大きな影響を与えます。
以前の研究では、特定のシーケンス内のトークンの位置を区別するために、絶対位置エンコーディング (APE) と相対位置エンコーディング (RPE) が導入されました。
ただし、APE と RPE はどちらも、入力データに関係なくモデルのトレーニング後に固定されたままとなり、適応性と柔軟性が制限されます。
したがって、目的の位置エンコーディングはデータ適応型である必要があり、所定の注意を払って動的に調整できることが期待されます。
この論文では、入力コンテキストと学習された固定事前分布に基づいて動的かつ意味論的に調整するデータ適応型位置エンコーディング (DAPE) 手法を提案します。
実世界のデータセット (Arxiv、Book3、CHE) での実験検証では、DAPE がトレーニングされた長さと長さの汎化の点でモデルのパフォーマンスを向上させ、統計的に有意な改善が見られることが実証されています。
モデルの視覚化は、モデルがローカル情報と反ローカル情報の両方を保持できることを示唆しています。
最後に、シーケンス長 128 でモデルをトレーニングすることに成功し、評価シーケンス長 8192 で他の静的位置エンコード方法と比較して優れたパフォーマンスを達成し、適応型位置エンコード方法の利点を明らかにしました。

要約(オリジナル)

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.

arxiv情報

著者 Chuanyang Zheng,Yihang Gao,Han Shi,Minbin Huang,Jingyao Li,Jing Xiong,Xiaozhe Ren,Michael Ng,Xin Jiang,Zhenguo Li,Yu Li
発行日 2024-09-26 10:23:33+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL パーマリンク