<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NLP on Rooted &amp; Rising</title><link>https://tonlp.fun/tags/nlp/</link><description>Recent content from Rooted &amp; Rising</description><generator>Hugo</generator><language>zh-cn</language><managingEditor>whq2020@outlook.com (HuanQ)</managingEditor><webMaster>whq2020@outlook.com (HuanQ)</webMaster><copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright><lastBuildDate>Mon, 26 Jan 2026 20:50:39 +0800</lastBuildDate><atom:link href="https://tonlp.fun/tags/nlp/index.xml" rel="self" type="application/rss+xml"/><item><title>BPE 与字节级 Tokenizer：从合并规则到可运行实现</title><link>https://tonlp.fun/post/bpe/</link><pubDate>Mon, 26 Jan 2026 20:50:39 +0800</pubDate><author>whq2020@outlook.com (HuanQ)</author><guid>https://tonlp.fun/post/bpe/</guid><description>
<![CDATA[<h1>BPE 与字节级 Tokenizer：从合并规则到可运行实现</h1><p>作者：HuanQ（whq2020@outlook.com）</p>
        
          系统梳理 BPE 的训练与推理：为什么需要正则预分词与前导空格、为什么主流实现选择字节级词表、Byte Fallback 的含义，以及 merges/rank 在推理时如何生效；文末提供一份可直接运行的 Python 参考实现。
        
        <hr><p>本文2026-01-26首发于<a href='https://tonlp.fun/'>Rooted & Rising</a>，最后修改于2026-01-26</p>]]></description><category>深度学习</category><category>LLM</category></item></channel></rss>