[{"data":1,"prerenderedAt":220},["ShallowReactive",2],{"blog:page:\u002Fen\u002Fblog\u002Ftokenization-is-where-models-learn-your-language":3,"blog:articles:en":97,"blog:articles:en:fallback-inventory":191,"blog:translations:\u002Fen\u002Fblog\u002Ftokenization-is-where-models-learn-your-language":208,"blog:article-locale-inventory:\u002Fen\u002Fblog\u002Ftokenization-is-where-models-learn-your-language":210,"blog:identity-records":217},{"id":4,"title":5,"articleId":6,"author":7,"body":8,"contentType":77,"cover":78,"coverAlt":78,"date":79,"description":80,"extension":81,"featured":82,"level":83,"meta":84,"navigation":85,"path":86,"prerequisites":87,"relatedArticleIds":78,"reviewer":78,"seo":89,"seriesId":90,"seriesOrder":91,"stem":92,"tags":93,"updatedAt":78,"__hash__":96},"blog\u002Fen\u002Fblog\u002F8.tokenization-is-where-models-learn-your-language\u002Findex.md","Tokenization is where models learn your language","tokenization-is-where-models-learn-your-language","John Martin",{"type":9,"value":10,"toc":71},"minimark",[11,14,18,23,26,39,42,46,68],[12,13,5],"h1",{"id":6},[15,16,17],"p",{},"Ask a model to count the letters in \"strawberry\" and it may stumble - not\nbecause counting is hard, but because it never saw the word. It saw tokens.\nThis article builds byte-pair encoding from scratch to show why.",[19,20,22],"h2",{"id":21},"the-compression-idea","The compression idea",[15,24,25],{},"Byte-pair encoding starts from raw bytes and repeatedly merges the most\nfrequent adjacent pair into a new token:",[27,28,29,33,36],"ol",{},[30,31,32],"li",{},"Count every adjacent pair in the corpus.",[30,34,35],{},"Merge the most frequent pair into one symbol.",[30,37,38],{},"Repeat until the vocabulary reaches its target size.",[15,40,41],{},"The result is a vocabulary that is statistically honest about the training\ncorpus - common words become single tokens, rare words decompose into pieces.",[19,43,45],{"id":44},"why-this-matters-downstream","Why this matters downstream",[47,48,49,56,62],"ul",{},[30,50,51,55],{},[52,53,54],"strong",{},"Arithmetic suffers",": numbers split into uneven tokens, so digit\nalignment is lost before the model even starts.",[30,57,58,61],{},[52,59,60],{},"Non-English text pays more",": the same sentence can cost several times\nmore tokens than its English equivalent.",[30,63,64,67],{},[52,65,66],{},"Spelling tasks are unfair",": the model must reconstruct characters it was\nnever shown individually.",[15,69,70],{},"Each of these is a tokenization artifact, not a reasoning failure - and\nknowing the difference changes how you evaluate model behavior.",{"title":72,"searchDepth":73,"depth":73,"links":74},"",2,[75,76],{"id":21,"depth":73,"text":22},{"id":44,"depth":73,"text":45},"theory",null,"2026-10-16","Byte-pair encoding explained by building one - and why tokenization silently shapes what a model can and cannot do.","md",false,"foundational",{},true,"\u002Fen\u002Fblog\u002Ftokenization-is-where-models-learn-your-language",[88],"attention-from-vectors-to-probabilities",{"title":5,"description":80},"llm-foundations","2","en\u002Fblog\u002F8.tokenization-is-where-models-learn-your-language\u002Findex",[94,95],"ai","tokenization","LkhLmKKqXJDsVkmFRR8cgFp06Jg0LGlfznJlAYxY_ZM",[98,102,116,126,140,154,168,179],{"path":86,"stem":92,"title":5,"description":80,"date":79,"author":7,"tags":99,"featured":82,"articleId":6,"seriesId":90,"seriesOrder":73,"contentType":77,"level":83,"prerequisiteIds":100,"relatedArticleIds":101},[94,95],[88],[],{"path":103,"stem":104,"title":105,"description":106,"date":107,"author":7,"tags":108,"featured":82,"cover":110,"articleId":88,"seriesId":90,"seriesOrder":113,"contentType":77,"level":83,"prerequisiteIds":114,"relatedArticleIds":115},"\u002Fen\u002Fblog\u002Fattention-from-vectors-to-probabilities","en\u002Fblog\u002F7.attention-from-vectors-to-probabilities\u002Findex","Attention, from vectors to probabilities","A worked walkthrough of scaled dot-product attention - the one equation every transformer article assumes you already know.","2026-10-14",[94,109],"attention",{"src":111,"alt":112},"\u002Fassets\u002Fcover-url-model.svg","Cover illustration: three matrices meeting at a softmax curve",1,[],[],{"path":117,"stem":118,"title":119,"description":120,"date":121,"author":7,"tags":122,"featured":82,"prerequisiteIds":124,"relatedArticleIds":125},"\u002Fen\u002Fblog\u002Fdemo-content-note","en\u002Fblog\u002F6.demo-content-note\u002Findex","What this blog is (and is not)","This is a demo vertical slice - real layout, real pipelines, deliberately editorial content.","2026-10-07",[123],"meta",[],[],{"path":127,"stem":128,"title":129,"description":130,"date":131,"author":7,"tags":132,"featured":82,"cover":135,"prerequisiteIds":138,"relatedArticleIds":139},"\u002Fen\u002Fblog\u002Freading-first-design","en\u002Fblog\u002F5.reading-first-design\u002Findex","A reading page is not a documentation page","Why the blog article layout deliberately differs from the docs layout - hierarchy, width, and restraint.","2026-09-30",[133,134],"design","typography",{"src":136,"alt":137},"\u002Fassets\u002Fcover-reading-first.svg","Cover illustration: a narrow single-column article layout chosen over a cluttered multi-column layout",[],[],{"path":141,"stem":142,"title":143,"description":144,"date":145,"author":7,"tags":146,"featured":82,"cover":149,"prerequisiteIds":152,"relatedArticleIds":153},"\u002Fen\u002Fblog\u002Fstatic-deployment","en\u002Fblog\u002F4.static-deployment\u002Findex","Deploying a blog as static assets","No Worker script, no database binding - the whole deployment is a directory of files and a 404 page.","2026-09-23",[147,148],"deployment","cloudflare",{"src":150,"alt":151},"\u002Fassets\u002Fcover-static-deployment.svg","Cover illustration: a folder of HTML and SVG files flowing onto a globe of CDN edge nodes",[],[],{"path":155,"stem":156,"title":157,"description":158,"date":159,"author":7,"tags":160,"featured":82,"cover":163,"prerequisiteIds":166,"relatedArticleIds":167},"\u002Fen\u002Fblog\u002Flocale-switching","en\u002Fblog\u002F3.locale-switching\u002Findex","Locale switching that never lies","A language switcher should only offer what exists. Here is how the link list is derived from real content.","2026-09-16",[161,162],"i18n","ux",{"src":164,"alt":165},"\u002Fassets\u002Ftwo-locales-one-page.svg","Cover illustration: two locale paths joining into one shared page layout",[],[],{"path":169,"stem":170,"title":171,"description":172,"date":173,"author":7,"tags":174,"featured":82,"prerequisiteIds":177,"relatedArticleIds":178},"\u002Fen\u002Fblog\u002Fbuild-time-content","en\u002Fblog\u002F2.build-time-content\u002Findex","Content is resolved at build time","Why this blog ships as prerendered files instead of a content API - and what that buys.","2026-09-09",[175,176],"architecture","static-sites",[],[],{"path":180,"stem":181,"title":182,"description":183,"date":184,"author":7,"tags":185,"featured":85,"cover":187,"prerequisiteIds":189,"relatedArticleIds":190},"\u002Fen\u002Fblog\u002Furl-model","en\u002Fblog\u002F1.url-model\u002Findex","One URL model for every public page","How \u002Flocale\u002Fmount\u002Fpath keeps every public page predictable - and why we enforce it instead of hoping for it.","2026-09-02",[175,186],"urls",{"src":111,"alt":188},"Cover illustration: a single address bar splitting into locale, mount and path segments",[],[],[192,194,196,198,200,202,204,206],{"path":86,"stem":92,"title":5,"description":80,"date":79,"author":7,"tags":193,"featured":82,"seriesId":90},[94,95],{"path":103,"stem":104,"title":105,"description":106,"date":107,"author":7,"tags":195,"featured":82,"seriesId":90},[94,109],{"path":117,"stem":118,"title":119,"description":120,"date":121,"author":7,"tags":197,"featured":82},[123],{"path":127,"stem":128,"title":129,"description":130,"date":131,"author":7,"tags":199,"featured":82},[133,134],{"path":141,"stem":142,"title":143,"description":144,"date":145,"author":7,"tags":201,"featured":82},[147,148],{"path":155,"stem":156,"title":157,"description":158,"date":159,"author":7,"tags":203,"featured":82},[161,162],{"path":169,"stem":170,"title":171,"description":172,"date":173,"author":7,"tags":205,"featured":82},[175,176],{"path":180,"stem":181,"title":182,"description":183,"date":184,"author":7,"tags":207,"featured":85},[175,186],[209],"en",[180,169,155,141,127,117,103,86,211,212,213,214,215,216],"\u002Fvi\u002Fblog\u002Furl-model","\u002Fvi\u002Fblog\u002Fbuild-time-content","\u002Fvi\u002Fblog\u002Flocale-switching","\u002Fvi\u002Fblog\u002Fstatic-deployment","\u002Fvi\u002Fblog\u002Freading-first-design","\u002Fvi\u002Fblog\u002Fdemo-content-note",[218,219],{"articleId":88,"locale":209,"path":103,"title":105},{"articleId":6,"locale":209,"path":86,"title":5},1791876184770]