Kernel-Whitening: Overcome Dataset Bias with Isotropic Sentence Embedding (2022)

Abstract: Dataset bias has attracted increasing attention recently for its detrimental effect on the generalization ability of fine-tuned models. The current mainstream solution is designing an additional shallow model to pre-identify biased instances. However, such two-stage methods scale up the computational complexity of training process and obstruct valid feature information while mitigating bias.To address this issue, we utilize the representation normalization method which aims at disentangling the correlations between features of encoded sentences. We find it also promising in eliminating the bias problem by providing isotropic data distribution. We further propose Kernel-Whitening, a Nystrom kernel approximation method to achieve more thorough debiasing on nonlinear spurious correlations. Our framework is end-to-end with similar time consumption to fine-tuning. Experiments show that Kernel-Whitening significantly improves the performance of BERT on out-of-distribution datasets while maintaining in-distribution accuracy.

## introduction despite remarkable performance on nlp tasks, pretrained language models, like bert, suffer sharp performance degradation in out-of-distribution (ood) settings @xcite . the above defect roots in the excessive reliance on spurious correlations, which is widely found in crowdsourcingbuilt datasets @xcite . these phenomena are donated as dataset bias problem @xcite . a line of works attempts to tackle this problem by down-weighting bias training examples to discourage the main model from adopting recognized biases, including example reweighting @xcite , confidence regularization @xcite , or model ensembling @xcite . however, aforementioned methods over-depend on researchers' intuition and task-specific insights to characterize spurious correlations, causing unrecognized bias patterns to remain in individual dataset @xcite . such assumption that dataset biases are known as a prior has been relaxed by limited capacity models @xcite or early training @xcite in recent works. these approaches still rely on extra shallow models, which are not end-to-end, and weak-weighted bias samples simultaneously obstruct learning from their non-bias parts @xcite . instead of designing an extra model as previous attempts did, in this work, we propose a novel endto-end framework, kernel-whitening, to significantly improve ood performance while maintaining a similar computational cost as conventional bert fine-tuning. the bert-whitening @xcite and bert-flow @xcite methods are effective normalization techniques to obtain better semantic representation. bert-whitening calculates a linear operator 1 with svd decompo-sition @xcite to transform the sentence representation to follow a distribution with respect to the standard normal distribution. bert-flow introduces normalized flow @xcite to perform similar transformations. particularly, we find that the normalization method is also promising in improving the generalization ability of fine-tuned models by eliminating spurious correlations in training datasets. despite the significant improvement over the ood datasets, the linear transformation of bert-whitening is not capable of dealing with nonlinear dependencies between features. meanwhile, flow-based methods require a complex inference process, which scales up the training costs. in an attempt to eliminate nonlinear correlations while maintaining low training expenditure, we introduce kernel methods to naturally reconstruct a set of sentence representations only with linear correlation @xcite . however, traditional kernel methods focus only on data similarities without providing explicit mapping operators, therefore, we use the nyström approximation @xcite to obtain low-rank kernel estimations. in general, we transform training data to an isotropic gaussian distribution without affecting topological relationships between data points. kernel-whitening foot_1 achieves competitive performance on generalization tasks. experiments on eight datasets demonstrate that our method can improve the accuracy by 7%-11% on ood datasets. in addition, the analysis of sentence representation proves that our method effectively removes the spurious correlations between dimensional features, which are known to be the direct cause of the dataset bias problem. overall, our main contributions are as follows: ## how do normalization methods provide better generalization in this section, we discuss the negative impacts of dataset bias on the model's generalization ability, and subsequently, how normalization methods lead to better performance in ood settings. ## distribution generalization with kernel approximation in this section, we show our end-to-end framework named kernel-whitening. we first introduce nyström kernel estimation algorithm, and subsequently how to apply such approximation method on debiasing tasks. ## experiments in this section, we provide a comprehensive analysis of kernel-whitening and the other two normalization methods (i.e., bert-flow @xcite foot_2 and bert-whitening @xcite ) through extensive experiments on three tasks. ## analysis and discussion in this section, we construct supplementary experiments to further analyze the effectiveness of normalization methods, especially our kernel-whitening framework. ## conclusion in this work, we propose a novel framework, kernel-whitening, to tackle the spurious correlation from a feature perspective. we analyze how to introduce isotropic sentence embedding for eliminating dataset bias and propose a promising and computationally kernel estimation, to obtain an approximation of disentangled sentence embedding. experiments on various datasets demonstrate that kernel-whitening achieves better performance on both id and ood datasets than comparative works. this implies that a shallow model, or prior knowledge of dataset bias, is not must for the improvement of generalization.