どこで切るか、どの深さか:化学SMILESにおけるBPEとUnigram-LM
Where to cut, how deep: BPE and Unigram-LM on chemistry SMILES
July 6, 2026
著者: Hunter Heidenreich
cs.AI
要旨
SMILESを読み取る化学言語モデルはすべてトークナイザから始まるが、この分野は自然言語処理からバイトペアエンコーディング(BPE)をほとんど検証せずに継承してきた。自然言語において、BPEの主要な代替手法であるUnigram-LMは、構造的に異なる語彙を構築することが知られている。その対照性が化学の分野でも維持されるかどうかは未解決の問題であった。我々は、固定された165トークンの化学ベース上で、トークン埋め込みが学習可能な小さな語彙サイズにおいて、3種類のコーパス(多様性、薬物様、天然物)と両方の事前トークン化境界ポリシーにわたって、BPEとUnigram-LMの制御比較を行った。両者は収束しない。22のすべての一致条件において、ほぼ互いに素なサブワード語彙を構築する:学習された断片間のアルゴリズム間Jaccard重複率は0.161を超えることはなく、モデルが最も更新する高頻度断片に重み付けした場合でも最大0.05であった。Unigram-LMはまた、保持された分子を29~41%多くのトークンに分割する;両手法はどこで切断するかについてはほぼ一致するが、どの程度深く切断するかは異なり、その結果、BPEのセグメンテーションは分子の80~99%においてUnigram-LMの厳密な粗視化となっている。この乖離はコーパス、境界、語彙サイズに関わらず維持され、その8倍の規模でも持続する。したがって、サブワードアルゴリズムはモデリング上の決定であり、自由なデフォルトではない。本研究では言語モデルは学習していない。
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.