Preserving Commonsense Knowledge from Pre-trained Language Models via Causal Inference (2023)

Abstract: Fine-tuning has been proven to be a simple and effective technique to transfer the learned knowledge of Pre-trained Language Models (PLMs) to downstream tasks. However, vanilla fine-tuning easily overfits the target data and degrades the generalization ability. Most existing studies attribute it to catastrophic forgetting, and they retain the pre-trained knowledge indiscriminately without identifying what knowledge is transferable. Motivated by this, we frame fine-tuning into a causal graph and discover that the crux of catastrophic forgetting lies in the missing causal effects from the pre-trained data. Based on the causal view, we propose a unified objective for fine-tuning to retrieve the causality back. Intriguingly, the unified objective can be seen as the sum of the vanilla fine-tuning objective, which learns new knowledge from target data, and the causal objective, which preserves old knowledge from PLMs. Therefore, our method is flexible and can mitigate negative transfer while preserving knowledge. Since endowing models with commonsense is a long-standing challenge, we implement our method on commonsense QA with a proposed heuristic estimation to verify its effectiveness. In the experiments, our method outperforms state-of-the-art fine-tuning methods on all six commonsense QA datasets and can be implemented as a plug-in module to inflate the performance of existing QA models.

## introduction deep pre-trained language models (plms) such as roberta @xcite and t5 @xcite ) are inherently knowledge bases since they are exposed to a tremendous amount of data (e.g., the c4 dataset @xcite ) in the pre-training stage @xcite . unfortunately, transferring the intrinsic knowledge in plms to downstream tasks is nontrivial. in practice, fine-tuning is adopted widely due to its flexibility @xcite and numerous improved methods @xcite @xcite @xcite @xcite are proposed in recent years. however, fine-tuning faces two challenges when adapting models to new domains @xcite , including catastrophic forgetting @xcite and negative transfer @xcite . more specifically, catastrophic forgetting refers to models losing previously learned knowledge and overfitting the target domain data. negative transfer occurs because not all pre-trained knowledge is transferable across domains. obviously, catastrophic forgetting and negative transfer constitute a dilemma where the crux lies in identifying and utilizing transferable knowledge. a large body of previous work has been conducted to solve this problem. existing fine-tuning methods for mitigating catastrophic forgetting can be summarized as preventing the fine-tuned models from deviating too far from the pre-trained weights. for example, recadam @xcite and child-tuning @xcite utilize the fisher information matrix estimated by the pre-trained model to constraint the update in the fine-tuned model. mixout @xcite randomly replaces the model parameters with their pre-trained weights. these methods constrain the update of models' parameters indiscriminately without identifying what knowledge is transferable and thus susceptible to negative transfer. @xcite proposed bss, which focuses on mitigating negative transfer by penalizing the small singular values of the feature matrix. however, when only negative transfer is concerned, bss may not fully utilize the pre-trained knowledge. in this paper, we propose a novel method called causal effect tuning (cet) for mining the pretrained knowledge in plms. unlike the previous fine-tuning method, our method is rooted in the theory of causal inference. it delves into the causalities between data, models, and features instead of merely statistical association. first, we frame vanilla fine-tuning into a causal graph @xcite and find out that the cause of catastrophic forgetting is the vanishing causal effects of pre-trained data. therefore, preventing forgetting is to maximize the causal effect. then, we approximate the causal effect with the likelihood of the joint prediction of k-nearest-neighbor (knn) samples. since equipping models with commonsense knowledge is still challenging, we implement the proposed causal graph with a heuristic approximation on commonsense qa. we measure the distance with the similarity between gold answers (i.e., ground-truth answers) instead of questions for retrieving knns. the rationale is that the questions with the same gold answer share the same commonsense knowledge in plms. finally, we apply our method to roberta @xcite and t5 @xcite and conduct extensive experiments on six commonsense datasets. the experimental results show that our method outperforms state-of-the-art fine-tuning methods and can be plugged into the state-of-the-art qa models to improve performance. more importantly, our method is lightweight and flexible since it requires no learnable parameter except plms and has fewer hyper-parameters to tune. it is worth noting that our method readily controls the strength of knowledge preservation by a single hyper-parameter, enabling a good balance between preserving pre-trained knowledge and absorbing new knowledge from downstream tasks. in summary, our contributions are three-fold: ## methodology in this section, we first use causal graphs @xcite to analyze how pre-trained knowledge is forgotten in fine-tuning. then, we present a causal graph for anti-forgetting based on previous analysis. next, we estimate the causal effect through derivations and propose a unified learning objective for fine-tuning with less forgetting. at last, we provide a heuristic approximation for estimating the causal effect on a challenging downstream task, commonsense qa. note that the proposed causal graph and the fine-tuning method are generic to all downstream tasks. ## conclusion we propose a novel fine-tuning technique rooted in causal inference for preserving pre-trained knowledge from plms. although many fine-tuning methods have been proposed in recent years, most of them overlooked one or both hidden issues of finetuning, catastrophic forgetting and negative transfer, which result in a dilemma. in this paper, we provide an answer to the dilemma from the casual lens. impressively, we empirically find that the proposed method achieves the best performance on six commonsense qa datasets and is flexible to be applied to various qa systems and model architectures.