BERT, ELMo, GPT-2 모델 비교
ELMo, BERT, GPT-2는 모두 contextualized word representation
을 생성하는 모델입니다. contextualized word representation
은 단어들이 등장하는 문맥에 따라 서로 다른 vector를 갖습니다. 다의어의 경우 의미에 따라 여러 개의 vector를 갖게 되는 것인데요. 이러한 특성은 문맥에 관계없이 단어 당 하나의 vector만을 갖는 static word embedding
과 대조됩니다.
세 모델이 생성하는 word representation의 특성은 동일하지만, 모델 구조 상에는 큰 차이가 있습니다. 세 모델의 차이점을 간단히 비교해 보면 아래와 같습니다.
ELMo | BERT | GPT-2 | |
---|---|---|---|
기본적인 모델 구조 | bidirectional LSTM | Transformer encoder | Transformer decoder |
pre-trained LM | bidirectional LM | Masked LM & Next Sentence Prediction(NSP) | Multitask Learning 방식으로 학습한 LM |
ELMo는 BERT, GPT-2와 달리 LSTM 기반 모델입니다.
Reference
This post is licensed under CC BY 4.0 by the author.