[论文解读] Charformer: Fast Character Transformers via Gradient-based Subword Tokenization
Charformer 引入基于梯度的子词分词(GBST)模块,从字节中学习潜在子词表示并将其集成到 Transformer,达到与字节级和子词基线相比具更快速度的有竞争力表现。
State-of-the-art models in natural language processing rely on separate rigid subword tokenization algorithms, which limit their generalization ability and adaptation to new settings. In this paper, we propose a new model inductive bias that learns a subword tokenization end-to-end as part of the model. To this end, we introduce a soft gradient-based subword tokenization module (GBST) that automatically learns latent subword representations from characters in a data-driven fashion. Concretely, GBST enumerates candidate subword blocks and learns to score them in a position-wise fashion using a block scoring network. We additionally introduce Charformer, a deep Transformer model that integrates GBST and operates on the byte level. Via extensive experiments on English GLUE, multilingual, and noisy text datasets, we show that Charformer outperforms a series of competitive byte-level baselines while generally performing on par and sometimes outperforming subword-based models. Additionally, Charformer is fast, improving the speed of both vanilla byte-level and subword-level Transformers by 28%-100% while maintaining competitive quality. We believe this work paves the way for highly performant token-free models that are trained completely end-to-end.
研究动机与目标
- 将分词作为一个可学习的端到端组件而非固定的预处理步骤来激励研究。
- 通过 GBST 在字符级建模的灵活性与子词效率之间取得平衡。
- 开发 Charformer,使其在字节级输入下也能保持具有竞争力的下游性能。
- 展示相对于现有字节级和子词模型的速度和内存效率优势。
- 通过可视化学到的潜在子词,提供可解释的洞见。
提出的方法
- 提出梯度基子词分词(GBST),枚举最多大小为 M 的候选块并学习一个块评分网络,在每个位置为每个块分配概率。
- 通过对候选块的软加权和来形成潜在子词表示,使子词切分的端到端可微学习成为可能。
- 用固定池化操作对潜在子词序列进行降采样以减小进入 Transformer 堆栈的序列长度。
- 使用在降采样潜在子词上工作的 Transformer 编码器-解码器,并引入可扩展变体(SBase),为编码器分配更多容量。
- 采用类似 T5 的跨域掩蔽预训练方案进行训练,适应字节级设置。
- 探索架构变体(如 GBST 之前的卷积、块分数校准、降采样率等)以评估效率和性能。
实验结果
研究问题
- RQ1GBST 是否能直接从字符/字节序列中学习出有意义的潜在子词表示?
- RQ2与基于子词的模型及其他无标记化模型相比,Charformer 在单语与多语言任务上的表现如何?
- RQ3相较于现有基线,Charformer 在速度、内存与参数效率方面有哪些优势?
- RQ4对 Transformer 编码器进行重新缩放(SBase)是否对字符/字节级模型有利?
- RQ5学习到的潜在子词是否具可解释性,对噪声文本是否鲁棒?
主要发现
- Charformer 在相同参数量下的英语 GLUE 任务和长文档分类中超过强大的字符级基线。
- Charformer 在多个基准上达到或超过基于子词的模型(如 BERT、T5),SBase 变体通常表现最好。
- Charformer 在速度和内存方面比同类字节级和基于子词的模型更快、资源消耗更低,例如字节级 T5 及其变体,且训练/推理成本呈现有利的缩放。
- SBase 配置在编码器更深、参数占比更小的情况下可优于未缩放的基线,并且在某些设置中使用约 40–50% 的参数并实现 2x–10x 的速度提升。
- 在多语言设置中,Charformer SBase 与子词基线及 LongPT 变体竞争力强,具备良好的语言内和翻译训练性能;对无标记化模型的零-shot 跨语言迁移仍具有挑战性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。