Prompt Tuning with Contradictory Intentions for Sarcasm Recognition (2023)

Abstract: Recently, prompt tuning has achieved promising results in a variety of natural language processing (NLP) tasks. The typical approach is to insert text pieces (i.e. templates) into the input and transform downstream tasks into the same form as pre-training. In essence, a high-quality template is the foundation of prompt tuning to support the performance of the converted cloze-style task. However, for sarcasm recognition, it is time-consuming and requires increasingly sophisticated domain knowledge to determine the appropriate templates and label words due to its highly figurative nature. In this work, we propose SarcPrompt, to incorporate the prior knowledge about contradictory intentions into prompt tuning for sarcasm recognition. SarcPrompt is inspired by that the speaker usually says the opposite of what they actually mean in the sarcastic text. Based on this idea, we explicitly mimic the actual intention by prompt construction and indicate whether the actual intention is contradictory to the literal content by verbalizer engineering. Experiments on three public datasets with standard and low-resource settings demonstrate the effectiveness of our SarcPrompt for sarcasm recognition.

## introduction sarcasm is a sophisticated language phenomenon in which one conveys implicit intention with the opposite meaning of what is said or written literally @xcite . due to its high ambivalence and figurative nature, sarcasm recognition which targets to predict a text as sarcastic or non-sarcastic, becomes a particularly challenging classification task. with the usage of sarcasm becoming prevalent on social media platforms like microblogs and online forums, sarcasm recognition has received growing research attention to facilitate sentiment analysis applications. recent advances have shown that pre-trained language models (plms), such as roberta @xcite , bert @xcite , can achieve promising performance in many downstream natural language processing (nlp) tasks @xcite @xcite . the success of plms has also attracted much attention for sarcasm recognition. researchers mainly add extra classifiers on top of plms @xcite to further train the models under classification objectives, or re-train popular plms by incorporating sentiment knowledge and external sarcastic corpus @xcite . despite fine-tuning has achieved satisfying results, some recent studies @xcite have found that one of its critical challenges is the significant gap in objective forms between pre-training and fine-tuning. this largely limits the transfer and adaptation of knowledge in plms to downstream tasks. recently, a series of studies propose to use prompt tuning @xcite @xcite to bridge the gap between pre-training and fine-tuning. specifically, the downstream task is formulated as a (masked) language modeling problem similar to the pre-training. by fusing the original input with the specially constructed prompt template to predict @xcite and then mapping predicted words to corresponding labels, we can stimulate the task-related knowledge in plms to boost the model's performance. nevertheless, there are still several non-trivial challenges for sarcasm recognition with prompt tuning as follows. on the one hand, texts of a specific task can differ from that of plms used in prompt tuning @xcite . for sarcasm recognition, the sarcastic data is usually composed of abundant deliberately ambiguous texts. in contrast, the corpora for plms in prompt tuning mainly include objective and deterministic texts @xcite . this greatly restricts plms from taking full advantage of their knowledge. on the other hand, though prompt tuning works well in text classification tasks, prompt templates and verbalizer are not easily transferable to sarcasm recognition. both handcrafting an appropriate prompt template and choosing effective label words require domain expertise in sarcasm language. furthermore, there exists deliberate ambiguity in sarcasm and the special written content cannot be ignored. in this sense, we argue that the power of prompt tuning has not been fully exploited for sarcasm recognition. shed light by the above challenges and insights, in this paper, we propose sarcprompt, a novel prompt tuning method to leverage the contradiction knowledge-enhanced prompts to tune the plms. sarcprompt is inspired by that sarcasm is known as "the activity of saying or writing the opposite of what you mean" @xcite . according to this definition, we can recognize sarcasm by evaluating the inconsistency between the actual intention and the literal content in sarcastic texts. based on intention contradiction, we carefully devise the prompt templates that can mimic the speakers' actual intention and then select label words to judge whether the prompt is contradictory to the literal content. take the sentence in figure 1 as an example, the original input is "i love being ignored". a good prompt template may denote "actually [mask]". "actually" is an indicator to trigger the authentic intention. if plms predict the masked position with a good label word "kidding", the new completed sentence denotes "i love being ignored. actually kidding.". the intention of the prompt template completed with the predicted word is contradictory to the original input's content. then we can intuitively recognize a sarcastic text. to be specific, sarcprompt mainly contains two steps: prompt construction and verbalizer engineering. firstly, in the stage of prompt construction, we devise two kinds of sarcasm-specific prompts with different patterns to mimic the actual intention straightforwardly. secondly, during the verbalizer engineering, we determine the label words that trig-ger contradictory or suggest sarcasm based on the statistical information of sarcastic corpora. furthermore, we investigate a contrastive loss to comprehend various sarcastic contrast patterns, jointly with the cross-entropy loss for optimization. the contrastive loss strives to pull the representation of a sarcastic text towards that of other sarcastic texts in the same mini-batch, while pushing it away from representations of other non-sarcastic texts. we conduct extensive experiments on three benchmark datasets for sarcasm recognition. empirical experimental results demonstrate that our sarcprompt foot_0 has achieved state-of-the-art performance under both standard supervised settings and low-resource settings. ## related work in this section, we briefly review two lines of related work, including sarcasm recognition and prompt tuning. ## background before introducing sarcprompt, we first briefly review the regular prompt tuning method for sentiment classification. formally, let m be a masked language model with vocabulary v and mask token [mask] ∈ v , and let y be the set of labels for sentiment classification. traditional classification methods including finetuning plms train a model to take in an input @xmath0, x 1 , . . . , x n ), generate a probability distribution over class y and predict an output y as p (y|x). as for prompt tuning, the input x is wrapped with a prompt template. for example, assuming we need to classify the input sentence @xmath1, the prompt template is defined as "it is @xcite .". this is a general template widely accepted and used in text classification tasks @xcite , which is also applicable to sarcasm recognition task. then the wrapped input is then m generates a probability over vocabulary v on position @xcite , which gives the probability of each token @xmath2. furthermore, a verbalizer is to map from label word set v @xmath3. corresponding to the above prompt, we may define v @xmath4, v @xmath5. then the probability of label y is calculated as ## sarcprompt in this section, we introduce our prompt tuning model for sarcasm recognition (sarcprompt) in detail. the overview of sarcprompt is shown in figure 2. we first introduce prompt construction and then verbalizer engineering. finally we elucidate the training objective. ## experimental results in this section, we report and analyze the experimental results to demonstrate the effectiveness of the proposed sarcprompt method. specifically, we target the following research questions: ## conclusion in this paper, we have proposed sarcprompt, a simple and effective prompt tuning method to recognize sarcasm in texts. specifically, we design several prompt templates to mimic the actual intention behind the sarcastic literal content. we define verbalizers based on the statistics of sarcastic corpus. then it is able to determine whether the prompt is contradictory to the literal content by the predicted label words. empirical experimental results show that sarcprompt achieves state-of-theart performance under both standard supervised settings and low-resource settings.