1 of 15

Big Bird: Transformers for Longer Sequences

2022.01.신재영

2 of 15

Introduction

Architecture

1

2

3

4

5

CONTENTS

Theoretical Results

Experiments

Conclusion

3 of 15

Big Bird

Big Bird: Transformers for Longer Sequences

  • Transformer의 Self-Attention 장점
    • Self-attention mechanism은 parallel하게 계산할 수 있어 연산량 높임
    • RNN 모델 등에서 문제가 되는 sequential dependency를 해결함
  • Transformer의 한계와 full attention 탈피 노력
    • 연산량이 길이의 제곱에 비례하기 때문에 input sequence 길이에 제한
    • 512 token보다 훨씬 긴 sequence에 대해서는 효과적이지 못하기 때문에 추가 연구가 많이 진행됨

Introduction

4 of 15

Big Bird

Big Bird: Transformers for Longer Sequences

  • 기존 모델들보다 8배 더 긴 sequence input에 효과
    • self-attention layer 에서 full-attention이 아닌 sparse-attention 으로 연산하는 점이 특징
    • 512 token보다 훨씬 긴 sequence를 위해 (4096 tokens)

  • Generalized attention mechanism
    • Random Attention : 각 쿼리가 랜덤한 r개의 key에 집중
    • Window Attention : 이웃한 토큰에만 집중
    • Global Attention : Global token(모든 token에 집중하면서 모든 token으로부터 집중 받는 token) 설정

Introduction

5 of 15

Big Bird

Architecture

Big Bird: Transformers for Longer Sequences

Generalized attention mechanism (sparse attention mechanism)

    • Random Blocks : 각 쿼리가 랜덤한 r개의 key에 집중
    • Local Window : 이웃한 토큰에만 집중
    • Global Token : 모든 token에 집중하면서 모든 token으로부터 집중 받는 token

[그림] Big Bird의 Attention 구조

6 of 15

Big Bird

Architecture

Big Bird: Transformers for Longer Sequences

sparse random graph for attention mechanism 에 반영한 특징

  1. Small average path length between nodes

random graph의 크기를 키우고 sparse하게 만들어도 최단 경로가 기하급수적으로 급격히 증가하는 것이 아니고 매우 완만하게 변화

본 논문에서는 각 query가 r개의 random key를 attend하는 구조로 반영

Erdos-renyi model 기반으로 연구

2. Notion of locality

token의 정보는 대부분 주변 token의 정보에서 얻어지고,

멀리 떨어진 token에서 얻게 되는 정보량은 적음

본 논문에서는 각 node(token)이 window size w 으로 양 옆 단어를 attend하는 구조 적용

Clustering coefficient를 기반으로 이웃 토큰간의 인접성을 지키는 것의 중요성 연구

7 of 15

Big Bird

Architecture

Big Bird: Transformers for Longer Sequences

Random, window를 적용한 self-attention으로는 기존 BERT의 성능만큼 나오지 않았고, 실험과 이론 분석을 통해 global token의 중요성을 파악하고 적용

  1. BigBird-ITC

(Internal Transformer Construction)

이미 언어 corpus에 존재하는 token 중 특정 몇개를 global token으로 지정하여 모든 token들에 대해 attention 계산

2. BigBird-ETC

(Extended Transformer Construction)

sequence에 g개의 global token을 추가하여 모든 token들과 연결하여 계산

8 of 15

Big Bird

Architecture

Big Bird: Transformers for Longer Sequences

Big Bird에서 self-attention이 적용되는 구조

i번째 token에 대한 generalized attention mechanism

output vector

9 of 15

Big Bird

Theoretical Results

about Sparse

Attention Mechanism

Big Bird: Transformers for Longer Sequences

sparse attention mechanism이 full-attention mechanism의 성능이 나올 수 있음을 이론적으로 탐색하고 증명함

Sparse attention mechanism 기반의 encoder가 Universal Approximator

Turing Complete한 sparse

encoder-decoder transformer

10 of 15

Big Bird

Theoretical Results

about Sparse

Attention Mechanism

Big Bird: Transformers for Longer Sequences

Limitations

sparse attetion을 적용할 시 한 레이어당 dimension^3 연산량이 요구되어 모델의 크기가 증가

Worst case의 경우 입력 시퀀스 길이만큼의 layer가 필요

Transformer의 한계를 완전히 극복한 것은 아니고, 한계를 극복하기 위해 진행된 연구 중 하나

11 of 15

Big Bird

Experiments

Big Bird: Transformers for Longer Sequences

Pretraining and MLM

문서의 최대 길이 4096 token

16GB 메모리에서 batch size 32~64로 실험

12 of 15

Big Bird

Experiments

Big Bird: Transformers for Longer Sequences

Question Answering (QA)

RoBERTa, Longformer보다

좋은 성능

13 of 15

Big Bird

Experiments

Big Bird: Transformers for Longer Sequences

Classification

문서 분류 task를 위해 GLUE 뿐만 아니라 다양한 길이와 내용을 담고 있는 데이터셋에 대해서 실험

길이가 더 길면서 학습 데이터가 적은 경우에 큰 성능 향상 보임(Arxiv dataset에서 5%)

14 of 15

Big Bird

Experiments

Big Bird: Transformers for Longer Sequences

abstractive summarization 데이터셋에서 long document, short document 모두에 대해 성능측정

본 연구에서는 encoder에만 sparse

attention을 적용하고 decoder는 원래 모델처럼 full attention을 사용함

실험 결과 모든 데이터셋에서 SOTA 달성

Summarization

15 of 15

Big Bird: Transformers for Longer Sequences

  • QA, classification 실험에서 사용한 길이가 짧은 문서와 긴 문서에 대한 summarization 성능 평가에서 Big Bird는 모두 SOTA 달성

  • 추출 요약보다 더 높은 수준인 추상 요약에서 뛰어난 성능

  • promoter의 위치를 찾는 Promotor Region Prediction과 DNA에서 단백질을 coding하고 있지 않는 non-coding 부분을 찾는 Chromatin-Profile Prediction을 진행한 Genomics task에서도 기존 모델보다 뛰어난 성능을 보여주어 nlp 이외 분야에도 활용될 수 있을 것으로 전망
  • Abstractive Document Summarization수행에 중점
  • 데이터셋 : long document, short document �_ 긴 문서의 경우 중요한 정보 고르게 분포되어 있어 abstractive 요약 성능 측정 효율↑
  • 긴 문서에 대한 요약 수행력 ( ROUGE score(%) )�

Big Bird

Conclusion