Towards preserving word order importance through Forced Invalidation (2023)

Abstract: Large pre-trained language models such as BERT have been widely used as a framework for natural language understanding (NLU) tasks. However, recent findings have revealed that pre-trained language models are insensitive to word order. The performance on NLU tasks remains unchanged even after randomly permuting the word of a sentence, where crucial syntactic information is destroyed. To help preserve the importance of word order, we propose a simple approach called Forced Invalidation (FI): forcing the model to identify permuted sequences as invalid samples. We perform an extensive evaluation of our approach on various English NLU and QA based tasks over BERT-based and attention-based models over word embeddings. Our experiments demonstrate that FI significantly improves the sensitivity of the models to word order.

## introduction ordering of words in a sentence is an important structural attribute for natural languages such as english, where subject-verb-object (svo) structure is common and important to convey the meaning of the sentence. understanding and comprehending natural language without strict adherence to a systematic ordering of words would make it an extremely challenging task. recent work has investigated a surprising lack of sensitivity to word order information in state-of-the-art masked language models. recent research has focused on the impact of word order perturbation during the evaluation of models trained on well-ordered data. the results show that masked language models exhibit a catastrophic lack of sensitivity to word order permutations or shuffles, even for complex tasks in which task-relevant syntactic properties are completely destroyed @xcite @xcite . these studies show that models are still predicting the gold label for examples even after sequences have been permuted, and they also do so with high confidence @xcite . this anomalous behaviour can potentially result in undesirable shortcuts or can cause models to fail catastrophically in simple adversarial settings. furthermore, @xcite study the effect of pre-training masked language models on shuffled data, and suggest that the model might simply be capturing higher-order word co-occurrence statistics, rather than uncovering sophisticated semantic and syntactic structures necessary for language understanding. in this paper, we present a simple, yet general approach called forced invalidation (fi), where we force models to explicitly identify sequence permutations ( §3). while our proposal is extensible to multiple types of models, here we present a controlled study over masked language model-based bert models, and attention-based models over word-embeddings ( §4). we present a large battery of experiments over a variety of natural language understanding tasks in the english language, including complex question answering based tasks, natural language inference based tasks and commonsense reasoning based tasks. results show that our proposal significantly improves the sensitivity of the models to word-order information ( §5). ## related work recent work has proposed a few mitigation strategies for classification-type tasks: pham et al. (2020) proposes improving word-order sensitivity by including a precursor fine-tuning step on synthetic cola-like tasks before finetuning for downstream tasks. while this improves their defined word order sensitivity score, accuracy on permuted samples remains significantly above chance, making this approach unreliable. @xcite present three approaches: one based on entropy regularisation, another on model probabilities thresholding, and finally an approach based on augmenting additional data consisting of destructive transformations, which include 1-gram permutations. the model is modified with an additional class to identify these destructive transformations. while the first two approaches require changes to model setup, the last one is based on a set of manual heuristics. our approach has some similarity with the latter, however, our permutations are based on the principals borrowed from the n-gram language modelling literature @xcite , where the n-grams capture sufficient first-order statistics of the language. our approach significantly reduces the models' reliance only on simple firstorder statistics of language, and our empirical observations demonstrate the generalisability of our approach to various settings. ## methodology: forced invalidation our method is grounded on recent observations which show that masked language models and other similar models tend to exploit shortcuts based on information about distributional word vicinity information for a diverse set of natural language processing tasks @xcite . these shortcuts tend to make the models less sensitive to word-order information even for tasks that require the preservation of word ordering for accurate recovery of meaning @xcite . @xcite , in particular, show the insensitivity on a variety of n-gram based permutations of samples, where the authors specifically experiment with {1,2,3}-gram permutations. further, {1,2,3}-gram based permutations capture a variety of word vicinity based patterns and also capture some of the most frequently occurring unigram, bigram and trigram patterns in a variety of benchmark datasets. based on these salient observations, for each given dataset, the forced invalidation (fi) methodology consists of the following two steps: we observe that this simple fi approach improves the sensitivity of the model to word order and also improves the robustness of the models across a variety of tasks to first-order shortcuts. in the following sections, we present a rigorous experimental study that showcases the utility of fi. ## experimental settings data to generate n-gram permutations, we simply subsample from the training dataset, such that the ratio to the valid samples (samples with correct word order and the task-specific label) and invalid samples (samples with permuted n-grams and the invalid label) is 1-1. the invalid samples are generated such that they contain a uniform distribution of {1,2,3}-gram permutations. foot_1 furthermore, we split the training set such that we use 90% of the samples for training the models and the remaining 10% is used as a development set. the development set is used to monitor training and perform early-stopping. evaluations are done on a separate unseen task-specific validation set provided by the dataset creators. we perform two evaluations: well-ordered and permuted. the first one is the standard evaluation of the model over the original unperturbed taskspecific unseen validation set. for our experimental evaluations over permutations, we retain the original label of the same unseen validation set, but we permute the specific components of samples (e.g., premise or the hypothesis, question or the passage, etc.); we expect the models to reject the permuted sample instead of predicting the same ground-truth label. this setup allows us to evaluate the sensitivity of the model to word-order permutations of various degrees over the different components of the data. ## conclusion in this paper, we presented a simple yet general technique called forced invalidation, that significantly improves the sensitivity of models towards word order information. our methodology requires minimal changes to the model and is sample efficient and drastically increases the sensitivity of the models to permutations of word order for a variety of tasks. we present a focused empirical validation of our methodology to showcase its generalisability. while in this paper we have focused on masked language models and attentionbased models over word embeddings, we expect fi to generalise for other modelling setups such as rnn-based and cnn-based models and leave it as future work. we anticipate that this approach will also serve as a solution for other undesired behaviors in the model by explicitly invalidating such behaviours. we leave this as future work.