ChatPaper.aiChatPaper

Waar te knippen, hoe diep: BPE en Unigram-LM op chemische SMILES

Where to cut, how deep: BPE and Unigram-LM on chemistry SMILES

July 6, 2026
Auteurs: Hunter Heidenreich
cs.AI

Samenvatting

Elk chemisch taalmodel dat SMILES leest, begint met een tokenizer, maar het vakgebied heeft bytepaar-encodering (BPE) uit de natuurlijke taal overgenomen met weinig kritische beschouwing. In natuurlijke taal staat het belangrijkste alternatief voor BPE, Unigram-LM, bekend om structureel verschillende vocabulaires te bouwen. Of dat contrast ook in de chemie standhoudt, was onbekend. Wij rapporteren een gecontroleerde vergelijking van BPE en Unigram-LM over een vaste basis van 165 chemische tokens, bij de kleine vocabulairegroottes waar tokenembeddings leerbaar zijn, over drie corpus typologieën (divers, geneesmiddelachtig, natuurproducten) en beide pre-tokenisatie-grensregels. De twee convergeren niet. In alle 22 overeenkomstige omstandigheden bouwen ze bijna disjuncte subwoordvocabulaires: de Jaccard-overlap tussen de algoritmen op de geleerde stukken overschrijdt nooit 0,161, en maximaal 0,05 wanneer gewogen naar de hoogfrequente stukken die een model het meest bijwerkt. Unigram-LM segmenteert ook achtergehouden moleculen in 29–41% meer tokens; beide methoden zijn het grotendeels eens over waar te snijden, maar niet over hoe diep, dus BPE's segmentatie is een strikte verruwing van die van Unigram-LM bij 80–99% van de moleculen. De scheiding houdt stand over corpus, grens en vocabulairegrootte, en blijft zelfs bestaan bij acht keer die schaal. Het subwoordalgoritme is daarom een modelleerbeslissing, geen vrijblijvende standaard. De studie traint geen taalmodellen.
English
Every chemical language model reading SMILES begins with a tokenizer, yet the field has inherited byte-pair encoding (BPE) from natural language with little scrutiny. In natural language, BPE's principal alternative, Unigram-LM, is known to build structurally different vocabularies. Whether that contrast survives in chemistry was open. We report a controlled comparison of BPE and Unigram-LM over a fixed 165-token chemistry base, at the small vocabulary sizes where token embeddings are learnable, across three corpus typologies (diverse, drug-like, natural-products) and both pre-tokenization boundary policies. The two do not converge. In all 22 matched conditions they build near-disjoint subword vocabularies: cross-algorithm Jaccard overlap on the learned pieces never exceeds 0.161, and at most 0.05 once weighted toward the high-frequency pieces a model updates most. Unigram-LM also segments held-out molecules into 29-41% more tokens; the arms largely agree on where to cut but not how deeply, so BPE's segmentation is a strict coarsening of Unigram-LM's on 80-99% of molecules. The separation holds across corpus, boundary, and vocabulary size, persisting even at eight times that scale. The subword algorithm is therefore a modeling decision, not a free default. The study trains no language models.