Skip to main content
QUICK REVIEW

[论文解读] Mixture-of-Domain-Adapters: Decoupling and Injecting Domain Knowledge to Pre-trained Language Models Memories

Shizhe Diao, Tianyang Xu|arXiv (Cornell University)|Jun 8, 2023
Topic ModelingComputer Science被引用 3
一句话总结

本文提出Mixture-of-Domain-Adapters(MixDA),一种参数高效的参数化方法,将预训练语言模型(PLM)的前馈网络解耦为冻结的旧领域知识与可训练的领域特定适配器。通过在微调过程中使用门控机制动态选择多个领域适配器中的知识,MixDA在领域内、领域外及知识密集型任务中均实现了最先进性能,且参数更新极少,展现出高度的可靠性、可扩展性与效率。

ABSTRACT

Pre-trained language models (PLMs) demonstrate excellent abilities to understand texts in the generic domain while struggling in a specific domain. Although continued pre-training on a large domain-specific corpus is effective, it is costly to tune all the parameters on the domain. In this paper, we investigate whether we can adapt PLMs both effectively and efficiently by only tuning a few parameters. Specifically, we decouple the feed-forward networks (FFNs) of the Transformer architecture into two parts: the original pre-trained FFNs to maintain the old-domain knowledge and our novel domain-specific adapters to inject domain-specific knowledge in parallel. Then we adopt a mixture-of-adapters gate to fuse the knowledge from different domain adapters dynamically. Our proposed Mixture-of-Domain-Adapters (MixDA) employs a two-stage adapter-tuning strategy that leverages both unlabeled data and labeled data to help the domain adaptation: i) domain-specific adapter on unlabeled data; followed by ii) the task-specific adapter on labeled data. MixDA can be seamlessly plugged into the pretraining-finetuning paradigm and our experiments demonstrate that MixDA achieves superior performance on in-domain tasks (GLUE), out-of-domain tasks (ChemProt, RCT, IMDB, Amazon), and knowledge-intensive tasks (KILT). Further analyses demonstrate the reliability, scalability, and efficiency of our method. The code is available at https://github.com/Amano-Aki/Mixture-of-Domain-Adapters.

研究动机与目标

  • 为解决在不造成灾难性遗忘的前提下,高效注入领域特定知识到预训练语言模型中的挑战。
  • 在保留预训练通用领域知识的同时,实现有效的领域自适应。
  • 开发一种可扩展、参数高效的模块化适配器设计方法,支持多领域与多任务。
  • 探究将知识注入与模型微调解耦是否能提升在多样化NLP任务中的性能与鲁棒性。

提出的方法

  • 将PLM的前馈网络(FFN)分解为两部分:用于旧领域知识的冻结预训练FFN,以及用于新领域知识的可训练领域特定适配器。
  • 引入两阶段训练策略:第一阶段,在无标签的领域特定语料和预训练语料上训练领域适配器;第二阶段,在有标签数据上训练门控机制(MoA)与任务特定适配器。
  • 采用MoA门控机制,根据输入上下文动态选择最相关的领域适配器,实现领域知识的动态融合。
  • 对领域与任务适配均采用Pfeiffer风格适配器,确保参数效率,并与现有PLM微调流程完全兼容。
  • 通过在推理时通过MoA门控组合独立训练的领域适配器,实现可扩展性,支持不同领域适配器的独立训练。
  • 在第一阶段将结构化知识(如ConceptNet)整合到领域适配器中,以提升知识密集型任务的性能。

实验结果

研究问题

  • RQ1是否可以在不修改预训练权重的前提下,将领域特定知识注入PLM,从而避免灾难性遗忘?
  • RQ2两阶段适配器微调策略(先在无标签数据上,再在有标签数据上)在领域自适应中的有效性如何?
  • RQ3门控机制能否根据输入动态选择最相关的领域知识,从而提升在多样化领域中的性能?
  • RQ4在领域适配器中结合结构化与非结构化知识,是否能提升知识密集型任务的性能?
  • RQ5随着领域数量的增加,MixDA的可扩展性如何?其参数效率与标准微调相比如何?

主要发现

  • MixDA在15个多样化数据集上实现了最先进性能,涵盖领域内(GLUE)、领域外(ChemProt, RCT, IMDB, Amazon)以及知识密集型(KILT)基准。
  • 在FEVER与CSQA知识密集型任务中,结合非结构化与结构化知识(通过ConceptNet)分别使性能提升10.3%与1.2%。
  • 消融实验证明,移除MoA门控导致性能下降5.2%,移除旧领域知识导致下降7.5%,移除完整MixDA结构导致下降12.4%,证实了各组件的重要性。
  • Pfeiffer风格任务适配器在性能上优于其他适配器类型(Houlsby、Prefix-Tuning、LoRA),至少提升6.3%,且参数量仅为Houlsby的一半,是最佳选择。
  • 该方法可有效扩展至多个领域:领域适配器可独立训练,并通过MoA门控在推理时组合,无需重新训练整个模型。
  • MixDA保持高度效率,每个领域仅增加少量参数,使其适用于支持多领域特定适配器的语言模型即服务(MLaaS)场景。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。