
TL;DR
- I read this because.. : 논문 스터디. 발제하신 분의 motivation은 사용하시는 모델에 efficient transformer를 사용하고 싶은데 RPE를 사용하는데 이에 대한 kernel 구현체가 없으셨다고.
- task : positional embedding
- problem : absolute PE는 학습한 max_len보다 더 긴게 들어왔을 때 일반화가 잘 안됨. relative PE는 additive하게 들어가서 LinFormer 같은 trick이 적용이 안됨
- idea : d 차원의 임베딩을 복소공간으로 옮겨서 크기와 공간을 갖는 벡터로 보고 PE를 weight 형태의 affine transformation으로 바꾸자
- input/output : token / token
- architecture : transformer
- objective : MLE
- baseline : BERT
- data : English Corpus, WMT-14(MT), CAIL2019-SCM(
- evaluation : GLUE,
- result : 빠른 수렴. GLUE에서 BERT보다 더 나은 성능.
- contribution : RPE 계열들을 한번 정리해줌
Details
Related Work : PEs
absolute PE

Shaw et al.

clipping
- Transformer-XL


- T5

Proposed

그림은 d=2일 때

- f : token embedding + PE
- g : attention score
각자 position idx * angle 만큼 회전시키고 나면 attention score를 구했을 때 relative position embedding을 구하는게 됨 Specifically, incorporating the relative position embedding is straightforward: simply rotate the affine-transformed word embedding vector by amount of angle multiples of its position index and thus interprets the intuition behind Rotary Position Embedding.
d차원으로 늘리면

Result
