MosaicBERT: A Bidirectional Encoder Optimized for Fast Pretraining
Meta info.
- Authors: Jacob Portes, Alex Trott et al.
- Paper: https://arxiv.org/pdf/2312.17482.pdf
- Affiliation: MosaicML
- References: Model Weights (HF)
TL; DR
๋น ๋ฅธ ์ฌ์ ํ์ต์ ์ํ BERT-style encoder์ architecture์ training ๊ธฐ๋ฒ ์๊ฐ.




Suggestions
- ๊ธฐ์กด Transformer encoder block์ FlashAttention, ALiBi(Attention with Linear Biases), low precision Layer Norm๋ฅผ ํตํฉ
- ํ์ต์ ๋ํด์๋ 30% masking for MLM, bfloat16 precision, GPU ์ฒ๋ฆฌ๋์ ์ต์ ํ๋ vocab size ์ ์
- ์ ์ํ setting์ ๋ํด์๋ Mosaic BERT๊ฐ base ์ฌ์ด์ฆ์ ๋ํด์๋ pareto ์ต์ ์ด๋ผ๊ณ ์ฃผ์ฅ
Effects
- C4 corpus ํ์ต์ ๊ฐ์ ํ ๋, ์ฝ 20๋ฌ๋ฌ๋ก A100 80GB ์ฅ๋น์์ 1์๊ฐ ์กฐ๊ธ ๋๋ ์๊ฐ ์์ base size ๋ชจ๋ธ๋ก GLUE dev์ 79.6์ ๋ฌ์ฑ ๊ฐ๋ฅ
- 5์๊ฐ 30๋ถ ์ ๋๋ฉด BERT-large์ ํ์ ํ๋ ์์ค
- MNLI, RTE ๋ฑ ์ผ๋ถ task ์์๋ ๋์ผ ์ฌ์ ํ์ต์๊ฐ ๊ธฐ์ค ํญ์ BERT-base๋ฅผ ์๋ํ๊ธฐ๋ ํ๋ค์. (pic 3)
- vocab์ 64์ ๋ฐฐ์๋ก ๋๋ ค๋๊ฐ๋ค๊ณ ํ๋๋ฐ, ์ด๊ฒ CUDA ์ฐ์ฐ์ ํจ์จ์ ์ด๋ผ๊ณ ํฉ๋๋ค. (30,522 to 30,528)
- large size๋ ๊ฐ์ ๊ฒฝํฅ์ ๋๋ค. ์๊ฐ ์ญ์ ๋์ผ ์ฑ๋ฅ ๊ธฐ์ค์ผ๋ก BERT-base๋ณด๋ค ์ ๋ฐ๋ ์ฑ ์๋๋ ์์ค. (pic 4)