[论文解读] AMBERT: A Pre-trained Language Model with Multi-Grained Tokenization
AMBERT 提出了一种多粒度 BERT 模型,通过共享参数编码器联合学习细粒度(词/子词)和粗粒度(短语/词)标记的上下文表示。在中文 CLUE 基准上,其平均性能优于 BERT 2.7%,在多个英文基准上提升超过 3.0%,且通过仅使用一个编码器的高效推理变体实现。
Pre-trained language models such as BERT have exhibited remarkable performances in many tasks in natural language understanding (NLU). The tokens in the models are usually fine-grained in the sense that for languages like English they are words or sub-words and for languages like Chinese they are characters. In English, for example, there are multi-word expressions which form natural lexical units and thus the use of coarse-grained tokenization also appears to be reasonable. In fact, both fine-grained and coarse-grained tokenizations have advantages and disadvantages for learning of pre-trained language models. In this paper, we propose a novel pre-trained language model, referred to as AMBERT (A Multi-grained BERT), on the basis of both fine-grained and coarse-grained tokenizations. For English, AMBERT takes both the sequence of words (fine-grained tokens) and the sequence of phrases (coarse-grained tokens) as input after tokenization, employs one encoder for processing the sequence of words and the other encoder for processing the sequence of the phrases, utilizes shared parameters between the two encoders, and finally creates a sequence of contextualized representations of the words and a sequence of contextualized representations of the phrases. Experiments have been conducted on benchmark datasets for Chinese and English, including CLUE, GLUE, SQuAD and RACE. The results show that AMBERT can outperform BERT in all cases, particularly the improvements are significant for Chinese. We also develop a method to improve the efficiency of AMBERT in inference, which still performs better than BERT with the same computational cost as BERT.
研究动机与目标
- 为解决预训练语言模型中单粒度分词的局限性,通过结合细粒度和粗粒度表示来改进模型。
- 探究联合学习词级和短语级表示是否能提升 NLU 任务中的模型性能。
- 通过选择性使用编码器,在保持性能的同时降低推理阶段的计算成本。
- 分析为何多粒度建模在中文中带来的提升大于英文,原因在于不同的分词比例。
提出的方法
- AMBERT 使用两个并行编码器:一个用于细粒度标记(英文中的词/子词,中文中的字符),另一个用于粗粒度标记(英文中的短语,中文中的词)。
- 两个编码器共享参数,最大限度减少额外参数数量,同时实现多粒度表示的联合学习。
- 输入文本在两个层级上进行分词:英文中为词级和短语级(使用短语分词器),中文中为字符级和词级。
- 在每个位置生成词级和短语级标记的上下文表示,增强语义丰富性。
- 提出一种推理优化方法,根据开发集上的表现选择仅使用一个编码器(细粒度或粗粒度)。
- 预训练期间使用掩码语言建模(MLM),并通过编码器间共享注意力机制对齐表示。
实验结果
研究问题
- RQ1能否通过在多个粒度上联合学习表示来提升预训练语言模型的性能?
- RQ2为何多粒度建模在中文中带来的提升大于英文?
- RQ3细粒度与粗粒度编码器之间的参数共享如何影响表示对齐与模型性能?
- RQ4能否设计一种高效推理模式,在计算成本减半的同时保持高性能?
- RQ5与单粒度模型相比,多粒度表示中的注意力模式有何影响?
主要发现
- 在英文基准中,AMBERT 在 GLUE 上优于 BERT 2.0%,在 RACE 上优于 2.5%,在 SQuAD 上优于 5.1%。
- 在中文中,AMBERT 在 CLUE 基准上的平均得分相比 Google BERT 提升超过 2.7%。
- AMBERT 与 AMBERT-Combo 之间的性能差距归因于参数共享,该机制实现了跨粒度表示的对齐。
- 在推理阶段仅使用一个编码器时,AMBERT 仍保持强性能,且在相同计算成本下优于单粒度 BERT 模型。
- AMBERT 中的注意力模式保留了同层级内部注意力(如词与词之间或短语与短语之间),而 AMBERT-Hybrid 则削弱了细粒度注意力。
- 中文中取得更大提升的原因在于粗粒度标记比例更高(51.5%),而英文中仅为 13.1%,使得多粒度学习更具影响力。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。