Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomized Positional Encodings Boost Length Generalization of Transformers, ACL'23 #820

Open
AkihikoWatanabe opened this issue Jul 14, 2023 · 1 comment

Comments

@AkihikoWatanabe
Copy link
Owner

https://virtual2023.aclweb.org/paper_P5597.html

@AkihikoWatanabe
Copy link
Owner Author

AkihikoWatanabe commented Jul 22, 2023

Transformers have impressive generalization capabilities on tasks with a fixed context length. However, they fail to generalize to sequences of arbitrary length, even for seemingly simple tasks such as duplicating a string. Moreover, simply training on longer sequences is inefficient due to the quadratic computation complexity of the global attention mechanism. In this work, we demonstrate that this failure mode is linked to positional encodings being out-of-distribution for longer sequences (even for relative encodings) and introduce a novel family of positional encodings that can overcome this problem. Concretely, our randomized positional encoding scheme simulates the positions of longer sequences and randomly selects an ordered subset to fit the sequence's length. Our large-scale empirical evaluation of 6000 models across 15 algorithmic reasoning tasks shows that our method allows Transformers to generalize to sequences of unseen length (increasing test accuracy by 12.0% on average).

Translation (by gpt-3.5-turbo)

  • トランスフォーマーは、固定されたコンテキスト長のタスクにおいて印象的な汎化能力を持っています。しかし、文字列の複製などの簡単に見えるタスクでも、任意の長さのシーケンスには汎化できません。さらに、単に長いシーケンスでトレーニングするだけでは、グローバルアテンションメカニズムの二次計算の複雑さのために効率的ではありません。本研究では、この失敗モードが長いシーケンスに対して位置エンコーディングが分布外であることに関連していることを示し、この問題を克服することができる新しい位置エンコーディングのファミリーを紹介します。具体的には、ランダム化された位置エンコーディングスキームは、長いシーケンスの位置をシミュレートし、順序付けられたサブセットをランダムに選択してシーケンスの長さに合わせます。15のアルゴリズム的推論タスクにわたる6000のモデルの大規模な実証評価により、私たちの手法がトランスフォーマーが未知の長さのシーケンスに汎化することを可能にし、テストの正確性を平均して12.0%向上させることを示しました。

Summary (by gpt-3.5-turbo)

  • トランスフォーマーは、固定長のタスクにおいては優れた汎化能力を持つが、任意の長さのシーケンスには対応できない。この問題を解決するために、新しい位置エンコーディング手法を提案する。ランダム化された位置エンコーディングスキームを使用し、長いシーケンスの位置をシミュレートし、順序付けられたサブセットをランダムに選択する。大規模な実証評価により、この手法がトランスフォーマーの汎化能力を向上させ、テストの正確性を平均して12.0%向上させることが示された。

@AkihikoWatanabe AkihikoWatanabe changed the title Randomized Positional Encodings Boost Length Generalization of Transformers Randomized Positional Encodings Boost Length Generalization of Transformers, ACL'23 Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant