“Plus the original paper has a very readable Python example [3].”
Neural Machine Translation of Rare Words with Subword Units
把 BPE 引入 NMT,用子词单元处理稀有词和未登录词
神经机器翻译模型通常使用固定词表,而翻译是开放词表问题。以往通过回退到词典来处理未登录词,论文提出更简单也更有效的做法:把稀有词和未知词编码为子词单元序列,使 NMT 模型具备开放词表翻译能力。其直觉是各类词可以经由比词更小的单元翻译,如专名、复合词、同源词和借词。作者讨论了字符 n-gram 和基于字节对编码(BPE)压缩算法的切分方法,在 WMT 15 的英德、英俄翻译任务上,子词模型相对回退词典基线分别提升 1.1 和 1.3 BLEU。
HN 上的人在讨论 LLM 分词器时把它当作 BPE 子词 token 的原始出处,称其有可读的 Python 示例,也提醒子词 token 从 2015 年起就已在使用。
学习路径
读这篇之前,按顺序读书架上的 2 篇 · 参考文献来自 OpenAlex,顺序和要点由 Claude Code 排出先了解序列到序列的编码器-解码器模型,再看 BPE 子词如何解决其固定词表的稀有词问题。
- 1
它提出 RNN 编码器-解码器用于翻译,是目标论文所用 NMT 模型的来源之一。
读编码器-解码器的结构和固定长度的向量表示。
- 2
它用深层 LSTM 做端到端翻译,并指出固定词表导致的未登录词问题。
读模型结构与词表大小的限制,理解未登录词怎样损害翻译质量。
- 3Neural Machine Translation of Rare Words with Subword Units
在固定词表的 NMT 背景下,看用 BPE 子词单元实现开放词表翻译。
读BPE 合并算法的步骤、与字符级和词级的对比,以及稀有词翻译的实验。
HN 书评
推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及“The BPE paper is a good place to start[0], but it is far from the place we are now.”
“You can also speed up the loading of embeddings by using BPE (byte pair encoding) to segment words into a smaller dictionary of char ngrams, and learning ngram embeddings instead of words.”
“Btw, tokens are nothing new in modern models. They've been used since 2015/2016 [0]”
“See the BPE paper: Neural Machine Translation of Rare Words with Subword Units”