[论文解读] ZEN: Pre-training Chinese Text Encoder Enhanced by N-gram Representations
ZEN 提出了一种基于 BERT 的中文文本编码器,通过显式引入 n-gram 表示来提升语义理解能力,从而在预训练过程中融合词和短语级别的信息。通过使用第二个 Transformer 编码器整合 n-gram 编码,并将其与字符级表示进行融合,ZEN 在使用更少数据且无需外部知识的情况下,在多个中文 NLP 任务上实现了最先进(SOTA)的性能表现。
The pre-training of text encoders normally processes text as a sequence of tokens corresponding to small text units, such as word pieces in English and characters in Chinese. It omits information carried by larger text granularity, and thus the encoders cannot easily adapt to certain combinations of characters. This leads to a loss of important semantic information, which is especially problematic for Chinese because the language does not have explicit word boundaries. In this paper, we propose ZEN, a BERT-based Chinese (Z) text encoder Enhanced by N-gram representations, where different combinations of characters are considered during training. As a result, potential word or phase boundaries are explicitly pre-trained and fine-tuned with the character encoder (BERT). Therefore ZEN incorporates the comprehensive information of both the character sequence and words or phrases it contains. Experimental results illustrated the effectiveness of ZEN on a series of Chinese NLP tasks. We show that ZEN, using less resource than other published encoders, can achieve state-of-the-art performance on most tasks. Moreover, it is shown that reasonable performance can be obtained when ZEN is trained on a small corpus, which is important for applying pre-training techniques to scenarios with limited data. The code and pre-trained models of ZEN are available at https://github.com/sinovation/zen.
研究动机与目标
- 为了解决像 BERT 这类字符级编码器在中文中难以捕捉有意义的词和短语边界的问题,因为中文的分词存在歧义性。
- 通过在模型训练过程中显式引入 n-gram 信息,提升中文预训练中的语义表征能力。
- 开发一种方法,在不改变 BERT 的字符级输出格式的前提下增强 BERT,以确保与下游任务的兼容性。
- 通过利用自动学习得到的 n-gram,实现在小规模或有限语料上的有效预训练。
- 为整体词 masking 和弱监督方法提供一种互补的替代方案,以实现子词级别语义的引入。
提出的方法
- ZEN 采用双分支架构:一个标准的基于 BERT 的字符编码器,以及一个使用 Transformer 编码器构建的独立 n-gram 编码器,用于处理提取出的 n-gram。
- n-gram 通过从无监督或基于词典的方法中获得的词典从输入文本中提取,以捕捉有效且频繁的字符组合。
- n-gram 编码器为每个检测到的 n-gram 生成上下文表示,然后将这些表示与 BERT 编码器中对应字符表示进行逐元素相加。
- 模型通过掩码语言建模(MLM)和下一句预测(NSP)目标进行预训练,n-gram 信息在前向传播过程中被整合。
- 在微调阶段,模型继续利用 n-gram 表示,从而在保持字符级输出兼容性的同时实现任务特定的适应。
- 集成机制是可微的,且无需修改 BERT 架构,从而支持端到端训练。
实验结果
研究问题
- RQ1显式引入 n-gram 表示是否能提升字符级预训练模型在中文 NLP 任务中的性能?
- RQ2与整体词 masking 或弱监督方法相比,ZEN 的 n-gram 信息整合方式在性能和数据效率方面表现如何?
- RQ3尽管使用了更高层级的 n-gram 表示,ZEN 是否仍能保持与期望字符级输出的下游任务的兼容性?
- RQ4ZEN 是否能在比依赖更大语料库的现有模型使用更少训练数据的情况下实现 SOTA 结果?
- RQ5在 ZEN 的各层中,n-gram 表示如何演变?它们揭示了语义编码与形态编码之间的何种关系?
主要发现
- ZEN 在多个中文 NLP 基准测试(包括 CLUE 和 CCLUE)上实现了 SOTA 性能,甚至优于在更大语料上训练的模型。
- ZEN 即使在小规模语料上进行预训练,也能取得强劲表现,显示出极高的数据效率,适用于低资源场景。
- 由于显式引入了 n-gram 编码,该模型在需要短语级理解的任务(如文本分类和序列标注)中表现出更强的性能。
- 分析显示,在深层网络中,像 提高速度(speed up) 和 波士顿咨询(Boston consulting group) 这类较长且有效的 n-gram 获得了更高的注意力权重,表明其具有语义编码特性。
- n-gram 表示的整合增强了模型学习有意义文本片段的能力,暗示其在关键短语抽取和短语切分等下游任务中的潜在应用价值。
- 尽管仅依赖于训练数据中自监督学习得到的 n-gram,ZEN 的性能仍与使用外部知识或复杂预处理的模型相当甚至更优。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。