RGL : A Simple yet Effective Relation Graph Augmented Prompt-based Tuning Approach for Few-Shot Learning (2022)

Abstract: Pre-trained language models (PLMs) can provide a good starting point for downstream applications. However, it is difficult to generalize PLMs to new tasks given a few labeled samples. In this work, we show that Relation Graph augmented Learning (RGL) can improve the performance of few-shot natural language understanding tasks. During learning, RGL constructs a relation graph based on the label consistency between samples in the same batch, and learns to solve the resultant node classification and link prediction problems on the relation graph. In this way, RGL fully exploits the limited supervised information, which can boost the tuning effectiveness. Extensive experimental results show that RGL consistently improves the performance of prompt-based tuning strategies.

## introduction pre-trained language models (plms), such as bert @xcite and roberta @xcite , have become the standard workhorse for nowadays natural language processing tasks. a direct way of leveraging these plms is to finetune them by taking gradient descent w.r.t. the objective of downstream tasks. however, tuning the large plm by a few labeled samples has a high risk of overfitting @xcite @xcite . besides, as plms are trained by an objective different from the downstream tasks, the ability of plm may not be fully exploited. recently, promptbased tuning methods emerge and obtain promising results on tuning plms to new tasks with a few labeled samples @xcite . in particular, these methods use prompts to reformulate the downstream tasks into the same form of pretraining tasks such that the gap between pretraining and fine-tuning is reduced @xcite . concretely, prompt-based tuning strategies rewrite the input sequence into a cloze question with masks @xcite . the input sequence is rewritten as prompts, while the corresponding label is replaced by answer tokens. some methods use hard prompts and answers which use text strings with certain semantic meaning @xcite @xcite , while others take learnable parameters as soft prompts and answers @xcite @xcite . one can use multiple prompts to boost the performance of prompt-based tuning @xcite . while the above strategies improve few-shot performance, they pay less attention to exploiting the relations among the limited number of labeled samples. in this work, we propose a simple yet effective relation graph augmented approach which can enhance the performance of prompt-based tuning strategies plm in few-shot natural language understanding tasks. specifically, our proposal aims at fully exploiting the limited supervised information via relation graph augmented learning, we thus call the proposed method rgl. rgl first constructs a batch-wise relation graph, where every node refers to a labeled sample and the edge between nodes refers to the similarity between the two samples. rgl establishes the edge in the relation graph w.r.t whether the two samples are from the same class and regularizes the similarity of representations learned by plms between every two samples to fit the edge of the relation graph. rgl can easily scale up as the relation graph is constructed w.r.t. only a mini-batch of sampled data points per iteration. empirical results on benchmark datasets show that rgl can consistently improve the performance of promptbased tuning. ## related works the related works are briefly reviewed below. few-shot learning. few-shot learning (fsl) targets at generalizing to new tasks with a few labeled samples @xcite . fsl has been applied to many natural language processing applications such as text classification @xcite and named entity typing @xcite . typical solutions in fsl include data augmentation which directly generate more labeled samples @xcite , metric learning which learns to embed samples into a space where samples can be easily discriminated @xcite , and meta-learning which learns a good initialized model from a set of related tasks which is then fine-tune to each task @xcite . recently, several methods propose to tune pre-trained language models to downstream few-shot tasks @xcite . we follow this line, and further propose to conduct model tuning on learned relation graphs. our approach can be incorporated into existing prompt-based tuning strategies, increasing the effectiveness of supervised signals and bringing in performance gains. graph structure learning. graph structure learning methods target at jointly learning graph structure and node embeddings of input samples @xcite . usually, these methods iterate over two steps: (i) estimate the adjacency matrix which encodes graph structure using node embeddings; and (ii) apply graph neural networks (gnns) on this updated graph to obtain new node embeddings. recently, graph structure learning has been used to estimate relation graphs among samples to facilitate effective propagation of label information @xcite @xcite . these methods estimate relation graphs which encode the similarity between sample embeddings. in contrast, our rgl models similarity between samples by class prediction vectors without introducing extra parameters. ## background following the problem definition of @xcite , the target of this paper is to generalize a pre-trained language model (plm) to text classification tasks with a few labeled examples. each task t with label space y consists of three datasets: (i) training dataset d @xmath0, y i )} containing a few labeled examples where x i is the sequence and y i is the corresponding label, (ii) development(validation) dataset d dev containing the same number of samples as d train and is used for model selection, and (iii) testing dataset d test containing unlabeled samples to be predicted. in prompt-based tuning, each input sample (x i , y i ) is reformulated as a pattern-verbalizer pair (pvp) @xcite in terms of (p(x i ), v(y i )). the pattern mapping function p(•) maps x i to a cloze question with masks. for example, a single sentence it was [mask].[sep]", where [cls] and [sep] are special start and end tokens. and a sentence pair the verbalizer v(•) maps y i to tokens expressing the semantic meaning of y i . for examples, "positive/negative" can be mapped as "good/bad". with pvps, the token embedding h [mask] i of [mask] is taken as the representation of x i . the class prediction ŷi contains the conditional probability distribution of each possible class label given x i , whose entry corresponds to y i is estimated as ## rgl: our proposed method in this section, we present the proposed rgl (figure 1 ). we manage to exploit more supervised signals out of the training samples by constructing and learning on batch-wise relation graphs, which can boost the effectiveness of prompt-based tuning. ## experiments all the experiments are conducted on a 32gb nvidia tesla v100 gpu. experimental settings. we use robertalarge 2 @xcite as the plm. we take pet 3 @xcite as the basic prompt-based tuning method. upon pet, we compare the benefits of applying the proposed rgl versus scl @xcite . all the hyperparameters are selected using the provided development set via grid search following @xcite . we use adam optimizer. we first select 2 https://huggingface.co/roberta-large . 3 https://github.com/timoschick/pet . learning rate from {1e -5, 2e -5, 5e -5} and batch size from {2, 4, 8} for pet. then, we select hyperparameter α in rgl and hyperparameters β and τ in scl from [0 : 0.2 : 1] separately. we train all methods for a maximum number of 1000 steps and evaluate the performance on development set every 100 steps. dataset. experiments are performed on a variant of glue benchmarks @xcite for fewshot setting, which is provided by @xcite . @xcite provide 5 different training sets and developing sets where each of them consist of 16 labeled samples per class. the averaged performance over these 5 splits are reported. we also evaluate the proposed rgl on the superglue @xcite variant proposed by @xcite , whose results are put in appendix due to space limit. results. ## conclusion we present rgl, a simple yet effective relation graph augmented prompt-based tuning approach for few-shot natural language understanding tasks. during learning, rgl constructs batchwise relation graphs based on label consistency between samples, and explicitly tunes the pretrained language models to solve the resultant node classification and link prediction problems. in this way, rgl fully exploits the limited supervised information. in this paper, we provide one way of relation graph learning. this can be further extended to broader applications, where other ways of relation graph learning worth trying. in addition, one can explore how to avoid the interference of noisy samples.