Loading [MathJax]/jax/output/CommonHTML/jax.js
본문 바로가기
NLP

GLU variants (2020) 논문 리뷰

by 아르카눔 2025. 4. 9.

GLU variants가 나온 의 논문 이름은 GLU Variants Improve Transformer다. (링크)

 

저자는 Noam Shazeer다. 

 

GLU는 Gated Linear Units의 약자다. 

 

Abstract

GLU, Gated Linear Units은 두 개의 linear projections의 component-wise product로 구성된다. 여기서는 다양한 GLU의 variants를 탐구한다. ReLU와 GELU 보다 좋은 성능임을 보인다.

 

Introduction

 

Transformer 베이스의 모델들의 내부의 Position-wise Feed-Forward Networks (FFN)에서 activation 함수들이 쓰인다.  

 

T5에서는 bias가 없는 버젼이다.  

 

ReLU는 FFNReLU(x,W1,W2)=max(xW1,0)W2로 표시할 수 있다.

 

GELU의 경우 FFNGELU(x,W1,W2)=GELU(xW1)W2로,  

 

Swishβ(x)의 경우 $\text{FFN}_\text{Swish}_{1}(x, W_1, W_2) = \text{ Swish }_{1}(xW_1)W_2$로 표기한다.

 

GELU는 Gaussian Error Linear Units로 GELU(x) = xΦx다. 이때 Φ는 CDF of normal distribution이다.   

 

Swishβ(x)=xσ(βx) 함수다.  σ는 sigmoid 함수다.   

 

Gated Linear Units (GLU) and Variants

GLU(x,W,V,b,c)=σ(xW+b)(xV+c)  

Bilinear(x,W,V,b,c)=(xW+b)(xV+c)  

 

이때 는 component-wise product = element-wise product = Hadamard product다.  

 

ReGLU(x,W,V,b,c)=max(0,xW+b)(xV+c)  

GEGLU (x,W,V,b,c)=GELU(xW+b)(xV+c)  

SwiGLU (x,W,V,b,c,β)=Swishβ(xW+b)(xV+c)  

 

Bias term을 생략한 FFN과 activation은 아래와 같이 표기 가능하다.

 

FFNGLU(x,W,V,W2)=(σ(xW)xV)W2

FFNBilinear(x,W,V,W2)=(xWxV)W2

FFNReGLU(x,W,V,W2)=(max(0,xW)xV)W2

FFNGEGLU(x,W,V,W2)=(GELU(xW)xV)W2

FFNSwiGLU(x,W,V,W2)=(Swish1(xW)xV)W2

 

3. Experiments with T5

T5 base 220M 짜리 모델을 이용해서 실험했다.

Heldout-set log perplexity를 segment-filling tasks의 측면에서 측정했다.

 

3.2. Pre-training

 

GEGLU와 SwiGLU의 성능이 준수하다. 

 

 

3.3. Fine-tuning

 

 

Bilinear, ReGLU, SwiGLU가 주목할만한 성능을 보여준다.  

 

 

'NLP' 카테고리의 다른 글

Tokenizer 간단하게 정리  (0) 2025.04.15
Longformer (2020) 논문 리뷰  (0) 2025.04.09
MQA (Multi-Query Attention) (2019) 논문 리뷰  (0) 2025.04.09
GPT 2 (2019) 논문 리뷰  (0) 2025.04.09
Sentence-BERT (2019) 논문 리뷰  (0) 2025.04.09