博主在网上搜BERT的wordPiece时,发现很多文章都说BERT的wordPiece就是BPE(Byte-Pair Encoding), 这个说法其实是不对的,wordPiece和BPE有相似性,但是并不是一回事。
WordPiece是这个:
WordPiece需要在训练集上训练一个语言模型,每次挑选能最大化减少logloss的word unit。
BPE:
BPE是统计词对的频数,每次挑选频数最大的那个作为word unit。所以,wordPiece和BPE可不是一回事儿哦。
最后总结一下,BERT使用的是WordPiece,可以参考文章[1],[2]。GPT使用的是BPE,可以参考文章 [3]。
[1] Google’s neural machine translation system: Bridging the gap between human and machine translation.
[2]Japanese and Korean voice search.
[3]Neural Machine Translation of Rare Words with Subword Units.