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.
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- MinGram: A Minimalist Unigram Tokenizer with High Compression and Competitive Morphological Alignment (2026)
- Inside the LLM Word Factory (2026)
- BrahmicTokenizer-131K: An Indic-Capable Drop-In Replacement for o200k_base (2026)
- Kronecker Embeddings: Byte-Level Structured Token Representations for Parameter-Efficient Language Models (2026)
- LangMAP: A Language-Adaptive Approach to Tokenization (2026)
- MTEB-BR: A Text Embedding Benchmark for Brazilian Portuguese (2026)
- How Much is Left? LLMs Linearly Encode Their Remaining Output Length (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
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 1
Collections including this paper 0
No Collection including this paper