<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tokenization on davethehuman.com</title><link>https://davethehuman.com/tags/tokenization/</link><description>Recent content in Tokenization on davethehuman.com</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Dave the human</copyright><lastBuildDate>Sat, 30 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://davethehuman.com/tags/tokenization/index.xml" rel="self" type="application/rss+xml"/><item><title>BPE</title><link>https://davethehuman.com/notes/bpe/</link><pubDate>Sat, 30 May 2026 00:00:00 +0000</pubDate><guid>https://davethehuman.com/notes/bpe/</guid><description>&lt;p&gt;&lt;em&gt;BPE&lt;/em&gt; stands for &lt;em&gt;Byte Pair Encoding&lt;/em&gt;, a method to split into &lt;a href="https://davethehuman.com/notes/token/"&gt;token&lt;/a&gt;s that can represent both common and rare words using a mix of full words and sub-words units. Spaces are also included in tokens, and this helps &lt;a href="https://davethehuman.com/notes/llm/"&gt;LLM&lt;/a&gt; detect word boundaries.&lt;/p&gt;
&lt;p&gt;Using a BPE &lt;a href="https://davethehuman.com/notes/tokenizer/"&gt;tokenizer&lt;/a&gt;, the correct &lt;a href="https://davethehuman.com/notes/encoding/"&gt;encoding&lt;/a&gt; and &lt;a href="https://davethehuman.com/notes/decoding/"&gt;decoding&lt;/a&gt; of unknown out-of-&lt;a href="https://davethehuman.com/notes/vocabulary/"&gt;vocabulary&lt;/a&gt; words is possible without an explicit &lt;code&gt;&amp;lt;|unk|&amp;gt;&lt;/code&gt; token.&lt;/p&gt;
&lt;p&gt;In short, &lt;em&gt;BPE&lt;/em&gt; builds its vocabulary by iteratively merging frequent characters into subwords and frequent subwords into words.
For example, it starts with adding single characters to the vocabulary (&lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, etc.), then at the following stage it merges the most frequent characters combinations into subwords (e.g. &lt;code&gt;d&lt;/code&gt; and &lt;code&gt;e&lt;/code&gt; may be merged into &lt;code&gt;de&lt;/code&gt;), dependent from a frequency cutoff.&lt;/p&gt;</description></item></channel></rss>