Sarcasm-R1: Enhancing Sarcasm Detection through Focused Reasoning (2025)

Abstract: Sarcasm detection is a crucial yet challenging task in natural language processing. Existing methods primarily rely on supervised learning or prompt engineering, which often struggle to capture the complex reasoning process required for effective sarcasm detection. This paper proposes a novel approach that decomposes sarcasm detection into three fundamental dimensions: language, context, and emotion, meticulously modeling the sarcasm reasoning process. To enhance the quality of reasoning, we employ reinforcement learning algorithms and design customized reward models for each dimension. We utilize five widely used sarcasm detection datasets and annotate the sarcasm reasoning process from these three dimensions to improve the performance of the reward models. Experiments demonstrate that our method outperforms state-of-the-art baseline methods in most cases. Additionally, we observe the central role of emotional contrast in sarcasm detection. Our research provides empirical insights into the mechanism of sarcasm, emphasizing that emotional contrast is at its core, supported by linguistic and contextual cues.

## introduction in recent years, large language models (llms) have demonstrated exceptional performance in natural language processing (nlp) tasks, particularly excelling in "system 1" fast-thinking tasks such as sentiment classification and topic analysis, which require rapid and intuitive processing capabilities @xcite . however, these models still face significant challenges in "system 2" slowthinking tasks, which demand slow, deliberate, and multi-step reasoning, such as logical inference and commonsense reasoning @xcite . as a quintessential "system 2" task, sarcasm detection requires models to go beyond literal meanings and just possibly sprained my ankle on south campus. my tuesday has been going so swimmingly. the phrase "going so swimmingly" is an idiom that usually means things are going very well. the context of the situation is that the person has just sprained his ankle, which is a painful and inconvenient injury. "south campus" suggests this might be a student, where a sprained ankle could disrupt their daily activities. the contrast between the negative event "spraining an ankle" and the positive phrasing "going so swimmingly" creates a strong emotional reversal. figure 1: this is an example of sarcastic reasoning for a piece of sarcastic text. "lin.", "con.", and "emo." represent reasoning in the linguistic dimension, contextual dimension, and emotional dimension, respectively. to tackle this question, we draw on insights from linguistic cognition @xcite @xcite @xcite and decompose sarcasm detection into three critical dimensions: language, context, and emotion, see figure 1 . starting from the definition of sarcasm in cognitive linguistics, we abstract the three dimensions of sarcasm. experimental results show that dividing the analysis of sarcasm into these three dimensions can help the model make correct inferences in most cases. this approach systematically guides the reasoning process of large models and is grounded in the cognitive mechanisms humans employ to comprehend sarcasm: linguistic dimension: this focuses on rhetorical devices and expressive features (e.g., keywords, irony, hyperbole, punctuation), which serve as foundational cues for sarcastic expressions. contextual dimension: this examines the text's topic, cultural background, and commonsense knowledge, enabling the model to grasp the contextdependent nature of sarcasm. emotional dimension: this targets emotional expressions and their reversals (e.g., positive emotions masking negative intentions), uncovering the hidden emotional intent behind sarcasm. to further enhance reasoning quality, we employ a typical reinforcement learning (rl) algorithm, group relative policy optimization (grpo) @xcite , and design custom reward models for the three dimensions of language, context, and emotion. these reward models guide the model to focus on the core features of each of the three dimensions of language context and emotion during reasoning. through interaction with the environment, rl optimizes the policy model, enabling it to gradually master complex sarcasm detection capabilities. compared to traditional supervised learning, this approach more effectively simulates the human thought process for sarcasm, significantly improving detection performance. to support this method, we refer to the work of @xcite ; @xcite and provide detailed annotations of the sarcasm reasoning process based on the above three dimensions on five mainstream sarcasm detection dataset. these annotations not only improve the reliability of the reward models, but also provide clear guidance for model reasoning, thereby improving the effectiveness of rl. experimental results show that our method outperforms the most advanced baseline methods on these five datasets, showing significant advantages. ablation experiments further reveal the central role of emotional reversal in sarcasm detection. this observation helps us deeply understand the mechanism of sarcasm generation. in summary, the contributions of this paper are as follows: ## related work with the rise of deep learning, pre-trained language models such as bert @xcite and roberta @xcite have been widely applied to sarcasm detection tasks. these models capture rich linguistic representations through pretraining on large corpora and achieve significant performance improvements when fine-tuned on sarcasm detection datasets. for instance, @xcite propose an unsupervised method that uses masking and generation techniques to uncover sarcastic cues in text; @xcite employ attention mechanisms to analyze sarcasm from multiple perspectives; and @xcite design a dual inconsistency-aware network focusing on linguistic and emotional inconsistencies. these approaches have improved the accuracy of sarcasm detection by enhancing the model's understanding of linguistic features and context. in recent years, multimodal methods have gained attention in social media contexts @xcite , as sarcasm is often expressed through multiple modalities such as text, images, or videos. for example, @xcite introduce a multi-task framework that combines textual and visual information to simultaneously detect sentiment, emotion, and sarcasm in memes for cyberbullying identification. similarly, @xcite use contrastive learning to reduce bias in multimodal sarcasm detection. while these methods excel at handling multimodal data, their primary focus is on eliminating differences between modalities, leaving the exploration of the reasoning process behind sarcasm insufficient. the advent llms, such as llama @xcite and qwen @xcite , marks a new phase in sarcasm detection research. studies have shown that carefully designed prompt strategies enable llms to better understand the implicit intent of sarcasm. for instance, @xcite investigates whether sarcasm detection requires step-by-step reasoning and propose four prompt strategies that significantly outperform standard prompting methods. @xcite develops a framework that integrates multiple contextual cues, demonstrating that sequentially adding context can substantially improve performance. @xcite enhances the construction of emotion dependency graphs by incorporating commonsense knowledge, while @xcite uses commonsense reasoning to capture emotional inconsistencies. these works indicate that llms have potential in handling the semantic complexity and emotional contrasts of sarcasm, but systematically guiding their reasoning process requires further exploration. recent research has shown that rl can significantly enhance the performance of llms in complex reasoning tasks. for example, @xcite demonstrates naturally emerging reasoning capabilities under unsupervised finetuning through rl training. the grpo algorithm introduced in deepseekmath @xcite improves model performance in mathematical reasoning tasks, providing an efficient rl method for our sarcasm detection task. additionally, research on "slow-thinking" @xcite reveals a mechanism for reducing error accumulation by extending reasoning time and refining steps, supporting our strategy of decomposing sarcasm detection into language, context, and emotion dimensions. in summary, although the field of sarcasm detection has made progress with pre-trained models, multimodal methods, and llms, existing studies still lack systematic guidance for the reasoning process and have limit exploration of the working mechanism of sarcasm. inspired by the aforementioned research, this study combines rl and slowthinking methods to optimize the model's sarcasm reasoning ability and explore the working mechanism of sarcasm. ## methodology this section introduces the training method of our sarcasm detection model, sarcasm-r1. the discus-sion encompasses three key aspects. initially, it provides a concise overview of the grpo algorithm that we have employed in our approach. following this, it elaborates on the training methodology for our reward model, where we have crafted distinct reward models tailored to the dimensions of language, context, and emotion-collectively termed sargrm for simplicity, as their training processes are uniform. the names of these three reward models are lingrm, congrm and emogrm. finally, the section delves into our data synthesis strategy, which is a three-step process of synthesizing data using llms and supplemented by human intervention. and offering detailed statistical insights into the sarcasm-reason dataset we have proposed. the framework diagram of this process is shown in figure 2 . ## experiments we conduct extensive experiments to evaluate the performance of our method. on this basis, we evaluate the contribution of the quality of reasoning in different dimensions to the final sarcasm prediction through ablation experiments. the details of the experiment implementation are shown in the appendix a, including the training details of sar-grm and sarcasm-r1, and the model used for data synthesis. ## conclusion this study aims to study the working mechanism of sarcasm. first, we decompose sarcasm into three dimensions: language context and emotion. by using reinforcement learning algorithms, we design reward models for each of these three dimensions to enhance the model's reasoning ability for sarcasm. in order to improve the reliability of the reward model, we propose the sarcasm-reason dataset and rely on repeated sampling methods to expand the performance of the reward model. our method outperforms traditional methods and achieves the best accuracy on all five datasets, which proves the rationality of our method. finally, we rely on experimental observations to summarize the working mechanism of sarcasm from the above three dimensions.