Skip to main content
QUICK REVIEW

[논문 리뷰] Random Feature Attention

Hao Peng, Nikolaos Pappas|arXiv (Cornell University)|2021. 03. 03.
Topic Modeling참고 문헌 70인용 수 122
한 줄 요약

Rfa는 softmax 주의(attention)를 선형 시간 및 선형 공간의 무작위 특징 근사로 대체하며, 최근 편향을 위한 선택적 게이트를 포함하고, MT에서 강력한 트랜스포머에 비해 비슷하거나 더 나은 성능과 더 빠른 디코딩을 달성합니다.

ABSTRACT

Transformers are state-of-the-art models for a variety of sequence modeling tasks. At their core is an attention function which models pairwise interactions between the inputs at every timestep. While attention is powerful, it does not scale efficiently to long sequences due to its quadratic time and space complexity in the sequence length. We propose RFA, a linear time and space attention that uses random feature methods to approximate the softmax function, and explore its application in transformers. RFA can be used as a drop-in replacement for conventional softmax attention and offers a straightforward way of learning with recency bias through an optional gating mechanism. Experiments on language modeling and machine translation demonstrate that RFA achieves similar or better performance compared to strong transformer baselines. In the machine translation experiment, RFA decodes twice as fast as a vanilla transformer. Compared to existing efficient transformer variants, RFA is competitive in terms of both accuracy and efficiency on three long text classification datasets. Our analysis shows that RFA's efficiency gains are especially notable on long sequences, suggesting that RFA will be particularly useful in tasks that require working with large inputs, fast decoding speed, or low memory footprints.

연구 동기 및 목표

  • 트랜스포머의 긴 시퀀스에 대한 확장 가능한 주의력을 동기화한다.
  • softmax 주의의 선형 시간, 선형 공간 대체로 Random Feature Attention(Rfa)을 제안한다.
  • 학습 중에 recency bias를 도입하기 위한 선택적 게이팅 메커니즘을 통합한다.
  • 언어 모델링, 기계 번역, 긴 텍스트 분류에 걸친 Rfa의 효과를 입증한다.

제안 방법

  • exp(q·k/σ^2)를 근사하는 무편향 커널 기반 근사를 무작위 특징 맵 φ를 사용하여 도출하고 softmax 주의를 근사한다.
  • 주의를 φ(q)ᵀ S / (φ(q)· z)로 재작성하고 S와 z를 φ(k)⊗v 및 φ(k)로 누적하여 선형 시간 계산을 가능하게 한다.
  • Rfa-게이트(Rfa-Gate)를 도입하여 역사 정보를 부드럽게 감쇠시키고 recency bias를 인코딩하는 순환 유사 게이팅 기계 g_t를 도입한다.
  • Rfa가 softmax 주의의 대체재로 작용하도록 최소한의 매개변수 증가(≈0.1%)로 작동하도록 한다.
  • φ로 가우시안 및 아크-코사인 무작위 특징 맵을 탐구하고, q 및 k 노름에 대한 정규화를 고려한다.

실험 결과

연구 질문

  • RQ1시퀀스 길이에 선형적으로 스케일링되면서도 성능 저하 없이 주의를 근사화하는 방법은 무엇인가?
  • RQ2무작위 특징 기반 주의(Rfa)가 언어 모델링, 번역, 긴 시퀀스 분류 전반에서 표준 softmax 주의의 성능과 일치하거나 능가하는가?
  • RQ3Rfa의 게이팅 메커니즘이 최근 편향을 포착하고 국소성을 요하는 작업에서 성능을 향상시키는가?
  • RQ4디코딩 중 및 긴 입력에 대한 Rfa의 속도 향상 및 메모리 이점은 벤치마크 트랜스포머와 비교하여 어떤가?

주요 결과

  • Rfa는 WikiText-103에서 기본 트랜스포머와 비슷하거나 더 나은 perplexity를 달성하며, 게이팅은 뚜렷한 개선을 제공한다.
  • 기계 번역 벤치마크에서 모든 Rfa 변형은 Base 트랜스포머보다 최소 약 1.8× 빨리 디코딩하며, BLEU 점수는 Base와 유사하다.
  • 긴 텍스트 분류 작업에서 Rfa는 정확도에서 경쟁력이 있으며, 여러 효율적 트랜스포머 변형들에 비해 속도/메모리 이점을 제공한다.
  • 2048 길이 출력에서 최대 12×의 디코딩 속도 향상과 더 긴 시퀀스에서의 메모리 사용 감소를 보여준다.
  • 가우시안 특징 맵은 일반적으로 학습을 더 안정시키고 언어 모델링 실험에서 arc-cosine보다 더 나은 성능을 보인다.
  • 게이팅 변형(Rfa-Gate)은 특히 WikiText-103에서 언어 모델링에 이점을 제공한다.

더 나은 연구,지금 바로 시작하세요

연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.