Meta Fine-Tuning Neural Language Models for Multi-Domain Text Mining (2020)

Abstract: Pre-trained neural language models bring significant improvement for various NLP tasks, by fine-tuning the models on task-specific training sets. During fine-tuning, the parameters are initialized from pre-trained models directly, which ignores how the learning process of similar NLP tasks in different domains is correlated and mutually reinforced. In this paper, we propose an effective learning procedure named Meta Fine-Tuning (MFT), serving as a meta-learner to solve a group of similar NLP tasks for neural language models. Instead of simply multi-task training over all the datasets, MFT only learns from typical instances of various domains to acquire highly transferable knowledge. It further encourages the language model to encode domain-invariant representations by optimizing a series of novel domain corruption loss functions. After MFT, the model can be fine-tuned for each domain with better parameter initializations and higher generalization ability. We implement MFT upon BERT to solve several multi-domain text mining tasks. Experimental results confirm the effectiveness of MFT and its usefulness for few-shot learning.

## introduction recent years has witnessed a boom in pre-trained neural language models. notable works include elmo @xcite , bert @xcite , transformer-xl @xcite , al-bert @xcite , structbert @xcite and many others. these models revolutionize the learning paradigms of various nlp tasks. after pre-training, only a few fine-tuning epochs are required to train models for these tasks. the "secrets" behind this phenomenon owe to the models' strong representation learning power to encode the semantics and linguistic knowledge from massive text corpora @xcite @xcite . by simple fine-tuning, models can transfer the universal natural language understanding (nlu) abilities to specific tasks @xcite . however, state-of-the art language models mostly utilize self-supervised tasks during pretraining (for instance, masked language modeling and next sentence prediction in bert @xcite ). this unavoidably creates a learning gap between pre-training and fine-tuning. besides, for a group of similar tasks, conventional practices require the parameters of all task-specific models to be initialized from the same pre-trained language model, ignoring how the learning process in different domains is correlated and mutually reinforced. a basic solution is fine-tuning models by multitask learning. unfortunately, multi-task fine-tuning of bert does not necessarily yield better performance across all the tasks @xcite . a probable cause is that learning too much from other tasks may force the model to acquire nontransferable knowledge, which harms the overall performance. a similar finding is presented in @xcite ; @xcite on multi-task training of neural networks. additionally, language models such as bert do not have the "shared-private" architecture @xcite to enable effective learning of domain-specific and domain-invariant features. other approaches modify the structures of language models to accommodate multi-task learning and mostly focus on specific applications, without providing a unified solution for all the tasks (stickland and @xcite @xcite . a recent study @xcite reveals that meta-learning achieves better parameter initialization for a group of tasks, which improves the models' generalization abilities in different domains and makes them easier to fine-tune. as pre-trained language models have general nlu abilities, they should also have the ability to learn solving a group of similar nlp tasks. in this work, we propose a separate learning procedure, inserted between pretraining and fine-tuning, named meta fine-tuning (mft). this work is one of the early attempts for improving fine-tuning of neural language models by meta-learning. take the review analysis task as an example. mft only targets at learning the polarity of reviews (positive or negative) in general, ignoring features of specific aspects or domains. after that, the learned model can be adapted to any domains by fine-tuning. the comparison between fine-tuning and mft is shown in figure 1 . specifically, mft first learns the embeddings of class prototypes from multi-domain training sets, and assigns typicality scores to individuals, indicating the transferability of each instance. apart from minimizing the multi-task classification loss over typical instances, mft further encourages the language model to learn domain-invariant representations by jointly optimizing a series of novel domain corruption loss functions. for evaluation, we implement the mft strategy upon bert @xcite for three multidomain text mining tasks: i) natural language inference @xcite (sentence-pair classification), ii) review analysis @xcite (sentence classification) and iii) domain taxonomy construction @xcite (word-pair classification). experimental results show that the effectiveness and superiority of mft. we also show that mft is highly useful for multi-domain text mining in the few-shot learning setting. foot_0 ## related work we overview recent advances on pre-trained language models, transfer learning and meta-learning. ## mft: the proposed framework in this section, we start with some basic notations and an overview of mft. after that, we describe the algorithmic techniques of mft in detail. ## experiments we conduct extensive experiments to evaluate mft on multiple multi-domain text mining tasks. ## conclusion and future work in this paper, we propose a new training procedure named meta fine-tuning (mft) used in neural language models for multi-domain text mining. experimental results show the effectiveness of mft from various aspects. in the future, we plan to apply mft to other language models (e.g., transformer-xl @xcite and albert @xcite ) and for other nlp tasks.