Greedy Byte-Pair Encoding under Spelling Ambiguity: Tight Square-Root Bounds, Word-End Markers, and Vocabulary-Cap Semantics

Deployed byte-pair encoding (BPE) trainers identify two merged tokens whenever they spell the same literal string. On uniquely decodable inputs this convention coincides with assigning a fresh symbol to every rule, and recent work establishes the tight replacement-count greedy approximation ratio c_k = (1/2)[1 - (1 - 2/k)^k] -> (1 - e^{-2})/2 ≈ 0.4323. We determine how greedy BPE behaves when unique decodability fails, across both rule-application budgets and vocabulary-size budgets. Under a budget of k rule applications on arbitrarily presegmented inputs, we prove that the worst-case approximation ratio is Θ(k^{-1/2}) for both replacement-count and overlap-count rankings, regardless of tie-breaking and against both partial and full benchmarks, with certified asymptotic leading constants within factors of 10.68 and 9.17; on the same upper-bound family, spelling reuse amplifies the optimum by Θ(√k) over fresh symbols. When each comparison step erases at most J original junction types, the worst-case guarantee satisfies (1 - e^{-3/(δJ)})/3 <= γ_J^{(δ)} <= 1/(δJ) with exact limit lim_{J->∞} J γ_J^{(δ)} = 1/δ; for fixed initial vocabulary size V >= 2, asymptotic optimality recovers with worst-case deficit Θ_V(1/log k) despite non-monotonicity of maximum pair frequencies. For the realistic word-end marker model (single characters plus a fixed literal suffix M with |M| >= 2, including ), combining a laminar common-internal-pair certificate with a lifted full-history simulation yields uniform rule-budget guarantees of 35% (replacement counts) and 23/96 ≈ 23.96% (overlap counts) for all k >= 1. Under a vocabulary-size cap B on irreducible dictionaries, the greedy infimum collapses to 0 at B >= 1 (closure at capacity) and B >= 2 (immediate stopping), whereas at B = 1 with closure we give a single-scan exact algorithm for both full and partial optima and prove a sharp 3/4 relation between them. Finally, we prove that step four is the earliest possible literal collision for in any full-merge history and verify the boundary on unmodified subword-nmt with public TEI XML corpora and a controlled witness.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-26
DOI
https://doi.org/10.5281/zenodo.24560648
Primary Topic
Algorithms and Data Compression
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Greedy Byte-Pair Encoding under Spelling Ambiguity: Tight Square-Root Bounds, Word-End Markers, and Vocabulary-Cap Semantics

Xiaoyu He
Zenodo (CERN European Organization for Nuclear Research)
Algorithms and Data Compression
preprint

Greedy Byte-Pair Encoding under Spelling Ambiguity: Tight Square-Root Bounds, Word-End Markers, and Vocabulary-Cap Semantics

Xiaoyu He
preprint en

Abstract

Deployed byte-pair encoding (BPE) trainers identify two merged tokens whenever they spell the same literal string. On uniquely decodable inputs this convention coincides with assigning a fresh symbol to every rule, and recent work establishes the tight replacement-count greedy approximation ratio c_k = (1/2)[1 - (1 - 2/k)^k] -> (1 - e^{-2})/2 ≈ 0.4323. We determine how greedy BPE behaves when unique decodability fails, across both rule-application budgets and vocabulary-size budgets. Under a budget of k rule applications on arbitrarily presegmented inputs, we prove that the worst-case approximation ratio is Θ(k^{-1/2}) for both replacement-count and overlap-count rankings, regardless of tie-breaking and against both partial and full benchmarks, with certified asymptotic leading constants within factors of 10.68 and 9.17; on the same upper-bound family, spelling reuse amplifies the optimum by Θ(√k) over fresh symbols. When each comparison step erases at most J original junction types, the worst-case guarantee satisfies (1 - e^{-3/(δJ)})/3 <= γ_J^{(δ)} <= 1/(δJ) with exact limit lim_{J->∞} J γ_J^{(δ)} = 1/δ; for fixed initial vocabulary size V >= 2, asymptotic optimality recovers with worst-case deficit Θ_V(1/log k) despite non-monotonicity of maximum pair frequencies. For the realistic word-end marker model (single characters plus a fixed literal suffix M with |M| >= 2, including ), combining a laminar common-internal-pair certificate with a lifted full-history simulation yields uniform rule-budget guarantees of 35% (replacement counts) and 23/96 ≈ 23.96% (overlap counts) for all k >= 1. Under a vocabulary-size cap B on irreducible dictionaries, the greedy infimum collapses to 0 at B >= 1 (closure at capacity) and B >= 2 (immediate stopping), whereas at B = 1 with closure we give a single-scan exact algorithm for both full and partial optima and prove a sharp 3/4 relation between them. Finally, we prove that step four is the earliest possible literal collision for in any full-merge history and verify the boundary on unmodified subword-nmt with public TEI XML corpora and a controlled witness.

Zenodo (CERN European Organization for Nuclear Research)
Chengdu Neusoft University (CN)
Algorithms and Data Compression
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon