发现大模型隐含分词对称性,可用来探测模型理解力并生成新解法。
Emergent retokenization symmetry in large language models: phenomenology and applications

- 用等效字节替换原始分词,保持语义不变地测试模型敏感度。
- 模型在训练中部分恢复分词对称性,能识别不同分词方式下的相同语义。
- 该方法可作为推理时的新采样策略,突破传统温度采样的局限。
分词引入表示冗余:固定词汇表下,每个字节串有多种合法分词方式,解码后仍为同一表面字符串。然而,大多数语言模型分词器会返回唯一标准分词。仅在标准分词上训练应影响推理行为,预期模型不会在下游任务中保持分词对称性。我们发现这种对称性在训练过程中部分涌现。通过实验探究其在组合理解、表示多样性及任务基准上的表现,主要使用 extbf{重分词}——将提示的标准分词替换为另一种等效分词,精确保留字节内容。相比其他扰动,重分词更干净,能隔离分词影响而不改变语法、语义或表面形式。我们用它研究预训练和微调后对语义等价输入表示的敏感性和鲁棒性。此外,这一部分对称性暗示了一种新的推理采样轴:温度采样基于下一个词的概率分布生成多样性输出,而重分词则通过语义等价的输入表示激发模型内部计算的多样性。我们发现,尽管在简单问题上可能降低性能,但重分词可找回传统采样无法发现的解法。总体而言,重分词是一种简单却有力的探针,揭示模型的组合理解与提示敏感性,并提供一种新颖的采样策略。
原文摘要 · Abstract (English)
Tokenization introduces representational redundancy: under a fixed token vocabulary, every byte string admits many valid token encodings, or segmentations, that decode to the same surface string. However, given a prompt, most language model tokenizers break this representational symmetry by returning a canonical segmentation. Training only on canonical segmentations should influence inference behavior, and there is little reason to expect models to respect segmentation symmetry on downstream tasks. We find that this symmetry partially emerges during training. Here, we probe this emergent symmetry through experiments testing token compositional understanding, representation diversity, and task focused benchmark performance. We primarily use \textbf{retokenization} -- replacing a prompt's canonical tokenization with an alternative segmentation while preserving its bytes exactly. Relative to other prompt perturbations, retokenization is unusually clean because it isolates segmentation effects without changing syntax, semantics or surface form. We use retokenization to study sensitivity and robustness to semantically identical input representations across pretraining and post-training. Moreover, this partial retokenization symmetry suggests a distinct inference-time sampling axis. While temperature sampling generates diverse outputs from the model using its next-token probability distribution, retokenization generates diversity from the model's internal computations through semantically equivalent input representations. We find that while this retokenization sampling strategy can hurt performance on easy problems, it can also recover solutions that conventional sampling does not find. Overall, our work presents retokenization as a simple yet powerful probe of large language models, shedding light on compositional understanding and prompt sensitivity, and offering a novel sampling strategy.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。