Distributionally Robust Finetuning BERT for Covariate Drift in Spoken Language Understanding (2022)

Abstract: In this study, we investigate robustness against covariate drift in spoken language understanding (SLU). Covariate drift can occur in SLUwhen there is a drift between training and testing regarding what users request or how they request it. To study this we propose a method that exploits natural variations in data to create a covariate drift in SLU datasets. Experiments show that a state-of-the-art BERT-based model suffers performance loss under this drift. To mitigate the performance loss, we investigate distributionally robust optimization (DRO) for finetuning BERT-based models. We discuss some recent DRO methods, propose two new variants and empirically show that DRO improves robustness under drift.

## introduction a common assumption in machine learning is that training data and test data are independent and identically distributed (i.i.d.). unfortunately, this may not hold in practice and the test distribution might have drifted from the training distribution which can lead to a significant drop of performance in realworld applications @xcite . consider spoken language understanding (slu), i.e., the task of mapping an utterance to a machine readable semantic interpretation, which is commonly used in voice controlled devices like alexa, siri or google assistant. distributional drifts can be caused by seasonal and non-seasonal factors. for example, festive holidays can lead to many requests outside the daily routine. new users might use an uncommon phrasing to express their intent or they might request an uncommon song to be played. such drifts in the input distribution are referred to as covariate drift. when users' requests fail to be recognized by the device they might rephrase their intent until they succeed, essentially adapting to the slu model's distribution. this means that, even when new training samples are drawn from new user utterances, the dominance of the old distribution already present in the slu model is reinforced. fine-tuned pre-trained language models (plm), such as bert @xcite yield strong performance on slu benchmarks @xcite ). yet, it has been observed that also plms are vulnerable to drifts, and there is a high interest in understanding the robustness of plms @xcite @xcite . the goals of this study are to investigate the impact of covariate drift on bert's performance, and to experimentally investigate distributionally robust optimization (dro) for finetuning bert. while we focus on sequence classification for slu, i.e., intent classification (ic) and slot filling (sf), we expect the insights of this study to be applicable also to other sequence classification tasks. to study the impact of covariate drift on model robustness, we require a dataset with known properties of the drift. however, real data for this setting is not publicly available. therefore, we devised a method to create a train/test split with a controlled drift for sequence labeling data, which we call se-qdrift. roughly speaking, seqdrift creates clusters of examples based on the example's tokens and sequence labels. then those clusters are used to create a new train/test split while leaving the label distribution intact. notably, seqdrift does not artificially alter the utterances and only exploits natural lexical variations in the data in a non-adversarial manner. our experiments on publicly available slu datasets repartitioned with se-qdrift showed that a state-of-the-art bert-based model for slu @xcite trained with standard optimization suffers up to 5% absolute performance loss. currently, it is an open question which range of measures are helpful to improve the generalization under drift. in this study, we investigated distributionally robust optimization (dro), which has recently gained interest in nlp for overparameterized models @xcite @xcite . it is an optimization concept which assumes that the training data is a mixture of distributions, e.g., different user demographics. the objective is to be optimal under each distribution. for example, the methods proposed by @xcite and @xcite assume knowledge about groups of training instances -such as topics or ethnic origin-that can be used by the optimization. roughly speaking, they propose to compute the loss across groups instead across individual instances. however, such group knowledge might not be available and there are other methods which do not require such prior knowledge. topk @xcite , for example, simply uses the top-k largest losses in a batch and was shown to obtain robust models. we performed an extensive experimental analysis to investigate the usefulness of several dro methods across different scenarios. most studies only evaluate dro methods in one setting with in-distribution validation data and one drift type per dataset. to achieve a broader insight into the usefulness of the investigated methods we evaluated them in 8 scenarios per dataset, i.e., for different types of drift, or model selection with in-distribution and out-of-distribution validation data. additionally, we propose an intuitive variant of topk, namely topk-group or topk-autoencoder to investigate if prior group knowledge or latent group knowledge could improve topk. we found that topk, topk-group and topk-autoencoder can significantly improve robustness in many scenarios, where topk is more reliable in terms of significant improvement, while topk-autoencoder can be better in terms of relative improvement. ## background in this section, we provide a brief background to spoken language understanding. subsequently, we discuss common categorizations of dataset drifts, empirical analyses of drifts and then describe distributionally robust optimization. ## the seqdrift method to create covariate drift benchmarks our goal is to study the impact of covariate drift on model performance. therefore, we need a benchmark with controlled drift, but currently there are no publicly available slu benchmarks in which real drifts can be studied. as motivated in section 2.3, we do not want to employ synthetic noise, i.e., our goal is to design a method that exploits natural variations in the data. moreover, the method should not be adversarial, i.e., not designed or optimized to target a specific model or model class. instead, we target two semantic drifts that might occur in real data due to: how users express their intent, and what users request. we conjecture that it is possible to capture how users express themselves by creating clusters of utterances with similar slot contexts. to capture what users request could be achieved by clusters of utterances with similar slot values. a drift can then be created by partitioning the data based on those clusters into training and testing. we avoid creating a mismatch of the label distributions between training and testing. if a mismatch would occur, it would not be possible to derive conclusions about covariate drift from changes in performance because the shift in the label distribution also leads to changes in the measured performance. in the following, we describe our approach in detail. ## dro for overparameterized models in the experiments in section 5 we will show that using erm optimization on the seqdrift partitioned datasets is not robust. there might be many measures to mitigate this effect, and the best solution will most likely consist of a mix of methods. one candidate is dro that has seen a rising interest to be applied to overparameterized models. in the following, we first briefly discuss the setting of finetuning a pretrained language model (plm), and subsequently we describe existing and proposed dro methods. ## conclusions we studied finetuning bert for slu datasets with covariate drift. we presented the seqdrift method to induce a covariate drift for slu sequence classification tasks. the experimental results showed that this drift in the input distribution leads to a drop in performance on four slu datasets for a common bert-based slu model finetuned with erm. we investigated dro methods that either use or do not use knowledge about groups in the data.