ChatPaper.aiChatPaper

랜덤화된 위치 인코딩이 트랜스포머의 길이 일반화 능력을 향상시킨다

Randomized Positional Encodings Boost Length Generalization of Transformers

May 26, 2023
저자: Anian Ruoss, Grégoire Delétang, Tim Genewein, Jordi Grau-Moya, Róbert Csordás, Mehdi Bennani, Shane Legg, Joel Veness
cs.AI

초록

고정된 컨텍스트 길이를 가진 작업에서 트랜스포머는 인상적인 일반화 능력을 보여줍니다. 그러나 임의 길이의 시퀀스로 일반화하는 데는 실패하며, 이는 문자열 복사와 같이 겉보기에 단순한 작업에서도 마찬가지입니다. 더욱이, 긴 시퀀스에 대해 단순히 학습하는 것은 전역 어텐션 메커니즘의 이차 계산 복잡성으로 인해 비효율적입니다. 본 연구에서는 이러한 실패 모드가 더 긴 시퀀스에 대해 위치 인코딩이 분포를 벗어나는 것(심지어 상대적 인코딩에서도)과 관련이 있음을 보여주고, 이 문제를 해결할 수 있는 새로운 위치 인코딩 패밀리를 소개합니다. 구체적으로, 우리의 무작위 위치 인코딩 기법은 더 긴 시퀀스의 위치를 시뮬레이션하고 순서가 있는 부분 집합을 무작위로 선택하여 시퀀스의 길이에 맞춥니다. 15가지 알고리즘 추론 작업에 걸쳐 6000개의 모델을 대상으로 한 대규모 실험 평가 결과, 우리의 방법이 트랜스포머가 보지 못한 길이의 시퀀스로 일반화할 수 있도록 해주며(평균 테스트 정확도가 12.0% 증가함) 이를 입증했습니다.
English
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).
PDF20December 15, 2024