Are Sample-Efficient NLP Models More Robust? (2023)

Abstract: Recent results in image classification and extractive question answering have observed that pre-trained models trained on less in-distribution data have better out-ofdistribution performance. However, it is unclear how broadly these trends hold. We conduct a large empirical study across three tasks, three broadly-applicable modeling interventions (increasing model size, using a different adaptation method, and pre-training on more data), and 14 diverse datasets to investigate the relationship between sample efficiency (amount of data needed to reach a given ID accuracy) and robustness (how models fare on OOD evaluation). We find that higher sample efficiency is only correlated with better average OOD robustness on some modeling interventions and tasks, but not others. On individual datasets, models with lower sample efficiency can even be more robust. These results suggest that general-purpose methods for improving sample efficiency are unlikely to yield universal OOD robustness improvements, since such improvements are highly dataset- and task-dependent. Even in an era of large, multi-purpose pre-trained models, task-specific decisions may often be necessary for OOD generalization.

## introduction nlp models perform well when evaluated on data drawn from their training distribution (indistribution / id), but they typically suffer large drops in performance when evaluated on data distributions unseen during training (out-of-distribution / ood; @xcite . how does exposure to id training examples affect the id-ood gap? if two models have the same id performance, will models trained on fewer id examples (higher sample efficiency) also have higher ood performance (higher robustness)? at one extreme, zero-shot models will not learn idspecific patterns because they are not exposed to any labeled id examples. similarly, few-shot models trained on very few id examples may also rely less on id-specific patterns; if a model never sees the token "cat" while training on snli, then it will not learn that its presence is spuriously predictive of the contradiction label @xcite . supporting this intuition, recent work in image classification @xcite and extractive question answering @xcite show that zero-shot inference and fewshot fine-tuning improve average robustness across a range of ood test sets. however, it is unclear how universal these trends are across various tasks and methods for reducing exposure to id examples, or how predictive they are for any individual test set of interest. figure 1 illustrates this central question. we conduct a broad empirical study over 14 datasets across three tasks to investigate the relationship between exposure to id training examples (sample efficiency) and robustness. we experiment with three modeling interventions that improve sample efficiency: (1) using natural language prompts for zero-shot prediction and during finetuning @xcite @xcite ; (2) fine-tuning models of increasing size; (3) fine-tuning models pre-trained on increasing amounts of data. we find that higher sample efficiency is only sometimes correlated with better robustness, and the effect of specific modeling interventions varies by task. for example, increasing pre-trained model size substantially improves sample efficiency and results in higher average robustness in sentiment experiments, but these sample efficiency gains do not translate to higher average robustness in nli and extractive qa experiments. on individual datasets, models with better sample efficiency can even be less robust (e.g., increasing model size when training on sst-2 and evaluating ood on imdb). overall, these results indicate that general-this study, we focus on ood performance improvements beyond what is expected from id gains. satisfying this equivalent-id constraint is often difficult in practice; given an arbitrary model m 1 and its corresponding id performance, it is difficult to produce a different model m 2 with identical id performance. rather than explicitly training models to identical id performance, we train models on varying-size subsamples of a given id dataset and interpolate between the results to estimate (1) the number of labeled id training examples necessary to achieve a particular id performance (sample efficiency) and (2) ood performance, given id performance (robustness). these interpolated curves approximate the ideal setting of training a model for every possible id value. figure 1 provides a schematized example, with model b having better sample efficiency and robustness than model a. ## experimental setup we study three modeling interventions-using natural language prompts, increasing pre-trained model size, and pre-training on more data-on 14 total datasets spanning natural language inference (nli), sentiment analysis, and extractive question answering (qa). see appendix a for further details about experimental settings. ## results and discussion our results show that models with higher sample efficiency may not necessarily have higher average ood robustness-different tasks and modeling interventions affect robustness in different ways (figures 2-4). for example, prompt-based fine-tuning consistently improves both sample efficiency and average robustness, but only in low-data settings (figure 2 ). in contrast, increasing model size improves sample efficiency across the range of training dataset sizes and tasks, but only improves average robustness on sentiment analysis (figure 3 ). on individual datasets, we even observe cases where models with lower sample efficiency have higher robustness (figure 3d ). see appendix c for full results on every id-ood setting. ## conclusion we study the relationship between sample efficiency and robustness across three tasks and three modeling interventions, finding that sample efficiency improvements often fail to translate to improved robustness. as larger models quickly become more sample efficient, our results caution that sample efficiency and robustness are different axes of improvement and that optimizing for sample efficiency will not necessarily always yield robustness gains.