Improving the robustness of NLI models with minimax training (2023)

Abstract: Natural language inference (NLI) models are susceptible to learning shortcuts, i.e. decision rules that spuriously correlate with the label. As a result, they achieve high in-distribution performance, but fail to generalize to out-of-distribution samples where such correlations do not hold. In this paper, we present a training method to reduce the reliance of NLI models on shortcuts and improve their out-of-distribution performance without assuming prior knowledge of the shortcuts being targeted. To this end, we propose a minimax objective between a learner model being trained for the NLI task, and an auxiliary model aiming to maximize the learner’s loss by up-weighting examples from regions of the input space where the learner incurs high losses. This process incentivizes the learner to focus on under-represented “hard” examples with patterns that contradict the shortcuts learned from the prevailing “easy” examples. Experimental results on three NLI datasets demonstrate that our method consistently outperforms other robustness enhancing techniques on out-of-distribution adversarial test sets, while maintaining high in-distribution accuracy.

## introduction natural language inference (nli) foot_0 models have achieved state-of-the-art results on many benchmarks @xcite . however, recent work has demonstrated that their success is partly due to learning and using shortcuts @xcite @xcite , i.e. spurious correlations between input attributes and labels introduced during dataset creation. 2 for example, high word-overlap between the premise and the hypothesis in the mnli @xcite ## minimax training for shortcut mitigation suppose we have a dataset @xmath0, y i )} n @xmath1. our goal is to learn a model f θ : @xmath2. the standard training objective for achieving this is empirical risk minimization (erm) that minimizes the average training loss: to compute the example weight distribution, we propose a minimax training objective between a learner f θ and an auxiliary g ϕ : x × @xmath3, 1] parameterized by ϕ. both models are optimized in an alternating fashion. the learner f θ tries to minimize the loss for the classification task (nli in this paper). the task of the auxiliary g ϕ is to maximize the learner's loss by generating a weight for each training example at every training iteration, such that the learner is incentivized to concentrate on regions of the input space where it incurs high losses. thus, the learner will prioritize learning from under-represented "hard" examples that counteract the use of shortcuts present in the dominant "easy" examples. formally, the minimax objective can be written as: ## analysis using the loss to detect "hard" examples we investigate whether the loss provides a robust signal for discovering "hard" examples that contradict the shortcuts found in the "easy" examples. to this end, we manually classify training instances from mnli into two categories, namely, "easy" entailment instances with a large amount of words occurring both in the hypothesis and the premise, and under-represented "hard" non-entailment examples with high word overlap, and study their average losses during training. figure 3 demonstrates that the high-loss examples on mnli are dominated by the "hard" non-entailment category, whereas the "easy" entailment examples incur predominantly low-losses. removing "easy" examples and inverting the weight distribution we evaluate whether we can improve the overall performance of the minimax effect of number of epochs for pre-training the learner we investigate how performance changes as we vary the number of epochs required for pre-training the learner model. figure 4a demonstrates that out-of-distribution performance is high when we pre-train the learner for 2 and 3 epochs, but drops when the duration of the pretraining stage is either too short or too long, which consequently results in less informative losses for the auxiliary to learn from. ## related work distributionally robust optimization training objectives for ensuring strong model performance across all samples typically fall under the framework of distributionally robust optimization (dro) @xcite . dro seeks to minimize the worst-case loss by placing emphasis on "hard" examples. @xcite extend the dro framework to the case where the training data belongs to predefined groups (e.g. demographic ## conclusion in this work, we present a minimax training objective for reducing the reliance of nli models on shortcuts in order to improve their overall robustness without assuming prior knowledge about the existence of specific shortcuts. our proposed method leverages an auxiliary model that tries to maximize the learner's loss by up-weighting underrepresented "hard" examples with patterns that contradict the shortcuts present in the prevailing "easy" examples. experiments across three nli datasets demonstrate that our minimax objective consistently improves performance on various outof-distribution adversarial test sets.