We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result, the pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models for a wide range of tasks, such as question answering and language inference, without substantial task-specific architecture modifications.
BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).
나온지 꽤 됐지만 여전히 사랑받고 있는 BERT의 초기논문이 어떻게 나왔는지 궁금했다. Transformer based model의 양대산맥 중 하나인 BERT가 어떤 구조로 이루어져있고 GPT에 비해 좋은 점은 무엇인지, RoBERTa나 BART, PaLM을 읽기 위한 초석으로도 적절한 논문이라고 생각했다.
더 나은 LLM의 학습 방식을 제안한다. 단방향 모델이 가지는 attention mechanism의 한계를 양방향 transformer 구조로 context의 전체적인 정보를 활용한다.
Decoder 기반의 GPT는 sequential하게 단방향으로 학습하기 때문에 모든 토큰이 이전 토큰과의 attention만 계산해서 문장 수준의 task에선 sub-optimal이 된다고 한다. 전체 문장의 문맥을 더 잘 파악할 수 있고 GPT와 같이 다음 문장도 예측이 가능해지기 때문에 여러 방면에서 GPT에 비해 좋다.
기존에도 ELMo와 같이 양방향 attention 계산 구조는 존재했으나 단순히 단방향(왼쪽, 오른쪽) 두 layer를 concat하는 데에 그쳤다. 하지만 이럼에도 불구하고 SOTA를 세우는 등 많은 성능 향상을 보였다.
또한 다음 문장 후보 순위 메기기, 이전 문장 주어졌을 때 다음 문장의 left-to-right generating, denoising auto-encoder 파생방법 등이 존재했다.
fine tuning 단에서 한계를 보였던 단방향 attention 대신 양방향 attention 구조를 MLM 구조를 활용하여 학습시키고 pair 문장 간 연결여부를 추가 학습시켜 NSP task(ex. QA) 까지 가능하게 만들어 간단하고도 강력한 모델을 만들었다.
MLM과 NSP 두가지 unsupervised task를 활용하여 학습시켰다.
Masked Language Model
Next Sentence Prediction
50%는 문장 A 다음에 실제 다음 문장인 B를(IsNext)
50%는 랜덤 문장 B를 (NotNext)를 고른다.
이를 맞추면서 학습한다.
Data
적은 자원(fine tuning)으로도 수많은 NLP task에 Large LM을 적용시켜 해결할 수 있는 지표를 제시해준 기념비적인 논문이다. 이 이후로 수많은 변형들과 최적화, 경량화 모델들이 나와 지금의 NLP model들이 탄생하게 되었다. deep bidirectional architecture를 처음 제시하고 이를 fine tuning에도 적용시킬 수 있는 방법을 간단하고도 강력히 제시하여 해결한 점이 인상깊었다.
- GPT
- attention is all you need
- ELMo