📑Paper Review

[paper reivew] Generating Long Sequences with Sparse Transformer

date
Sep 8, 2023
slug
Generating-Long-Sequences
author
status
Public
tags
paper
DeepLearning
summary
type
Post
thumbnail
category
📑Paper Review
updatedAt
Sep 6, 2024 02:56 PM

Introduction

transformer는 natural language task와 같은 sequence 데이터를 다루는 데 있어 효과적인 모델
하지만 transformer의 구조는 sequence length가 증가할수록 memory와 연산 복잡도가 quadratic하게 증가한다는 한계 존재
본 논문의 가장 큰 contribution은 기존 의 복잡도를 로 감소시키는 것

Factorized Self-Attention

notion image
다음은 일반적인 transformer의 self attention
full self attention은 로 가정, 모든 element가 모든 이전 element에 attention 분포 계산할 수 있도록 함
즉 full self attention은 하나의 query가 모든 key에 대해 분포를 계산하는 구조
하지만 transformer의 layer를 모두 거친 결과를 보면 특정 query는 몇개의 key를 제외하고는 sparse한 분포를 가짐
Factorized self attention은 p개의 self attention head를 가지고 이때 m번째 head는 다음과 같이 정의됨
notion image
즉 p개의 self attention head로 분리된 m번째 head가 모든 element에 대해 attention하는게 아니라 특정 subset에 대해서만 attention하도록 함

Sparse Transformer

notion image
factorized self attention을 적용하기 위한 방법 두가지를 제시
notion image
standard attention 연산은 다음과 같이 표현 가능
첫번째 approach는 residual block마다 attention을 사용하는 것
notion image
두번째 approach는…

Experiment

notion image
natural images, text, and raw audio에 대해 density modeling task 진행
모든 데이터셋에서 sparse transformer가 좋은 결과를 보여주고 있음을 확인할 수 있음