Prompt Perturbation Consistency Learning for Robust Language Models (2024)

Abstract: Large language models (LLMs) have demonstrated impressive performance on a number of natural language processing tasks, such as question answering and text summarization. However, their performance on sequence labeling tasks such as intent classification and slot filling (IC-SF), which is a central component in personal assistant systems, lags significantly behind discriminative models. Furthermore, there is a lack of substantive research on robustness of LLMs to various perturbations in the input prompts. The contributions of this paper are three-fold. First, we show that fine-tuning sufficiently large LLMs can produce IC-SF performance comparable to discriminative models. Next, we systematically analyze the performance deterioration of those fine-tuned models due to three distinct yet relevant types of input perturbations - oronyms, synonyms, and paraphrasing. Finally, we propose an efficient mitigation approach, Prompt Perturbation Consistency Learning (PPCL), which works by regularizing the divergence between losses from clean and perturbed samples. Our experiments show that PPCL can recover on an average 59% and 69% of the performance drop for IC and SF tasks, respectively. Furthermore, PPCL beats data augmentation approach while using ten times fewer augmented data samples.

## introduction voice controlled smart personal assistants like amazon echo and google home have flourished in recent years, enabling goal-oriented conversations and aiding tasks like setting reminders, checking weather, controlling smart devices, and online shopping. a core capability of those systems is to perform accurate and robust intent classification (ic) and slot filling (sf) @xcite . the ic task involves identifying the speaker's desired intent from a given utterance, * this work was done while interning at amazon. while the sf task involves recognizing the key arguments of the intent. for instance, given a user query "wake me up at five am this week.", the intent is 'set alarm', while the sf component should identify the specific details, such as 'five am' as time and 'this week' as date for the alarm setting. pre-trained llms hold promise of greatly improving personal assistant systems, owing to their impressive conversational and reasoning capabilities. in addition to generating fluent conversations, llms have shown sota performance on a variety of natural language processing (nlp) tasks such as text classification, question answering, text summarization @xcite . furthermore, some llms have shown promising ability to generate structured outputs such as code synthesis @xcite and api calls @xcite . however, the performance of llms on other structured prediction tasks such as slot filling lags significantly behind. another important issue is that llms can be highly sensitive to prompt variations @xcite @xcite . for instance, varying the order of few-shot examples, introducing minor typos or different expressions with the same semantic meaning can lead to qualitatively different results @xcite @xcite . in conversational systems, such perturbations might be caused by automatic speech recognition (asr) errors, linguistic differences, and userspecific expressions. thus, adopting llms for voice-based personal assistants requires a good understanding of their robustness to above types of perturbations, and effective mitigation to have robust llm-based ic-sf models. in this paper we mainly consider the following questions: (1) how can we close the performance gap between llms and sota discriminative models on ic-sf tasks? (2) how does the performance of llms change due to minor changes in the origi-figure 1 : illustration examples. llms are expected to generate structured hypotheses, i.e., domain, intent, and slots, in their responses to given user requests. model prediction (shown in red) changes for minor perturbance. to address the first question, we explore supervised fine-tuning (sft) for the ic-sf task, where the base llm is asked to generate a target output based on an input query. we conduct extensive experiments on three publicly available nlu benchmark datasets (atis, snips, massive) and show that by combining prompt selection and sft on moderately sized datasets, llms can learn to generate structured ic-sf hypotheses with accuracy that is on par with sota discriminative method. next, we analyze the robustness of the fine-tuned models to three different types of input perturbations that are relevant in the context of voice assistant systems -oronyms, synonyms, and paraphrasing. we find that all three types of perturbations negatively impact the model performance, resulting in a significant performance drop on ic-sf tasks. finally, we propose a novel framework that we call prompt perturbation consistency learning, or ppcl, to improve the robustness of llms against perturbations. our framework (1) generates perturbed counterparts given the original utterance by either replacing a small subset of tokens or paraphrasing the utterance while constraining the semantic similarity, (2) fine-tunes llms with an additional consistency regularization term in the objective which explicitly encourages the model to generate consistent predictions for the original utterance and its perturbed counterpart. we conduct extensive experiments and demonstrate that ppcl can recover on an average 59% and 69% of the dropped performance for ic and sf tasks against perturbations, respectively. furthermore, our results indicate that ppcl outperforms simple data augmentation approach while using only 10% of augmented dataset. ## related work intent classification and slot filling various techniques have been explored for intent classification @xcite @xcite , with recent work focusing on transformer-based models and transfer learning with pre-trained language models @xcite . slot filling, on the other hand, is typically approached using sequence labeling models, such as conditional random fields (crfs), bidirectional lstms, and transformer-based architectures @xcite @xcite . for a recent survey of joint ic-sf methods, see @xcite data augmentation in nlp tasks, data augmentation methods have been explored to generate new instances by manipulating a few words in the original text @xcite . some common techniques include word replacement, random deletion, and word position swap @xcite . additionally, data augmentation in nlp can involve creating entirely artificial examples using back-translation @xcite or generative models like variational auto-encoders @xcite . data augmentation has also become popular for ner tasks and has been shown to be effective strategy for boosting model performance @xcite @xcite . consistency training consistency training methods aim to improve the robustness of models by enforcing the stability of their predictions under small perturbations, such as random noise, adversarial noise, or data augmentation techniques, applied to input examples or hidden states. several attempts have been made to implement consistency training in ner tasks, utilizing both token-level and sequence-level approaches. token-level consistency involves regularizing the model to remain unaffected by gaussian noise @xcite or word replacement, operating at the same granularity as ner @xcite . however, using such simplistic noise or augmentation methods may violate the assumption that the noised tokens should retain the same labels as the original tokens. alternatively, a sequencelevel consistency method employs high-quality augmentation, like back-translation, to enhance consistency across the entire sentence @xcite . nonetheless, this approach overlooks the precise location of entities due to word alignment issues, leading to a sub-optimal design. more recently, conner has been proposed to foster consistent predictions between a span of tokens in the original sentence and their corresponding projection in a translated sentence @xcite . unfortunately, conner's applicability is confined to cross-lingual ner tasks. consistency training for fine-tuning llms on ic-sf tasks has not been thoroughly explored yet. ## conclusion we study, evaluate, and improve the robustness of llms in generating structured hypotheses, such as ic-sf tasks. we first propose a sentinel-based structured prompt format for instruction fine-tuning llms resulting in comparable performance to sota discriminative models. next, we evaluate robustness of llms under various prompt perturbations, i.e., synonyms, oronyms, and paraphrases. our results indicate that llms are vulnerable to these perturbations, with an average performance drop rate of 13.07% in ic accuracy and 22.20% in sf f1-score. we then propose two mitigation strategies, i.e., perturbation consistency learning and data augmentation, aiming to improve model robustness. these methods can recover up to 59% performance drop in ic task and 69% in sf task, making the resulting llms more robust to prompt perturbations. finally, our findings show that ppcl surpasses the basic data augmentation method, achieving superior performance with just 10% of the augmented datasets, thereby exhibiting enhanced scalability.