用字符和词语分层处理,让语言模型更鲁棒、易适应新领域。
Hierarchical Autoregressive Transformers: Combining Byte- and Word-Level Processing for Robust, Adaptable Language Models
- 字符级编码器生成词嵌入,再由词级模型处理,避免固定词表
- 70亿参数下性能媲美子词模型,对拼写错误更鲁棒
- 跨语言持续预训练速度翻倍,知识保留更好,适合多语言场景
分词是自然语言处理的基础步骤,将文本拆分为模型可处理的单元。尽管学习型子词分词器已成为标准,但仍存在词表过大、难以适应新领域或语言、对拼写错误敏感等问题。为此,我们提出一种分层自回归架构,结合字符级与词级处理:轻量字符编码器将字符序列转换为词嵌入,由词级主干模型处理,并通过紧凑字符解码器还原为字符。该方法在不依赖固定词表的前提下,保留了词级分词的序列压缩优势。我们在高达70亿参数规模上验证,分层变压器在下游任务表现上达到子词模型水平,且对输入扰动更具鲁棒性。此外,在跨域语言持续预训练中,其训练速度接近两倍提升,目标语言性能更优,且保留更多已有知识。分层变压器为更鲁棒、灵活、泛化的多语言与多领域NLP系统开辟了道路。
原文摘要 · Abstract (English)
Tokenization is a fundamental step in natural language processing, breaking text into units that computational models can process. While learned subword tokenizers have become the de-facto standard, they present challenges such as large vocabularies, limited adaptability to new domains or languages, and sensitivity to spelling errors and variations. To overcome these limitations, we investigate a hierarchical architecture for autoregressive language modelling that combines character-level and word-level processing. It employs a lightweight character-level encoder to convert character sequences into word embeddings, which are then processed by a word-level backbone model and decoded back into characters via a compact character-level decoder. This method retains the sequence compression benefits of word-level tokenization without relying on a rigid, predefined vocabulary. We demonstrate, at scales up to 7 billion parameters, that hierarchical transformers match the downstream task performance of subword-tokenizer-based models while exhibiting significantly greater robustness to input perturbations. Additionally, during continued pretraining on an out-of-domain language, our model trains almost twice as fast, achieves superior performance on the target language, and retains more of its previously learned knowledge. Hierarchical transformers pave the way for NLP systems that are more robust, flexible, and generalizable across languages and domains.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。