arXiv cs.CL· Kundan Baliga, Aiden Xie, Aditya Byju·· 10 小时前AI 评分18
二元串上配对合并分词难以近似,一元数据集上强 NP 难
Pair-Merge Tokenisation Is Hard to Approximate on Binary Strings and Strongly NP-Hard on Unary Datasets
AI 导读
研究证明,除非 P = NP,否则不存在多项式时间算法能在 c·n/log n 因子内近似选择 k 次 BPE 式合并(对单个二元串即成立),核心思路是把顶点覆盖间隙转化为语法规模间隙。
正文 · 原文
Abstract:Tokenisers such as Byte-Pair Encoding (BPE) shorten text by repeatedly merging an adjacent pair of symbols into a new one; fewer tokens mean less computation. We ask whether an efficient algorithm can choose $k$ merges that leave a string of length $n$ almost as short as possible; doing nothing is already within a factor $n$. We prove that, unless P = NP, no polynomial-time algorithm comes within a factor $c\,n/\log n$, for some constant $c>0$, already for one binary string and for BPE-style merges that replace every occurrence. The key idea is that $k$ merges form a grammar with $k$ rules: a vertex-cover gap becomes a grammar-size gap, which we amplify with relabelled copies, encode in binary and realise with explicit merges. For merges that may skip occurrences, a simple algorithm achieves $O(n/\log\log n)$, and no Karp reduction can prove hardness beyond order $n/\log n$ unless coNP $\subseteq$ NP/poly. Over a one-letter alphabet, both tokenisation problems left open by Kastreva et al. are strongly NP-complete on datasets with repeated strings.
| Comments: | 34 pages, 11 figures. Code and certificates: this https URL |
| Subjects: | Data Structures and Algorithms (cs.DS); Computational Complexity (cs.CC); Computation and Language (cs.CL) |
| MSC classes: | 68Q17, 68Q25, 68W25, 68T50 |
| ACM classes: | F.2.2; F.1.3; I.2.7 |
| Cite as: | arXiv:2611.13568 [cs.DS] |
| (or arXiv:2611.13568v1 [cs.DS] for this version) | |
| https://doi.org/10.48550/arXiv.2611.13568 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Aditya Byju [view email]
[v1]
Tue, 10 Nov 2026 04:37:23 UTC (72 KB)
来源:arXiv cs.CL · arxiv.org