Where to cut, how deep: BPE and Unigram-LM on chemistry SMILES
Abstract
Byte-pair encoding and Unigram-LM create distinctly different subword vocabularies in chemical language models, with no convergence between the two approaches across diverse corpus types and vocabulary sizes.
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.
Community
Holding corpus, glyph base, and vocab size fixed, I found that BPE and Unigram-LM build near-disjoint multi-glyph vocabularies over SMILES (same atoms, almost none of the same subword pieces) so the tokenizer choice quietly determines what your chemical LM can even represent, before any training happens. No LMs are trained here; every result is a controlled property of the tokenizers and corpora, with tokenizers + measurement data deposited on Zenodo. Curious whether people have seen this disjointness bite downstream, and which arm's pieces feel more "chemically right" to you.
Get this paper in your agent:
hf papers read 2607.05691 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper