Language models (LMs) have been instrumental for the rapid advance of natural language processing. This paper studies continual pre-training of LMs, in particular, continual domain-adaptive pre-training (or continual DAP-training). Existing research has shown that further pre-training an LM using a domain corpus to adapt the LM to the domain can improve the end-task performance in the domain. This paper proposes a novel method to continually DAP-train an LM with a sequence of unlabeled domain corpora to adapt the LM to these domains to improve their end-task performances. The key novelty of our method is a soft-masking mechanism that directly controls the update to the LM. A novel proxy is also proposed to preserve the general knowledge in the original LM. Additionally, it contrasts the representations of the previously learned domain knowledge (including the general knowledge in the pre-trained LM) and the knowledge from the current full network to achieve knowledge integration. The method not only overcomes catastrophic forgetting, but also achieves knowledge transfer to improve end-task performances. Empirical evaluation demonstrates the effectiveness of the proposed method.
翻译:语言模型(LM)已经成为自然语言处理快速发展的关键因素。本文研究持续预训练LM,特别是持续领域适应性预训练(或持续DAP预训练)。现有研究表明,使用领域语料库进一步预训练LM以适应该领域可以提高该领域的最终任务性能。本文提出了一种新方法,可以使用一系列未标记的领域语料库来持续DAP训练LM,以适应这些领域以提高它们的最终任务性能。我们方法的关键创新点是一种软屏蔽机制,可以直接控制LM的更新。还提出了一种新的代理,以保留原始LM中的通用知识。此外,它对比了先前学习的领域知识(包括预先训练的LM中的通用知识)和来自当前完整网络的知识,以实现知识整合。该方法不仅克服了灾难性遗忘,还实现了知识传递,以提高最终任务性能。实证评估证明了该方法的有效性。