Skip to main content
QUICK REVIEW

[논문 리뷰] Transformers as Support Vector Machines

Davoud Ataee Tarzanagh, Yingcong Li|arXiv (Cornell University)|2023. 08. 31.
Topic Modeling인용 수 7
한 줄 요약

이 논문은 1층 트랜스포머에서 경사하강법을 사용할 때 자기주의(self-attention)의 최적화 역학이 하드 마진 서포트 벡터 머신(SVM) 문제와 형식적으로 동치임을 규명한다. 점점 줄어드는 정규화 조건 하에서, 1층 트랜스포머의 경사하강법은 파라미터 행렬 $\mathbf{W} = \mathbf{K}\mathbf{Q}^\top$의 핵노름(nuclear norm)을 최소화하는 SVM 해를 방향으로 수렴함을 보여준다. 주요 기여는 주어진 어텐션 메커니즘과 SVM 간의 이론적 프레임워크를 수립한 것으로, 과도한 파라미터화가 전역 수렴과 유리한 최적화 경관을 보장함을 드러낸다.

ABSTRACT

Since its inception in "Attention Is All You Need", transformer architecture has led to revolutionary advancements in NLP. The attention layer within the transformer admits a sequence of input tokens $X$ and makes them interact through pairwise similarities computed as softmax$(XQK^ op X^ op)$, where $(K,Q)$ are the trainable key-query parameters. In this work, we establish a formal equivalence between the optimization geometry of self-attention and a hard-margin SVM problem that separates optimal input tokens from non-optimal tokens using linear constraints on the outer-products of token pairs. This formalism allows us to characterize the implicit bias of 1-layer transformers optimized with gradient descent: (1) Optimizing the attention layer with vanishing regularization, parameterized by $(K,Q)$, converges in direction to an SVM solution minimizing the nuclear norm of the combined parameter $W=KQ^ op$. Instead, directly parameterizing by $W$ minimizes a Frobenius norm objective. We characterize this convergence, highlighting that it can occur toward locally-optimal directions rather than global ones. (2) Complementing this, we prove the local/global directional convergence of gradient descent under suitable geometric conditions. Importantly, we show that over-parameterization catalyzes global convergence by ensuring the feasibility of the SVM problem and by guaranteeing a benign optimization landscape devoid of stationary points. (3) While our theory applies primarily to linear prediction heads, we propose a more general SVM equivalence that predicts the implicit bias with nonlinear heads. Our findings are applicable to arbitrary datasets and their validity is verified via experiments. We also introduce several open problems and research directions. We believe these findings inspire the interpretation of transformers as a hierarchy of SVMs that separates and selects optimal tokens.

연구 동기 및 목표

  • 1층 트랜스포머의 경사하강법 학습에서의 암묵적 편향을 이해하기 위해 최적화 기하학을 SVM과 연결한다.
  • 어휘 토큰 쌍의 외적곱에 대한 선형 제약 조건을 통해 어텐션 메커니즘이 최적의 토큰을 어떻게 선택하는지 기술한다.
  • 과도한 파라미터화가 어텐션 최적화에서 전역 수렴을 이끌어내는 이유를 설명하기 위해, 탇성 가능성과 비최적 정류점의 제거를 보장함으로써 기반을 마련한다.
  • 선형 헤드를 넘어서 비선형 예측 헤드와 다중 토큰 조합으로의 SVM 등가성 확장을 다룬다.
  • 다양한 데이터 설정에서 교차 어텐션과 자기어텐션 메커니즘에 대한 수치 실험을 통해 이론을 검증한다.

제안 방법

  • 자기어텐션 메커니즘을 하드 마진 서포트 벡터 머신(Att-SVM) 문제로 공식화하여, 쌍별 토큰 외적곱에 대한 제약 조건을 통해 최적의 입력 토큰과 비최적 토큰을 분리한다.
  • 파라미터화를 $({\mathbf{K}}, {\mathbf{Q}})$를 통해 수행할 경우, 경사하강법이 $\mathbf{W} = \mathbf{K}\mathbf{Q}^\top$의 핵노름을 최소화하는 SVM 해를 방향으로 수렴함을 보여준다.
  • 직접 $\mathbf{W}$를 파라미터화할 경우, Frobenius 노름을 최소화하는 SVM 목적함수를 얻으며, 기하 조건 하에서 수렴이 보장됨을 증명한다.
  • 과도한 파라미터화가 SVM 문제의 타당성을 보장하고 비최적 정류점을 제거함으로써 전역 수렴을 가능하게 함을 보여준다.
  • 비선형 헤드와 다중 토큰 어텐션에 대한 일반화된 SVM 등가성을 도입하고, 다양한 차원과 토큰 선택 임계값에서의 수치 실험을 통해 검증한다.
  • 경향적 수렴을 확인하기 위해 실증 분석을 활용하여, 학습된 $\mathbf{W}$와 최적의 $\mathbf{W}^{\text{mm}}$ 간의 상관관계를 측정한다.
(a) $\bm{W}$ -parameterization
(a) $\bm{W}$ -parameterization

실험 결과

연구 질문

  • RQ1트랜스포머의 자기어텐션 최적화 기하학은 하드 마진 SVM 문제와 어떻게 관련이 있는가?
  • RQ2$({\mathbf{K}}, {\mathbf{Q}})$ 파라미터화에서 경사하강법의 암묵적 편향은 무엇이며, 직접 $\mathbf{W}$ 파라미터화와는 어떻게 다를까?
  • RQ3어떤 조건에서 어텐션 최적화 경관에서 경사하강법이 전역 수렴하는가?
  • RQ4과도한 파라미터화는 어텐션 모델의 수렴 행동과 경관에 어떤 영향을 미치는가?
  • RQ5SVM 등가성은 비선형 예측 헤드와 어텐션의 다중 토큰 조합으로까지 확장될 수 있는가?

주요 결과

  • $({\mathbf{K}}, {\mathbf{Q}})$-파라미터화된 어텐션에서의 경사하강법은 $\mathbf{W} = \mathbf{K}\mathbf{Q}^\top$의 핵노름을 최소화하는 SVM 해를 방향으로 수렴한다.
  • $\mathbf{W}$-파라미터화된 어텐션의 경우, 기하 조건에 따라 전역 또는 국소 수렴이 이루어지며, 과도한 파라미터화가 비최적 정류점을 제거함으로써 전역 수렴을 보장한다.
  • 과도한 파라미터화가 SVM 문제의 타당성을 보장하고, 비최적 정류점이 없는 안정적인 최적화 경관을 보장함을 보여준다.
  • 수치 실험 결과, $d \geq 8$ 또는 $\Gamma \leq 10^{-9}$ 조건에서 학습된 어텐션 가중치 $\mathbf{W}$가 최적의 SVM 해 $\mathbf{W}^{\text{mm}}$와 상관계수가 0.99 초과를 기록함을 확인하였다.
  • 일반화된 SVM 등가성을 사용할 경우, 어텐션에 의해 선택된 토큰 수는 항상 $\tau$ 이내에 머물며, 이는 레이마 6의 검증을 받는다.
  • 시퀀스 길이 $T$가 변하더라도 성능은 일관되며, 정확한 SVM 해 수렴을 위해 $m \gtrsim n$ 조건이 필요함을 확인하여, 랭크와 차원성에 대한 이론적 한계를 확인한다.
(b) $({\bm{K}},{\bm{Q}})$ -parameterization
(b) $({\bm{K}},{\bm{Q}})$ -parameterization

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

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

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

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