通过随机拆分词元提升大模型对子词结构的理解能力
StochasTok: Improving Fine-Grained Subword Understanding in LLMs
- 训练时随机拆分词元,让模型学习内部结构
- 在字母计数、子串识别等任务上显著提效
- 无需重训即可增强已有模型的细粒度理解
子词级理解对多项任务至关重要,如多数字识别、拼写纠错、缩写解析、押韵和文字游戏。然而当前大语言模型在简单子词任务(如‘strawberry中有几个r’)上仍表现不佳。主要原因是分词过程掩盖了词语的精细结构。现有替代方案如字符级或丢弃分词法显著增加计算开销且效果不稳。本文提出StochasTok,一种简单高效的随机分词策略,在训练中随机拆分词元,使模型能‘看见’其内部结构。实验表明,使用StochasTok预训练可显著提升模型在字符计数、子串识别和数学任务等子词级语言游戏中的下游性能。该方法简单易集成,可在任意训练阶段应用;我们还证明后训练阶段使用StochasTok即可为已有预训练模型注入更强的子词理解能力,避免从头预训练。这种微小改动带来显著提升,暗示其在更大更强大模型中具有巨大潜力。代码已开源:github.com/anyasims/stochastok。
原文摘要 · Abstract (English)
Subword-level understanding is integral to numerous tasks, including understanding multi-digit numbers, spelling mistakes, abbreviations, rhyming, and wordplay. Despite this, current large language models (LLMs) still struggle disproportionally with simple subword-level tasks like 'How many r's in strawberry?'. A key factor behind these failures is tokenization, which obscures the fine-grained structure of words. Current alternatives, such as character-level and dropout tokenization methods, significantly increase computational costs and provide inconsistent improvements. In this paper we revisit tokenization and introduce StochasTok, a simple, efficient stochastic tokenization scheme that randomly splits tokens during training, allowing LLMs to 'see' their internal structure. Our experiments show that pretraining with StochasTok substantially improves LLMs' downstream performance across multiple subword-level language games, including character counting, substring identification, and math tasks. Furthermore, StochasTok's simplicity allows seamless integration at any stage of the training pipeline; and we demonstrate that post-training with StochasTok can instill improved subword understanding into existing pretrained models, thus avoiding costly pretraining from scratch. These dramatic improvements achieved with a minimal change suggest StochasTok holds exciting potential when applied to larger, more capable models. Code open-sourced at: github.com/anyasims/stochastok.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。