BERT profiling: normalization eats 88% of tokenization time
Simon Brandeis' Hugging Face article shows that in bert-base-uncased, text normalization consumes 88% of a warm encoding pass while WordPiece takes just 8%. The proposed optimization speeds up BERT encoding up to 5.7x, roughly 50x total over tokenizers 0.23.
- Normalization is 88% of encoding time, WordPiece only 8%
- A 1,567-character table lookup for accent removal is a bottleneck
- Vector check of 16 ASCII bytes speeds up processing
- Total speedup about 50x over tokenizers 0.23
Read next
Science