Skip to main content
QUICK REVIEW

[논문 리뷰] Combiner: Full Attention Transformer with Sparse Computation Cost

Hongyu Ren, Hanjun Dai|arXiv (Cornell University)|2021. 07. 12.
Topic Modeling참고 문헌 44인용 수 28
한 줄 요약

Combiner는 주의(attention)를 구조화된 조건부 분포로 모델링하여 전체 주의(attention)를 하위 제곱 비용으로 제공하고, 장문 시퀀스 텍스트 및 이미지 작업에서 강력한 성과를 달성하며 여러 벤치마크에서 기저 모델과 대등하거나 이를 능가합니다.

ABSTRACT

Transformers provide a class of expressive architectures that are extremely effective for sequence modeling. However, the key limitation of transformers is their quadratic memory and time complexity $\mathcal{O}(L^2)$ with respect to the sequence length in attention layers, which restricts application in extremely long sequences. Most existing approaches leverage sparsity or low-rank assumptions in the attention matrix to reduce cost, but sacrifice expressiveness. Instead, we propose Combiner, which provides full attention capability in each attention head while maintaining low computation and memory complexity. The key idea is to treat the self-attention mechanism as a conditional expectation over embeddings at each location, and approximate the conditional distribution with a structured factorization. Each location can attend to all other locations, either via direct attention, or through indirect attention to abstractions, which are again conditional expectations of embeddings from corresponding local regions. We show that most sparse attention patterns used in existing sparse transformers are able to inspire the design of such factorization for full attention, resulting in the same sub-quadratic cost ($\mathcal{O}(L\log(L))$ or $\mathcal{O}(L\sqrt{L})$). Combiner is a drop-in replacement for attention layers in existing transformers and can be easily implemented in common frameworks. An experimental evaluation on both autoregressive and bidirectional sequence tasks demonstrates the effectiveness of this approach, yielding state-of-the-art results on several image and text modeling tasks.

연구 동기 및 목표

  • 매우 긴 시퀀스에 대해 전체 주의(attention)로의 확장 가능한 시퀀스 모델링의 동기를 제공한다.
  • Combiner를 하위 제곱 비용 내에서 전체 주의(attention)를 보존하는 구조화된 조건부 기대 접근법으로 도입한다.
  • 표현력을 유지하기 위해 기존의 희소 주의 패턴에서 Combiner를 구현하는 방법을 제시한다.
  • 이미지의 밀도 추정과 긴 길이 시퀀스 작업에서 최첨단 성능을 보여주면서도 표준 프레임워크에서 구현 가능하도록 한다.

제안 방법

  • 주의(attention)를 질의 위치를 기준으로 한 값 임베딩의 조건부 기대값으로 재해석한다.
  • 조건부 분포를 직접 주의 항(term)와 여러 로컬(추상화 기반) 주의들로 분해한다.
  • 기존의 희소 패턴에서 영감을 받은 하위 제곱 로컬 분해 방식을 사용하여 비용 O(L log L) 또는 O(L sqrt L)로 전체 주의(attention)을 달성한다.
  • 로컬 영역에 대한 확률을 스케일드 닷 프로덕트와 단순한 추상화(최대 풀링 또는 DeepSets)를 사용해 매개변수화한다.
  • 기존의 희소 패턴을 전체 주의(attention) 변형으로 전환하는 여러 Combiner 인스턴스(Fixed, Logsparse, Axial, Learnable)를 제공한다.
  • 로컬 분해의 표현력을 높이기 위한 선택적 혼합 구성요소를 제공한다.

실험 결과

연구 질문

  • RQ1전체 주의(attention)이 구조화된 주의 분포의 하위 제곱 계산 및 메모리로 달성될 수 있는가?
  • RQ2효율성을 손상시키지 않으면서 기존의 희소 주의 패턴을 어떻게 재목적화하여 전체 주의(attention)로 만들 수 있는가?
  • RQ3Combiner의 텍스트 및 이미지 도메인에서 자가회귀 및 양방향 작업에 대한 경험적 성능 향상은 무엇인가?

주요 결과

  • Combiner는 각 헤드 내에서 하위 제곱 비용으로 전체 주의(attention)를 달성하여 희소 변형의 점근적 복잡도(O(L log L) 또는 O(L sqrt L))와 일치한다.
  • CIFAR-10에서 Combiner-Axial은 2.77 bits/dim을 달성하여 여러 벤치마인들을 능가한다.
  • ImageNet-64에서 Combiner-Axial은 3.42 bits/dim에 도달하여 이전의 희소/트랜스포머 벤치마인들과 경쟁적이거나 더 우수하다.
  • Wiki-40B의 언어 모델링에서 Combiner-Fixed-2k 및 Combiner-Axial-2k 변형은 여러 벤치마인보다 더 낮은 perplexity를 달성하며, 8k 시퀀스를 사용할 때 추가 이득이 있다.
  • Long-Range Arena 벤치마크에서 Combiner 변형(Fixed, Axial)은 여러 작업에서 바닐라 트랜스포머의 성능과 일치하거나 이를 능가한다.
  • Combiner는 표준 프레임워크에서 구현 가능하면서도 강력한 밀도 추정 및 자가회귀/양방향 모델링 성능을 보인다.

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

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

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

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