Avoiding Inference Heuristics in Few-shot Prompt-based Finetuning (2021)

Abstract: Recent prompt-based approaches allow pretrained language models to achieve strong performances on few-shot finetuning by reformulating downstream tasks as a language modeling problem. In this work, we demonstrate that, despite its advantages on low data regimes, finetuned prompt-based models for sentence pair classification tasks still suffer from a common pitfall of adopting inference heuristics based on lexical overlap, e.g., models incorrectly assuming a sentence pair is of the same meaning because they consist of the same set of words. Interestingly, we find that this particular inference heuristic is significantly less present in the zero-shot evaluation of the prompt-based model, indicating how finetuning can be destructive to useful knowledge learned during the pretraining. We then show that adding a regularization that preserves pretraining weights is effective in mitigating this destructive tendency of few-shot finetuning. Our evaluation on three datasets demonstrates promising improvements on the three corresponding challenge datasets used to diagnose the inference heuristics.

## introduction prompt-based finetuning has emerged as a promising paradigm to adapt pretrained language models (plm) for downstream tasks with limited number of labeled examples @xcite . this approach reformulates downstream task instances as a language modeling input, foot_1 allowing plms to make non-trivial taskspecific predictions even in zero-shot settings. this in turn, provides a good initialization point for data efficient finetuning @xcite , resulting in a strong advantage on low data regimes where the standard finetuning paradigm struggles. however, the success of this prompting approach has only been shown using common held-out evaluations, which often conceal certain undesirable behaviors of models @xcite . one such behavior commonly reported in downstream models is characterized by their preference to use surface features over general linguistic information @xcite . in the natural language inference (nli) task, @xcite documented that models preferentially use the lexical overlap feature between sentence pairs to blindly predict that one sentence entails the other. despite models' high in-distribution performance, they often fail on counterexamples of this inference heuristic, e.g., they predict that "the cat chased the mouse" entails "the mouse chased the cat". at the same time, there is a mounting evidence that pre-training on large text corpora extracts rich linguistic information @xcite . however, based on recent studies, standard finetuned models often overlook this information in the presence of lexical overlap @xcite . we therefore question whether direct adaptation of plms using prompts can better transfer the use of this information during finetuning. we investigate this question by systematically studying the heuristics in a prompt-based model finetuned across three datasets with varying data regimes. our intriguing results reveal that: (i) zero-shot prompt-based models are more robust to using the lexical overlap heuristic during inference, indicated by their high performance on the corresponding challenge datasets; (ii) however, prompt-based finetuned models quickly adopt this heuristic as they learn from more labeled data, which is indicated by gradual degradation of the performance in challenge datasets. we then show that regularizing prompt-based finetuning, by penalizing the learning from up-dating the weights too far from their original pretrained values, is an effective approach to improve the in-distribution performance on target datasets, while mitigating the adoption of inference heuristics. overall, our work suggests that while promptbased finetuning has gained impressive results on standard benchmarks, it can has a negative impact regarding inference heuristics, which in turn suggests the importance of a more thorough evaluation setup to ensure meaningful progress. ## inference heuristics in prompt-based finetuning prompt-based plm finetuning in this work, we focus on sentence pairs classification tasks, where the goal is to predict semantic relation y of an input pair @xmath0, s 2 ). in a standard finetuning setting, s 1 and s 2 are concatenated along with a special token [cls], whose embedding is used as an input to a newly initialized classifier head. the prompt-based approach, on the other hand, reformulates pair x as a masked language model input using a pre-defined template and word-tolabel mapping. for instance, schick and schütze (2021a) formulate a natural language inference instance (s 1 , s 2 , y) as: with the following mapping for the masked token: "yes"→ "entailment", "maybe"→"neutral", and "no" → "contradiction". the probabilities assigned by the plm to the label words at the [mask] token can then be directly used to make task-specific predictions, allowing plm to perform in a zeroshot setting. following @xcite , we further finetune the prompt-based model on the available labeled examples for each task. note that this procedure finetunes only the existing pre-trained weights, and does not introduce new parameters. task and datasets we evaluate on three english language datasets included in the glue benchmark @xcite for which there are challenge datasets to evaluate the lexical overlap heuristic: mnli @xcite , @xcite , and quora question pairs (qqp). in mnli and snli, the task is to determine whether premise sentence s 1 entails, contradicts, or is neutral to the hypothesis sentence s 2 . in qqp, s 1 and s 2 are a pair of questions that are labeled as either duplicate or non-duplicate. ## avoiding inference heuristics here we look to mitigate the adverse impact of finetuning by viewing the issue as an instance of catastrophic forgetting @xcite , which is characterized by the loss of performance on the original dataset after subsequent finetuning on new data. we then propose a regularized prompt-based finetuning based on the elastic weight consolidation (ewc) method @xcite , which penalizes updates on weights crucial for the original zero-shot performance. ewc identifies these weights using empirical fisher matrix @xcite , which requires samples of the original dataset. to omit the need of accessing the pretraining data, we follow @xcite that assume stronger independence between the fisher information and the corresponding weights. the penalty term is now akin to the l2 loss between updated weights θ i and the original weights θ * i , resulting in the following overall loss: ## related work inference heuristics our work relates to a large body of literature on the problem of "bias" in the training datasets and the ramifications to the resulting models across various language understanding tasks @xcite @xcite . previ-ous work shows that the artifacts of data annotations result in spurious surface cues, which gives away the labels, allowing models to perform well without properly learning the intended task. for instance, models are shown to adopt heuristics based on the presence of certain indicative words or phrases in tasks such as reading comprehension @xcite , story cloze completion @xcite , fact verification @xcite , argumentation mining @xcite , and natural language inference @xcite . heuristics in models are often investigated using constructed "challenge datasets" consisting of counter-examples to the spurious cues, which mostly result in incorrect predictions @xcite @xcite . although the problem has been extensively studied, most works focus on models that are trained in standard settings where larger training datasets are available. our work provides new insights in inference heuristics in models that are trained in zero-and few-shot settings. ## conclusion our experiments shed light on the negative impact of low resource finetuning to the models' overall performance that is previously obscured by standard evaluation setup. the results indicate that while finetuning helps prompt-based models to rapidly gain the in-distribution improvement as more labeled data are available, it also gradually increases models' reliance on surface heuristics, which we show to be less present in the zero-shot evaluation. we further demonstrate that applying regularization that preserves pretrained weights during finetuning mitigates the adoption of heuristics while also maintains high in-distribution performances. glue: a multi-task benchmark and analysis platform for natural language understanding. in proceedings of the 2018 emnlp workshop black-boxnlp: analyzing and interpreting neural networks for nlp, pages 353-355, brussels, belgium. association for computational linguistics. alex warstadt, yian zhang, xiaocheng li, haokun liu, and samuel r. bowman. 2020. learning which features matter: roberta acquires a preference for linguistic generalizations (eventually). in proceedings of the 2020 conference on empirical methods in natural language processing (emnlp), pages 217-235, online. association for computational linguistics. adina williams, nikita nangia, and samuel bowman. 2018. a broad-coverage challenge corpus for sentence understanding through inference. in proceedings of the 2018 conference of the north american chapter of the association for computational linguistics: human language technologies, volume 1 (long papers), pages 1112-1122, new orleans, louisiana. association for computational linguistics. ji xin, rodrigo nogueira, yaoliang yu, and jimmy lin. 2020. early exiting bert for efficient document ranking. in proceedings of sustainlp: workshop on simple and efficient natural language processing, pages 83-88, online. association for computational linguistics. yadollah yaghoobzadeh, soroush mehri, remi tachet des combes, t. j. hazen, and alessandro sordoni. 2021. increasing robustness to spurious correlations using forgettable examples. in proceedings of the 16th conference of the european chapter of the association for computational linguistics: main volume, pages 3319-3332, online. association for computational linguistics. rowan zellers, ari holtzman, yonatan bisk, ali farhadi, and yejin choi. 2019. hellaswag: can a machine really finish your sentence? in proceedings of the 57th annual meeting of the association for computational linguistics, pages 4791-4800, florence, italy. association for computational linguistics. yuan zhang, jason baldridge, and luheng he. 2019. paws: paraphrase adversaries from word scrambling. in proceedings of the 2019 conference of the north american chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pages 1298-1308, minneapolis, minnesota. association for computational linguistics.