어디서 자르고, 얼마나 깊이 자를까: 화학 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개 토큰 화학 기반 위에서, 토큰 임베딩이 학습 가능한 작은 어휘 크기 조건에서, 세 가지 코퍼스 유형(다양성, 약물 유사, 천연물)과 두 가지 사전 토큰화 경계 정책에 걸쳐 BPE와 Unigram-LM의 통제된 비교를 보고한다. 두 가지는 수렴하지 않는다. 22개의 모든 일치 조건에서 두 알고리즘은 거의 서로소인 하위 단어 어휘를 구축한다: 학습된 조각에 대한 알고리즘 간 자카드 중복도는 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.