Skip to main content
QUICK REVIEW

[논문 리뷰] On The Computational Complexity of Self-Attention

Feyza Duman Keles, Pruthuvi Mahesakya Wijewardena|arXiv (Cornell University)|2022. 09. 11.
Neural Networks and Reservoir ComputingComputer Science인용 수 29
한 줄 요약

이 논문은 SETH 하에서 다양한 self-attention 표현에 대해 self-attention의 시간 복잡도에 대한 조건부 2차 하한을 증명하고, 다항 차수에 비례한 지수 비용을 갖는 유한 테일러 급수로 선형 시간 근사치를 보인다.

ABSTRACT

Transformer architectures have led to remarkable progress in many state-of-art applications. However, despite their successes, modern transformers rely on the self-attention mechanism, whose time- and space-complexity is quadratic in the length of the input. Several approaches have been proposed to speed up self-attention mechanisms to achieve sub-quadratic running time; however, the large majority of these works are not accompanied by rigorous error guarantees. In this work, we establish lower bounds on the computational complexity of self-attention in a number of scenarios. We prove that the time complexity of self-attention is necessarily quadratic in the input length, unless the Strong Exponential Time Hypothesis (SETH) is false. This argument holds even if the attention computation is performed only approximately, and for a variety of attention mechanisms. As a complement to our lower bounds, we show that it is indeed possible to approximate dot-product self-attention using finite Taylor series in linear-time, at the cost of having an exponential dependence on the polynomial order.

연구 동기 및 목표

  • 트랜스포머 내에서 self-attention의 기초적 시간/정확도 트레이드를 연구의 동기로 삼는다.
  • SETH 하에서 많은 설정에서 제2차 시간 복잡도가 필수적임을 보이는 조건부 하한을 확립한다.
  • self-attention을 위한 테일러급수에 의한 선형 시간 근사와 실용적 upper bound를 탐구한다.
  • 다양한 self-attention 변형들에 걸친 강건한 난이도 결과를 하나의 통합 프레임워크로 제공한다.

제안 방법

  • Orthogonal Vectors Problem(OVP) 및 관련 문제(TVPP, BHCP, BHFP)로부터의 환원 방법을 사용하여 SETH 기반 하한을 증명한다.
  • OVP 인스턴스를 self-attention 입력으로 변환하는 벡터 기믹을 구성한다.
  • 점곱 self-attention과 소프트맥스 점곱 self-attention(정확한 경우와 근사(곱셈적/덧셈적) 시나리오 포함)을 분석한다.
  • 슬라이딩 윈도우 및 l2(RBF) self-attention으로 확장하여 직사각형/2차 하드니스를 보인다.
  • 다항식(Taylor) 근사를 제안하여 다항 차수에 비례한 지수 비용으로 선형 시간 계산을 달성한다.
  • 유한 테일러 급수인 경우 선형 시간 계산이 달성 가능한 조건을 제공한다.

실험 결과

연구 질문

  • RQ1입력 길이에 대해 self-attention 계산이 일반적인 복잡도 가정 하에서 서브-2차가 가능할까?
  • RQ2근사적 self-attention 방법이 2차 시간보다 빠르면서 도입 가능한 오차 보장을 제공할 수 있을까?
  • RQ3다양한 self-attention 변형들(dot-product, softmax, windowed, l2)가 SETH 기반 난이도 감소에 대해 어떻게 작용하는가?
  • RQ4self-attention을 위한 실행 가능한 선형 시간 근사는 무엇이며, 어떤 트레이드오프를 수반하는가?
  • RQ5다항식 근사가 self-attention의 시간/정확도 프런티어에 어떤 영향을 미치는가?

주요 결과

  • 정확한 self-attention 계산과 근사self-attention 계산은 여러 변형에 대해 SETH 하에서 조건부적으로 2차 시간이다.
  • 슬라이딩 윈도우 self-attention과 l2 (RBF) self-attention은 적절한 조건에서 2차 하한을 상속한다.
  • softmax self-attention의 유한 테일러 급수 근사는 차수에 지수적으로 비례하는 시간으로 선형 시간 계산을 제공한다.
  • 난이도 증명은 TVPP 및 BHCP/BHFP를 통한 OVP 환원에 의존하며, 벡터 기깃을 통해 구성 요소를 가능하게 한다.
  • 이 연구는 부분적으로 모든 입력에 대해 서브-2차 및 거의 정확한 self-attention이 어려울 수 있다는 'no-free-lunch' 현상을 강조한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.