Embedding Hallucination for Few-shot Language Fine-tuning (2022)

Abstract: Few-shot language learners adapt knowledge from a pre-trained model to recognize novel classes from a few-labeled sentences. In such settings, fine-tuning a pre-trained language model can cause severe over-fitting. In this paper, we propose an Embedding Hallucination (EmbedHalluc) method, which generates auxiliary embedding-label pairs to expand the fine-tuning dataset. The hallucinator is trained by playing an adversarial game with the discriminator, such that the hallucinated embedding is indiscriminative to the real ones in the fine-tuning dataset. By training with the extended dataset, the language learner effectively learns from the diverse hallucinated embeddings to overcome the over-fitting issue. Experiments demonstrate that our proposed method is effective in a wide range of language tasks, outperforming current fine-tuning methods. Further, we show that EmbedHalluc outperforms other methods that address this over-fitting problem, such as common data augmentation, semi-supervised pseudo-labeling, and regularization.

## introduction fine-tuning a pre-trained language model (lm) on a downstream task with the labeled data has been the de facto approach in many nlp tasks @xcite . conventional finetuning has been shown to be effective when a few thousands of labeled examples are available. data augmentation @xcite , regularization @xcite and re-initialization @xcite further improve the results. however, the performance drops drastically when the number of examples falls to only a few dozens. experiments from recent work @xcite have shown that fine-tuning performs poorly in the setting where only 16 examples per class are * both authors contributed equally to this research. prior work have proposed regularization methods to overcome this problem @xcite . however, we show in our experiments that these methods fail in extreme data scarce setting. we speculate that the key to solve this issue is by data augmentation. current common text data augmentation methods, such as eda @xcite (which have been used in recent few-shot learning papers @xcite ) and aeda @xcite operate at the lexical level, which while resulting in human readable texts, lead to limited diversity due to the discrete nature of the lexical space. in this work, we propose to use a generative augmentation method at the embedding space for few-shot learning. the underlying hypothesis is that the intra-class relation of the observed examples can be modeled and that this can be learned from a few-samples to hallucinate diverse unseen examples. to be specific, we adapt a conditional wasserstein generative adversarial network (cw-gan) @xcite as our hallucinator to hallucinate embeddings of sentences. by observing the real embeddings of examples from the fine-tuning dataset, the cwgan plays an adversarial game to hallucinate embeddings that can fool the discriminator, while the discriminator is trying to classify the fake embeddings from the real ones. once the halluciantor is trained, we condition it on labels to generate diverse embeddings at each fine-tuning step. this effectively extends the fine-tuning dataset with diverse embedding-label pairs which carry intra-class variation that can be a useful learning signal for the language learner. we evaluate our method, called embedding hallucination (embedhalluc), on 15 tasks and show that it generally improves over recent fine-tuning methods. we further experimentally show the overall superiority of embedhalluc when comparing to regularization methods proposed to address the problem of over-fitting during fine-tuning of lms, such as mixout @xcite and re-init @xcite . finally, since our method is a form of data augmentation, we also compare embedhalluc to a common data augmentation technique eda, and semi-supervised learning where unlabeled data is already available. ## related work fine-tuning of language models. better finetuning of language models can be achieved by proper initialization @xcite , regularization @xcite or prompts @xcite . other tricks include bias correction in optimizer and re-initialization of top layers in transformer @xcite . instead of fine-tuning all parameters in a model, other work explore only learning a few vectors @xcite @xcite or a few additional parameters @xcite . hallucination methods. feature hallucination of examples is first introduced for visual recognition @xcite by metalearning @xcite , variational inference @xcite , and adversarial learning @xcite . label hallucination @xcite assigns soft pseudo-labels for unlabelled images to extend the fine-tuning few-shot dataset. learning from limited labeled data (few-shot learning) in computer vision is usually achieved by meta-learning @xcite @xcite or transfer learning @xcite . in nlp, few-shot learning has been successfully applied to machine translation @xcite , abstract summarizing @xcite , question and answering @xcite , and entity recognition @xcite @xcite , by meta learning @xcite @xcite , data augmentation @xcite @xcite , and prompts @xcite . our method is a generative data augmentation method in the embedding space. different from @xcite which uses eda @xcite to augment examples at the discrete input space, we hallucinate auxiliary examples at the embedding space. our method shares similarity to fda @xcite , which is also a generative data augmentation method, but at the feature space. also, different from fda which is focused on two intent classification tasks, our method can be applied to a wide-range of nlp task as shown by our experiments on 15 diverse tasks. ## comparing to adversarial training adversarial training adds noise into the training data to increase the robustness of a model. it has been shown that adversarial training can also improve the performance of language models. here, we compare embedhalluc to two recent adversarial training methods, freelb @xcite and smart @xcite adapted to our setting. for freelb, we use the publicly available code and ## limitations while embedhalluc works well empirically, it relies on hallucinating non-interpretable embeddings to facilitate the learning process. besides, the learning of cwgan requires careful human attention to maintain a stable training. ## conclusion in this paper, we introduce an embedding hallucination method for data augmentation for few-shot learning, based on cwgan. the proposed method improves over the baselines in 15 tasks and outperforms a common augmentation method, and two recent regularization methods.