Venue: NAACL 2025

Commonality and Individuality! Integrating Humor Commonality with Speaker Individuality for Humor Recognition

 Haohao Zhu, Junyu Lu, Zeyuan Zeng, Zewen Bai, Xiaokun Zhang1 , Liang Yang, Hongfei Lin

School of Computer Science and Technology, Dalian University of Technology, China

{zhuhh, dutljy, zengzeyuan, dlutbzw}@mail.dlut.edu.cn

dawnkun1993@gmail.com, {liang,hflin}@dlut.edu.cn

Footnote 1: Corresponding author

###### Abstract

Humor recognition aims to identify whether a specific speaker's text is humorous. Current methods for humor recognition mainly suffer from two limitations: (1) they solely focus on one aspect of humor commonalities, ignoring the multifaceted nature of humor; and (2) they typically overlook the critical role of speaker individuality, which is essential for a comprehensive understanding of humor expressions. To bridge these gaps, we introduce the Commonality and Individuality Incorporated Network for Humor Recognition (CIHR), a novel model designed to enhance humor recognition by integrating multifaceted humor commonalities with the distinctive individuality of speakers. The CIHR features a Humor Commonality Analysis module that explores various perspectives of multifaceted humor commonality within user texts, and a Speaker Individuality Extraction module that captures both static and dynamic aspects of a speaker's profile to accurately model their distinctive individuality. Additionally, Static and Dynamic Fusion modules are introduced to effectively incorporate the humor commonality with speaker's individuality in the humor recognition process. Extensive experiments demonstrate the effectiveness of CIHR, underscoring the importance of concurrently addressing both multifaceted humor commonality and distinctive speaker individuality in humor recognition.

## 1 Introduction

Humor is a vital component of human communication and is crucial in the pursuit of creating human-like artificial intelligence. As the basis for machines to understand and respond to humor, humor recognition has been a challenging problem for researchers because of its inherent subjectivity, fuzziness and semantic complexity Annamoradnejad and Zoghi (2024) . Despite these obstacles, the promise of developing human-like artificial intelligence has continually drawn researchers to this field Weller and Seppi (2020); Zeng et al. (2024) .

Current humor recognition methods employ a range of neural network architecturesRen et al. (2022); Annamoradnejad and Zoghi (2024); Zeng et al. (2024) to automatically extract and learn semantic features for humor recognition. Despite significant advancements in humor recognition, current methods still face two main issues. Firstly, they typically focus on a single aspect of humor commonality in user text, neglecting the multifaceted nature of humor. Humorous expressions often encompass various facets of commonality Attardo (2017b). For example, they typically include diverse elements like semantic puns, pragmatic implicit meanings, and cognitive contradictions, as illustrated in the upper part of Figure 1. Overlooking these multifaceted characteristics of humor commonality can significantly limit a model's ability to fully understand user-generated humor. Secondly, existing methods often overlook the crucial role of

Figure 1: Humor exhibits multifaceted commonalities, with puns highlighted in red and cognitive contradiction in yellow. A speaker with distinctive individuality exhibits a unique humor expression style, highlighted in green.

 

speaker individuality. Humor is not only dependent on language but is also deeply influenced by the speaker's individuality such as social and cultural background, personality, and cognitive processes (Plessen et al., 2020; Zhu et al., 2024b, a). These characteristics shape each speaker's unique humor expression style, as illustrated in the lower part of Figure 1. Neglecting these individualized characteristics can greatly diminish a model's capability to effectively handle and interpret personalized expressions of humor.

Recognizing the need to address both the multifaceted commonality of humor expressions and the distinctive individuality of the speaker, we propose the Commonality and Individuality Incorporated Network for Humor Recognition (CIHR), which consists of four main components: Humor Commonalities Analysis, Speaker Individuality Extraction, Static Fusion and Dynamic Fusion.

Specifically, comprehensively analyze the commonality of humor from multiple perspectives, CIHR integrates a Humor Commonalities Analysis module that capitalizes on the interpretive capabilities of large language models (LLMs). This module employs prompts to direct LLMs in analyzing user language from six common perspectives of humor expression: semantic, pragmatic, syntactic, cultural, cognitive, and psychological. Meanwhile, to accurately model a speaker's distinctive individuality, the CIHR incorporates a Speaker Individuality Extraction module. This module captures both the static and dynamic information within a speaker's profile, allowing for a more comprehensive and accurate modeling of individual traits. To effectively incorporate the commonalities of humor with the speaker's individuality, CIHR is equipped with both Static and Dynamic Fusion modules. The Static Fusion module introduces Profile Guided Self-Attention (PG-SA) and Profile Guided Layer Normalization (PG-LN) to directly inject static profile information into the multi-perspective humor commonality analysis and dynamic profile text modeling processes. Meanwhile, the Dynamic Fusion module seamlessly integrates dynamic profile information into the multi-perspective humor commonality representation using attention mechanisms and gated neural networks. Together, these modules enable CIHR to effectively combine the commonality of humor and the individuality of the speaker in the recognition process.

Extensive experiments were conducted, confirming the effectiveness of CIHR in the task of humor recognition. The results demonstrate the necessity and effectiveness of simultaneously considering both the commonalities of humor and the individual characteristics of speakers during the humor recognition process. The main contributions of this paper are summarized as follows:

1. We deeply investigated the impact of both multifaceted humor commonality and distinctive speaker individuality on humor recognition, emphasizing the need for their integration to enhance this task.
2. We introduced Commonality and Individuality Incorporated Network for Humor Recognition (CIHR), designed to effectively combine the commonality of humor and the individuality of the speaker in the recognition process.
3. We conducted extensive experiments to validate the effectiveness of CIHR in humor recognition tasks, providing a detailed analysis of the impact and efficacy of each critical module within CIHR.

## 2 Related Work

Early humor recognition research predominantly utilized feature engineering and traditional machine learning techniques to identify linguistic and stylistic features of humorous textsYang et al. (2015); Liu et al. (2018). For example, Mihalcea and Strapparava (2005) employed features such as alliteration, antonyms, and adult slang to model humor, using classifiers like Naive Bayes (NB) and Support Vector Machines (SVM) Cortes (1995) for humor recognition. Raz (2012) explored grammatical, syntactic, semantic, and pragmatic features of humor texts, enriching the field of feature-based humor recognition. Liu et al. (2018) combined emotional and semantic analysis to model the emotional aspects of humor. While effective in some scenarios, these methods significantly struggle to capture the deep semantic and contextual nuances vital for understanding humor. Additionally, their reliance on manually designed features, which are labor-intensive to create and inflexible in application, further limits their effectiveness.

The advent of deep learning marked a significant shift towards using neural networks for automatic feature extraction. Additionally, the introduction of Transformer-based pretrained language models significantly enhanced the performance of humor recognition systems. For instance, Chen 

and Lee (2017) developed a CNN-based model to recognize humor in speeches and puns, outperforming traditional methods even without manually designed features. Weller and Seppi (2019) introduced the Transformer model, which further improved the ability to learn complex humor patterns and exhibited superior performance compared to other deep neural networks. Xie et al. (2021) utilized GPT Radford (2018) to calculate the inconsistency between punchlines in jokes, enhancing humor recognition based on these inconsistency scores. Annamoradnejad and Zoghi (2024); Yang et al. (2021) used pretrained BERT Kenton and Toutanova (2019) to obtain sentence embeddings for humor recognition. Zeng et al. (2024) leveraged social network information and graph neural networks to enhance humor recognition results.

Despite significant progress in humor recognition research, recent approaches tend to focus primarily on single semantic layers, struggling to analyze user language from the diverse common perspectives of humor expression. Additionally, a critical limitation of these methods is their neglect of the speaker's individual expression styles.

## 3 Problem Statement

The objective of humor recognition is to determine whether a specific speaker's text \(x\) is humorous or humorless. Formally, for a given speaker's text \(x\), the humor recognition model \(y=f(x)\) predicts whether the text is humorous (\(y=1\)) or humorless (\(y=0\)). As our approach aims to analyze user humor from both the perspectives of humor commonalities and speaker individuality, it is essential to incorporate additional user profile information. Accordingly, our inputs consist of the user text \(x\) and the user profile \(P_{x}\). Therefore, our humor recognition model is expressed as \(y=f(x,P_{x})\), where the user profile \(P_{x}=\{S_{x},D_{x}\}\) encompasses both static and dynamic aspects of the user profile. The static profile \(S_{x}\) contains stable attributes such as the user's gender, age, region, and personal descriptions. Conversely, the dynamic profile \(D_{x}\) consists of the user's historical posts that are regularly updated.

## 4 Methodology

The overall architecture of CIHR is illustrated in Figure 2. CIHR is structured around four main components: Humor Commonality Analysis module, Speaker Individuality Extraction module, Static Fusion module, and Dynamic Fusion module.

The Humor Commonality Analysis (HC) module leverages the powerful text interpretation capabilities of large language models to perform multi-perspective humor commonalities analyses for user texts. The Speaker Individuality Extraction (SI) module extracts both static and dynamic profiles from user profiles and embeds them to model the speaker's individuality with greater detail and accuracy. The Static Fusion (SF) module introduces Profile Guided Self-Attention (PG-SA) and Profile Guided Layer Normalization (PG-LN) to integrate information from the user's static profile into the text modeling process. As a result, through the SF, CIHR obtains a Static Profile Guided multi-perspective humor text representation and a Static Profile Guided dynamic profile representation. The **D**ynamic **F**usion (DF) Module leverages attention mechanisms and gated neural networks to produce a final text representation that effectively merges perspectives of commonality and individuality.

Finally, CIHR employs this dual-perspective text representation to determine whether user text is humorous. Detailed descriptions of each component follows in subsequent sections.

### Speaker Individuality Extraction

The SI module consists of Static Profile Extraction (SP) and Dynamic Profile Extraction (DP) modules to extract and embed static and dynamic profiles from user profiles, respectively, enabling a comprehensive and precise modeling of user individuality.

#### 4.1.1 Static Profile Extraction

The SP module processes textual and non-textual data separately within the static profile. For textual information, represented as \(S^{\prime}_{x}=\{s_{1},s_{2},...,s_{n}\}\), SP utilizes a standard text encoder BERT Kenton and Toutanova (2019) to derive its representation \(Z^{\prime}_{x}\in\mathbb{R}^{d^{\prime}}\), where \(d^{\prime}\) denotes the feature dimension of textual information:

\[Z^{\prime}_{x}=\text{BERT}(S^{\prime}_{x}) \tag{1}\]

For non-textual information, represented as \(S^{\prime\prime}_{x}\), SP normalizes it and employs a single-layer feed-forward neural network to achieve its embedded representation, yielding \(Z^{\prime\prime}_{x}\in\mathbb{R}^{d^{\prime\prime}}\), where \(d^{\prime\prime}\) denotes the feature count of non-textual information:

\[Z^{\prime\prime}_{x}=\text{Norm}(S^{\prime\prime}_{x})W_{s}+b_{s}, \tag{2}\]

where \(\text{Norm}(\cdot)\) denotes the normalization function, \(W_{s}\in\mathbb{R}^{d^{\prime\prime}\times d^{\prime\prime}}\), \(b_{s}\in\mathbb{R}^{d^{\prime\prime}}\) are trainable parameters.

 

Finally, the textual features \(Z^{\prime}_{x}\) and non-textual features \(Z^{\prime\prime}_{x}\) are concatenated and transformed into a unified static profile representation \(\mathbf{e}^{z}\in\mathbb{R}^{d}\):

\[\mathbf{e}^{z}=(Z^{\prime}_{x}||Z^{\prime\prime}_{x})W_{z}+b_{z}, \tag{3}\]

where \(W_{z}\in\mathbb{R}^{(d^{\prime}+d^{\prime\prime})\times d}\) and \(b_{z}\in\mathbb{R}^{d}\) are trainable parameters, and \((\cdot||\cdot)\) indicates concatenation along the final feature dimension.

#### 4.1.2 Dynamic Profile Extraction

For each dynamic post in the user's profile, denoted as \(D^{(i)}_{x}\), we first tokenize the text into subword sequences \(D^{(i)}_{x}=[d_{1},d_{2},...,d_{L}]\) using the WordPiece tokenizer Kenton and Toutanova (2019), where \(L\) is the maximum length of the text sequence. Special tokens [CLS] and [SEQ] are inserted at the beginning and end of each post, respectively. The token sequence is then converted into word embeddings \(e^{d}_{i}=[e^{d}_{i,1},e^{d}_{i,2},...,e^{d}_{i,L}]\in\mathbb{R}^{L\times d}\) using embedding technology along with additional positional embeddings.

By aggregating these embeddings, we obtain the dynamic profile embedding representation \(e^{d}=[e^{d}_{1},e^{d}_{2},...,e^{d}_{N_{d}}]\in\mathbb{R}^{N_{d}\times L \times d}\), where \(N_{d}\) represents the maximum number of historical texts in the dynamic profile.

### Humor Commonality Analysis

To analyze humor expressions within user texts from various perspectives of humor commonalities, we harness the powerful interpretative abilities of LLMs (GPT-3.5). We have identified six humor commonality perspectives from psychological literature Attardo (2017a, b) and use prompts to guide the LLMs to interpret user texts from these distinct perspectives. The process of obtaining specific humor commonality perspectives through prompts is outlined in Equation 4, with details on the six humor perspectives and corresponding prompts available in Appendix A.1.

\[a^{\prime}_{i}=\mathcal{L}(x,p_{i}), \tag{4}\]

where \(\mathcal{L}(\cdot)\) denotes the output of the LLM using prompts, and \(p_{i}\) represents the prompt template for a specific perspective. This process yields a set of humor analyses from \(N_{a}\) perspectives, \(A^{\prime}_{x}=(a^{\prime}_{1},a^{\prime}_{2},...,a^{\prime}_{N_{a}})\), where \(N_{a}=7\) indicates the number of identified humor commonality perspectives. The CIHR subsequently concatenates each perspective's analysis with the original text to create enhanced humor commonality texts \(A_{x}=(a_{1},a_{2},...,a_{N_{a}})\), where \(a_{i}=(x||a^{\prime}_{i})\).

Similar to the dynamic profile embedding process, we first tokenize the enhanced humor text \(a_{i}\) into subword sequences \(a_{i}=[a_{i,1},a_{i,2},\ldots,a_{i,L}]\) using the WordPiece tokenizer, inserting [CLS] and [SEQ] tokens at the beginning and end of each text, respectively. Uniquely, an additional [SEQ] token is inserted between the original text \(x\) and the analy

Figure 2: The overall architecture of the proposed CIHR model, which consists of four main module: Humor Commonalities Analysis, Speaker Individuality Extraction, Static Fusion and Dynamic Fusion.

 

is \(a_{i}\prime\) to serve as a paragraph delimiter. In addition to word and positional embeddings, we incorporate segment embeddings Kenton and Toutanova (2019) to distinguish between the original text and the humor analysis. These embeddings are summed to convert the token sequence into word embeddings \(e^{a}_{i}=[e^{a}_{i,1},e^{a}_{i,2},...,e^{a}_{i,L}]\in\mathbb{R}^{L\times d}\), thus forming a multi-perspective humor analysis embedding representation \(e^{a}=[e^{a}_{1},e^{a}_{2},...,e^{a}_{N_{a}}]\in\mathbb{R}^{N_{a}\times L\times d}\). Overall, the process of obtaining multi-view humor commonality analysis embeddings is summarized in Equation 5:

\[\begin{split} e^{a}&=\text{Embedding}(A_{x}),\\ A_{x}&=(a_{1},a_{2},...,a_{N_{a}}),\\ a_{i}&=(x||\mathcal{L}(x,p_{i}))\end{split} \tag{5}\]

### Static Fusion

The Static Fusion Module is implemented by stacking multiple SF-Layers, designed to incorporate the user's static profile information into the representations of both the user's dynamic profile and the multi-perspective humor analysis. This is achieved by guiding the entire text modeling process with the static profile.

As illustrate in Figure 3, the construction of SF-Layer is similar to a standard Transformer Encoder layer, which includes two main components: Multihead Self-Attention and a Feed-Forward Network, both integrated through a Residual Connection and Layer Normalization for enhanced deep information modeling.

The distinction lies in CIHR's replacement of the standard Self-Attention and Layer Normalization with Profile Guided Self-Attention (PG-SA) and Profile Guided Layer Normalization (PG-LN). This modification enables the model to incorporate static speaker profiles into the text modeling process. By employing PG-SA and PG-LN, the SF Module effectively merges the user's static profile with the text representation, resulting in a Static Profile-Guided humor commonalities analyses representations and Static Profile-Guided dynamic profile representations.

For a more detailed formulation of the SF-Layer, including PG-SA and PG-LN, please refer to Section A.3. The encoding process in the \(n\)-th Static Fusion Layer is depicted as follows:

\[\mathbf{h}^{(n)}=\text{SF-Layer}^{(n)}(\mathbf{h}^{(n-1)},\mathbf{e}^{z}), \tag{6}\]

where \(\mathbf{h}^{(n-1)}\in\mathbb{R}^{L\times d}\) is the output of the \(n-1\)th layer and the input to the \(n\)-th layer, and \(h^{(0)}\) represents the initial embedding, either \(e^{d}_{i}\) or \(e^{a}_{i}\). Overall, the text representation process utilizing n-layer Static Fusion Module based on PG-SA and PG-LN can be abstracted as shown in Equation 7:

\[\textbf{h}^{(n)}=\text{SF}(\textbf{h}^{(0)},\mathbf{e}^{z}) \tag{7}\]

Using this formula, we can derive representations for each user-specific post in the dynamic profile, \(\textbf{h}^{d}_{i}=\text{CLS}(\text{SF}(\mathbf{e}^{d}_{i},\mathbf{e}^{z}))\), and for text combined with multi-perspective humor analysis, \(\textbf{h}^{a}_{i}=\text{CLS}(\text{SF}(\mathbf{e}^{a}_{i},\mathbf{e}^{z}))\). Here, \(\text{CLS}(\cdot)\) extracts the representation at the [CLS] token position, allowing us to collect complete user-specific dynamic profile features, \(\textbf{h}^{d}=[\textbf{h}^{d}_{1},\textbf{h}^{d}_{2},\dots,\textbf{h}^{d}_{ N_{d}}]\), and multi-perspective text features combined with humor analysis, \(\textbf{h}^{a}=[\textbf{h}^{a}_{1},\textbf{h}^{a}_{2},\dots,\textbf{h}^{a}_{N_{a }}]\).

### Dynamic Fusion

The Dynamic Fusion module is designed to further integrate the user's dynamic profile into the text representation enriched with humor commonality analysis. Utilizing attention mechanisms and gated networks, it achieves a dual-perspective representation that merges both humor commonality and speaker individuality.

Drawing inspiration from Lyu et al. (2023), who enhanced sentiment analysis by incorporating user context through attention mechanisms, we first employ Multi-head Attention (MHA) Vaswani (2017) to derive text representations guided by the user's dynamic profile. For the MHA\((Q,K,V)\), the multi-perspective humor analysis representation \(\textbf{h}^{a}\) serves as the query, and the dynamic profile

Figure 3: Static Fusion Layer



representation \({\bf h}^{d}\) functions as both key and value:

\[{\bf h}^{p}=\text{MHA}({\bf h}^{a},{\bf h}^{d},{\bf h}^{d}) \tag{8}\]

To prevent the model from overly relying on dynamic profile information and neglecting current contextual data, a gated network is introduced to dynamically coordinate the influence of the dynamic profile guided humor analysis \({\bf h}^{p}\) and the multi-perspective humor analysis \({\bf h}^{a}\) on the final prediction. This gating mechanism allows for flexible learning from both representations to make the final humor assessment. Subsequently, we apply average pooling to aggregate the representations across multiple perspectives of humor analysis, yielding a final fused representation that embodies both humor commonality and speaker individuality:

\[{\bf h}^{o} =\alpha{\bf h}^{x}+(1-\alpha)\tilde{\bf h}^{x}, \tag{9}\] \[\alpha =\sigma([{\bf h}^{x}||\tilde{\bf h}^{x}]W+b),\]

where \({\bf h}^{x}=\frac{1}{N_{a}}\sum_{i}^{N_{a}}{\bf h}_{i}^{a},\tilde{\bf h}^{x}= \frac{1}{N_{a}}\sum_{i}^{N_{a}}{\bf h}_{i}^{p}\), with \(W\in\mathbb{R}^{2d\times 1}\) and \(b\) as a learnable parameters.

Through these mechanisms, the Dynamic Fusion module ensures that the final representation effectively integrates humor commonality and speaker-specific information, enhancing the model's ability to accurately assess humor.

### Prediction and Objective

Based on the final user text representation \({\bf h}^{o}\), which integrates both humor commonality and speaker individuality, we deploy a single-layer feed-forward network as a classifier to recognize humor:

\[\hat{y}=\mathrm{softmax}\left({\bf h}^{o}W_{o}+b_{o}\right), \tag{10}\]

where \(W_{o}\in\mathbb{R}^{d\times 2}\) and \(b_{o}\in\mathbb{R}^{2}\) are trainable parameters.

During the training phase, we optimize the parameters of the CIHR by minimizing the cross-entropy loss, which quantifies the discrepancy between the predicted probability distribution and the actual humor labels. The objective function is defined as:

\[\mathcal{L}=\frac{1}{N_{x}}\sum_{i=1}^{N_{x}}(y_{i}\log{(\hat{y}_{i})}+(1-y_{ i})\log{(1-\hat{y}_{i})}), \tag{11}\]

where \(N_{x}\) represents number of training samples.

## 5 Experimental Settings

### Dataset

For effective humor recognition that integrates both humor commonalities and speaker individuality, our required dataset must include not only humorous texts with corresponding labels but also comprehensive user information, such as gender, age, region, and posting history. However, upon reviewing many popular humor recognition datasets, we found that they lack this essential user information. We discovered that the HumorWB dataset, mentioned in Zeng et al. (2024), includes not only labels identifying humor but also detailed user profiles, making it ideal for validating our approach.

Therefore, we selected the HumorWB dataset to evaluate our model and to test the feasibility and effectiveness of recognizing humor by considering both humor commonalities and speaker individuality. The HumorWB dataset is sourced from Weibo, the largest Chinese social media platform, and includes 5,291 text entries from 2,151 users (of which 2,010 texts are marked as humorous) along with personal information such as the users' gender, age, region, and historical posts. For detailed data statistics, please refer to A.4.

### Baseline Methods

To evaluate the performance of our CIHR model, we selected several advanced baseline models for comparison. These include both traditional machine learning models (SVM and LR) and deep learning models TextCNN Kim (2014), BiLSTM Bertero and Fung (2016), BERT Kenton and Toutanova (2019), and the contemporary humor recognition models ANPLS Ren et al. (2022), ColBERT Annamoradnejad and Zoghi (2024) and SCOG Zeng et al. (2024)). Additionally, we explored the performance of the latest large language models Llama3-8b, Llama3.1-8b, OpenAI GPT-3.5, and GPT-4) on the task of humor recognition using prompts and included them as baseline methods to compare against our proposed CIHR model. For details on the prompts used to guide the LLMs in humor recognition, please refer to A.2.

### Implementation Details

All hidden layer dimensions in the CIHR were set to 768. Within the Static Fusion Module, all parameters except those related to the user's static profile were initialized using the pre-trained BERT 

model1. All models were implemented using PyTorch and trained on a GeForce RTX 3090 GPU. The models were trained using the Adam optimizer Kingma and Ba (2015), with a learning rate of 2e-5 for parameters initialized from the pre-trained BERT and 2e-3 for all other parameters. The batch size was set at 32, with training conducted for up to 20 epochs. The model that performed best on the validation set was selected for testing.

Footnote 1: [https://huggingface.co/hfl/chinese-bert-wm-ext](https://huggingface.co/hfl/chinese-bert-wm-ext)

## 6 Overall Performance

As shown in Table 1, CIHR outperforms all baseline models in accuracy and F1 score, highlighting its superior humor recognition capabilities. We believe the superior performance of CIHR stems from its ability to consider both the multifaceted commonalities of humor and the distinctive individuality of the speaker, which are crucial for comprehensively understanding humor.

Interestingly, we observed that all LLMs exhibit unusually high recall rates, particularly Llama3-8b and GPT-3.5. However, this result does not indicate superior humor recognition capabilities compared to CIHR, but rather a tendency to misclassify more humorless expressions as humorous. While GPT-4 shows improvement over GPT-3.5 and the Llama models, compared to other models, large language models still tend to overly interpret normal text as humorous. This lack of discernment accounts for their significantly lower performance in other metrics, particularly precision.

## 7 Detailed Analysis

### Ablation Study

The results presented above demonstrate the overall effectiveness of our CIHR model. To delve deeper into the impact of each critical module within CIHR, we conducted a series of ablation experiments, as shown in Table 2. These experiments illustrate how each component contributes to the model's performance. For the variant labeled 'w/o SF,' we replaced the Static Fusion Module with the original pre-trained BERT. This substitution effectively removes the influence of the user's static profile information, rather than eliminating the component entirely. In the 'w/o DF' configuration, we concatenated the user's text representation with the dynamic profile and processed it through a single-layer feed-forward network, serving as a surrogate for the original Dynamic Fusion mechanism.

The results in Table 2 indicate that removing any part of the model leads to varying degrees of performance decline, highlighting the effectiveness and importance of each key module. Specifically, removing the Humor Commonality Analysis module leads to a significant performance drop, underscoring the importance of analyzing text from humor commonality perspectives to understand textual humor effectively. The removal of the Speaker Individuality Extraction module also results in a notable decline in performance, suggesting that the individualized information of the speaker plays a significant role in analyzing the user's humorous expressions. The performance decreases observed upon removing the Static Fusion and Dynamic Fusion modules demonstrate that these modules ef

\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Approach** & **Acc** & **P** & **R** & **F1** \\ \hline LR & 76.83 & 71.86 & 63.21 & 67.26 \\ SVM & 77.71 & 72.93 & 64.88 & 68.67 \\ TextCNN & 78.97 & 71.15 & 74.25 & 72.67 \\ BiLSTM & 76.45 & 65.73 & 78.26 & 71.45 \\ BERT & 75.19 & 79.96 & 71.98 & 75.76 \\ ANPLS & 78.72 & 79.33 & 74.45 & 76.81 \\ ColBERT & 82.87 & 82.98 & 79.97 & 81.45 \\ SCOG & 83.00 & 76.11 & 79.93 & 77.98 \\ lama3-8b & 45.66 & 41.05 & **98.98** & 40.49 \\ lama3.1-8b & 65.59 & 53.75 & 76.74 & 65.45 \\ GPT-3.5 & 60.42 & 48.56 & 91.24 & 63.39 \\ GPT-4 & 70.49 & 57.30 & 85.28 & 68.54 \\ \hline CIHR(Ours) & **84.50** & **83.73** & 83.01 & **83.37** \\ \hline \hline \end{tabular}
\end{table}
Table 1: Overall results of CIHR and baseline models, with the best results in bold and the second-best results underlined. Statistical significance of pairwise differences for CIHR against the best baseline is determined by the t-test (p ¡ 0.05).

\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Approach** & **Acc** & **P** & **R** & **F1** \\ \hline CHIR(Ours) & 84.50 & 83.73 & 83.01 & 83.37 \\ \hline w/o HC & 83.50 & 82.54 & 82.13 & 82.33 \\ w/o SI & 83.25 & 82.16 & 83.59 & 82.87 \\ w/o SF & 83.75 & 83.02 & 83.40 & 83.21 \\ w/o DF & 83.88 & 82.72 & 83.69 & 83.20 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Results of various variants of the CIHR model.

 

fectively integrate personalized information into the text representation process, enhancing humor recognition capabilities.

### Effect of Humor Commonality Analysis

To explore the impact of analyzing humor from various perspectives of its commonality, we compared the humor recognition performance of several model configurations: ColBERT, ColBERT enhanced with a Humor Commonality Analysis module (ColBERT+HC), CIHR minus the Humor Commonality module (CIHR-HC), and the full CIHR model. The results, illustrated in Figure 4, demonstrate that integrating the Humor Commonality Analysis module to the original ColBERT significantly improves performance. Conversely, removing this module from CIHR leads to a marked decline in effectiveness.

These findings robustly demonstrate the efficacy of the Humor Commonality Analysis module in enhancing humor recognition capabilities. More importantly, they confirm that analyzing humor from various perspectives of its commonality substantially boosts the model's ability to comprehend and recognize humor, reinforcing the importance of this approach in the design of humor recognition systems.

### Effect of Speaker Individuality Extraction

To explore the impact of leveraging user individuality on understanding and recognizing humor, we conducted experiments by selectively removing the Static Profile (SP) and Dynamic Profile (DP) from CIHR, as well as removing both simultaneously, and compared the humor recognition performance thereafter. The results, as depicted in Figure 5, show that ignoring either the Static Profile or the Dynamic Profile leads to a significant decrease in accuracy, recall, and F1 scores. Moreover, removing both profiles results in a dramatic decline in model performance.

These findings clearly demonstrate the critical role of user individuality information in enabling machines to understand and accurately recognize humor. Ignoring these individual aspects restricts the machine's ability to comprehend humor, thereby adversely affecting the overall effectiveness of humor recognition.

### Effect of Incorporating Both Humor Commonality and Speaker Individuality

As illustrated in Figure 4, while considering either humor commonality alone (ColBERT+HC) or speaker individuality alone (CIHR-HC) does improve humor recognition performance compared to baseline method (ColBERT), integrating both dimensions elevates CIHR's performance to a new level. This enhancement occurs because simultaneously addressing humor commonality and speaker individuality allows the machine to better understand humor expressions both from a general humor perspective and from the specific viewpoint of the speaker. Consequently, this dual approach significantly enhances humor recognition capabilities. These results underscore the importance of considering both humor commonality and speaker individuality in the design of effective humor recognition systems, confirming that integrating these aspects leads to a more robust and accurate understanding of humor.

## 8 Conclusion

This study introduced the Commonalities and Individuality Incorporated Network for Humor Recognition (CIHR), an innovative approach addressing the limitations of existing models by incorporating humor commonalities with speaker individuality, aspects often neglected in traditional humor recognition. CIHR features a Humor Commonality Analysis module to explore diverse aspects of multifaceted humor commonality within user

Figure 4: Effect of Humor Commonality Analysis

Figure 5: Effect of Speaker Individuality Extraction



texts, complemented by a Speaker Individuality Extraction module to capture unique individuality of each speaker. The integration of these insights is enhanced through the Static and Dynamic Fusion modules, which effectively combine these elements to deepen the understanding of humor. Experimental results validate CIHR's effectiveness, showcasing significant improvements over existing models in terms of accuracy, precision, recall, and F1 scores. These findings emphasize the crucial importance of simultaneously considering both multifaceted humor commonality and distinctive speaker individuality to achieve robust and effective humor recognition.

## Limitations

Our approach uses user-specific information to enhance humor analysis by considering speaker individuality. Although validated on a specific dataset, the scarcity of datasets containing comprehensive user information limits its tested generalizability across different platforms and languages. For a discussion on potential biases in the dataset we used, please refer to A.5. To address this, we are committed to expanding our research by collecting diverse datasets with user-specific information to thoroughly evaluate our method's adaptability and effectiveness across various conditions. Furthermore, our analysis of humor from various commonality perspectives is currently limited to using GPT-3.5, constrained by resource availability and the costs associated with API access. There is potential for improved analysis and enhanced humor recognition performance with the adoption of more advanced models, such as GPT-4.

## Ethics Statement

The datasets utilized in our research were obtained from publicly accessible sources, the personal identifiers were totally anonymized, thereby safeguarding against the misuse of individual data.

## Acknowledgments

We thank reviewers for their comments, which provided some insights on this research that will further influence our future work. This research was supported by the National Natural Science Foundation of China (No. 62376051, 62076046).

## References

* Annamoradnejad and Zoghi (2024) Issa Annamoradnejad and Gohar Zoghi. 2024. Colbert: Using bert sentence embedding in parallel neural networks for computational humor. _Expert Systems with Applications_, 249:123685.
* Attardo (2017a) Salvatore Attardo. 2017a. Humor and pragmatics. In _The Routledge handbook of language and humor_, pages 174-188. Routledge.
* Attardo (2017b) Salvvatore Attardo. 2017b. Humor in language. In _Oxford research encyclopedia of linguistics_.
* Attardo and Raskin (2017) Salvatore Attardo and Victor Raskin. 2017. Linguistics and humor theory. In _The Routledge handbook of language and humor_, pages 49-63. Routledge.
* Bertero and Fung (2016) Dario Bertero and Pascale Fung. 2016. A long shortterm memory framework for predicting humor in dialogues. In _Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies_, pages 130-135.
* Chen and Lee (2017) Lei Chen and Chungmin Lee. 2017. Predicting audience's laughter during presentations using convolutional neural network. In _Proceedings of the 12th Workshop on Innovative Use of NLP for Building Educational Applications_, pages 86-90.
* Cortes (1995) Corinna Cortes. 1995. Support-vector networks. _Machine Learning_.
* Kenton and Toutanova (2019) Jacob Devlin Ming-Wei Chang Kenton and Lee Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In _Proceedings of naacL-HLT_, volume 1, page 2.
* Kim (2014) Yoon Kim. 2014. Convolutional neural networks for sentence classification. In _Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP)_, pages 1746-1751, Doha, Qatar.
* Kingma and Ba (2015) Diederik P Kingma and JL Ba. 2015. Adam: A method for stochastic optimization 3rd international conference on learning representations. In _ICLR 2015-Conference Track Proceedings_, volume 1.
* Liu et al. (2018) Lizhen Liu, Donghai Zhang, and Wei Song. 2018. Modeling sentiment association in discourse for humor recognition. In _Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)_, pages 586-591.
* Lyu et al. (2023) Chenyang Lyu, Linyi Yang, Yue Zhang, Yvette Graham, and Jennifer Foster. 2023. Exploiting rich textual user-product context for improving personalized sentiment analysis. Association for Computational Linguistics (ACL).
* Mihalcea and Strapparava (2005) Rada Mihalcea and Carlo Strapparava. 2005. Making computers laugh: Investigations in automatic humor recognition. In _Proceedings of Human Language Technology Conference and Conference on Empirical Methods in Natural Language Processing_, pages 531-538 

Cited by: SS1.
* C. Y. Plessen, F. R. Franken, D. Ster, R. R. Schmid, C. Woffmary, A. Mayer, M. Sobisch, M. Kathofer, K. Ratner, E. Kotlyar, et al. (2020)Humor styles and personality: a systematic review and meta-analysis on the relations between humor styles and the big five personality traits. Personality and Individual Differences154, pp. 109676. Cited by: SS3.1.
* A. Radford (2018)Improving language understanding by generative pre-training. External Links: Link Cited by: SS1.
* Y. Raz (2012)Automatic humor classification on twitter. In Proceedings of the NAACL HLT 2012 student research workshop, pp. 66-70. Cited by: SS1.
* L. Ren, B. Xu, H. Lin, J. Zhang, and L. Yang (2022)An attention network via pronunciation, lexicon and syntax for humor recognition. Applied Intelligence52 (3), pp. 2690-2702. Cited by: SS1.
* A. Vaswani (2017)Attention is all you need. Advances in Neural Information Processing Systems. Cited by: SS1.
* O. Weller and K. Seppi (2019)Humor detection: a transformer gets the last laugh. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3621-3625. Cited by: SS1.
* O. Weller and K. Seppi (2020)The rjokes dataset: a large scale humor collection. In Proceedings of the Twelfth Language Resources and Evaluation Conference, pp. 6136-6141. Cited by: SS1.
* Y. Xie, J. Li, and P. Pu (2021)Uncertainty and surprisal jointly deliver the punchline: exploiting incongruity-based features for humor recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pp. 33-39. Cited by: SS1.
* D. Yang, A. Lavie, C. Dyer, and E. Hovy (2015)Humor recognition and humor anchor extraction. In Proceedings of the 2015 conference on empirical methods in natural language processing, pp. 2367-2376. Cited by: SS1.
* Z. Yang, S. Hooshmand, and J. Hirschberg (2021)Choral: collecting humor reaction labels from millions of social media users. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 4429-4435. Cited by: SS1.
* Z. Zeng, Z. Li, L. Yang, and H. Lin (2024)Leveraging social context for humor recognition and sense of humor evaluation in social media with a new chinese humor corpus-humorvb. In Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), pp. 10393-10402. Cited by: SS1.
* You Zhang, Jin Wang, Liang-Chih Yu, and Xuejie Zhang (2021)Ma-bert: learning representation by incorporating multi-attribute knowledge in transformers. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 2338-2343. Cited by: SS1.
* H. Zhu, X. Zhang, J. Lu, V. Wu, Z. Bai, G. Min, L. Yang, B. Xu, D. Zhang, and H. Lin (2024a)Enhancing textual personality detection toward social media: integrating long-term and short-term perspectives. arXiv preprint arXiv:2404.15067. Cited by: SS1.
* H. Zhu, X. Zhang, J. Lu, L. Yang, and H. Lin (2024b)Integrating multi-view analysis: multi-view mixture-of-expert for textual personality detection. In CCF International Conference on Natural Language Processing and Chinese Computing, pp. 359-371. Cited by: SS1.

 

Appendix

### Perspectives of Humor Commonalities

Since the beginning of the last century, there have been many work from different angles to analyze humor [17, 24, 30], after collation and analysis, we summarized 6 different angles, hoping to guide large models through these theoretical support and empirical research, can more comprehensive and in-depth analysis of humor, improve model performance. These seven different angles can be divided into two aspects: language includes semantics, pragmatics and grammatical syntax, background includes culture, emotion, cognitive contradictions and psychology, the following are the six different angles and corresponding prompts we used in Speaker Individuality Extraction module: Semantic analysis, Attardo's classic book Linguistic Theories of Humor details the semantic theory of humor, especially the polysemy of words and the role of puns in humor; The specific prompt is as follows,

"You are a linguistics expert with expertise in textual humor analysis. Please analyze whether rhetorical devices such as polysemy and puns are used in the following text, and explain whether they may have a humorous effect. Text to be analyzed: <user text>"

Pragmatic analysis, while proposing the cooperation principal and the four maxims, Grice also pointed out that humor often arises from violations of these maxims, revealing how humor is achieved by cleverly manipulating language and context; The specific prompt is as follows,

"You are a linguistics expert with expertise in textual humor analysis. Please analyze the following text according to the context to see if there are hidden meanings and subtests, and determine whether they constitute humor. Text to be analyzed: User text"

Grammar and syntactic analysis, Veale from the perspective of natural language processing to explore the special use of syntactic structure in humor; The specific prompt is as follows,

"You are a linguistics expert with expertise in textual humor analysis. Please check the sentence structure of the following text, analyze whether there are unusual grammatical or syntactic phenomena, and determine whether they serve humor. Text to be analyzed: <user text>"

Cultural background analysis, Davies through the analysis of humor in different cultural backgrounds, explore how culture affects the understanding of humor; The specific prompt is as follows,

"You are a linguistics expert with expertise in textual humor analysis. Please analyse whether there is culturally relevant humor based on the cultural or social background of the following text. Text to be analyzed: <user text>"

Cognitive Contradiction Analysis, "Biscociative Thinking" by Koestler explains how cognitive contradictions play a role in humor; The specific prompt is as follows, 

cognitive contradictions or inconsistencies, and determine whether it is used to create humor. Text to be analyzed: <user text>"_

Psychoanalysis, Freud explores humor and its subconscious foundations from a psychoanalytic perspective. Through the above seven theoretical support and empirical research perspectives, We can study humor more scientifically and comprehensively. The specific prompt is as follows,

_"You are a linguistics expert with expertise in textual humor analysis. Please analyze the psychological reactions that the following texts may trigger and determine whether they can generate humor. Text to be analyzed: <user text>"_

### Prompts for LLMs Baselines

The prompt guiding LLMs to determine whether the user text is humorous is as follows:

_"You are a linguistics expert with expertise in textual humor analysis. Please analyze the following text to see if it creates humor, and respond yes/no only. Text to be analyzed: <user text>"_

### Details of Static Fusion Layer

#### a.3.1 Profile Guided Self-Attention

Previous research indicates that adjustments in attention distribution can align sequence representations with attribute information Zhang et al. (2021), prompting the Static Fusion Module to inject user static profile information into the attention mappings. Specifically, PG-SA first generates user-specific query vectors, leading to user-specific attention distributions. The \(i\)-th attention head for the PG-SA can be represented as:

\[\begin{split}\mathbf{h}^{\prime}_{(i)}&=\mathrm{PG -SA}_{(i)}\left(\mathbf{h},\mathbf{e}^{z}\right)\\ &=\mathrm{Softmax}\left(\frac{Q^{P}_{(i)}K^{\top}_{(i)}}{\sqrt{d }}\right)V_{(i)},\end{split} \tag{12}\]

where \(Q^{P}_{(i)}\in\mathbb{R}^{N\times(d/K)}\) is the user-specific query matrix, and \(K_{(i)}\), \(V_{(i)}\in\mathbb{R}^{N\times(d/K)}\) are the key and value matrices, computed as follows:

\[\begin{split} Q^{P}_{(i)}&=\operatorname{Linear}_ {Q,(i)}(\mathbf{h})\odot\sigma_{(i)}+\mu_{(i)}\\ V_{(i)}&=\operatorname{Linear}_{V,(i)}(\mathbf{ h})\\ K_{(i)}&=\operatorname{Linear}_{K,(i)}(\mathbf{ h})\end{split} \tag{13}\]

where \(\sigma(i)\) and \(\mu_{(i)}\) are the scaling and shifting factors that modify the query matrix:

\[\begin{split}\sigma_{(i)}&=\mathbf{1}+\operatorname{ Linear}_{\sigma,(i)}\left(\mathbf{e}^{z}\right)\\ \mu_{(i)}&=\operatorname{Linear}_{\mu,(i)}\left( \mathbf{e}^{z}\right)\end{split} \tag{14}\]

The final output of PG-SA, \(\mathbf{h}\prime\in\mathbb{R}^{N\times d}\), is a concatenation of the outputs from all K heads:

\[\mathbf{h}^{\prime}=\operatorname{Linear}\left(\mathbf{h}^{\prime}_{(1)}|| \mathbf{h}^{\prime}_{(2)}||\ldots||\mathbf{h}^{\prime}_{(K)}\right) \tag{15}\]

Notably, the user static profile embeddings \(\mathbf{e}^{z}\) are zero-initialized (by zero-initializing \(W_{z}\) and \(b_{z}\)) to ensure stability during model fine-tuning and to minimize the impact of unstable initial user profile embeddings on the learning of the model's attention distribution.

#### a.3.2 Profile Guided Layer Normalization

Traditional layer normalization adjusts representations by learning shared gain and bias parameters across batches and sequences, treating them as contextualized representations. To adapt layer normalization to user-specific information, we introduce Profile Guided Layer Normalization (PG-LN), which is tailored to learn user-specific gain and bias factors. PG-LN is defined as follows:

\[\begin{split} h^{\prime}_{i}&=\left(\gamma\odot \frac{h_{i}-\mu_{i}}{\sqrt{\delta_{i}^{2}+\varepsilon}}+\beta\right)\\ &\odot\left(1+\operatorname{Linear}_{\gamma}\left(\mathbf{e}^{ z}\right)\right)+\operatorname{Linear}_{\beta}\left(\mathbf{e}^{z}\right)\end{split} \tag{16}\]

In this equation, \(h_{i}\) represents the representation of the \(i\)-th step within \(\mathbf{h}\), serving as the input to each Static Fusion Layer. Here, \(\mu_{i}\) and \(\delta_{i}\) are the mean and standard deviation of \(h_{i}\) along the last dimension, while \(\gamma\) and \(\beta\) are the gain and bias parameters that are shared across the sequence, enhancing the representational power of the neural network. \(\varepsilon\) is a small coefficient added for numerical stability. It is important to note that while the original global factors from layer normalization are retained to maintain the general language distribution, the zero-initialization of \(\mathbf{e}^{z}\) can help to ensure the stability of sequence information during fine-tuning 



### Data Statistics

The statistical information of the HumorWB dataset is illustrated in Tables 3, 4, and 5.

### Discussion on Potential Biases in the HumorWB Dataset

The HumorWB dataset, which serves as the primary resource for evaluating our proposed CIHR model, is sourced from Weibo, a Chinese social media platform. While the dataset provides a rich combination of humorous texts and detailed user profiles, its origin introduces potential cultural and demographic biases that may limit the generalizability of our findings.

#### a.5.1 Cultural Biases

Humor in the dataset reflects Chinese language and culture, including idiomatic expressions and cultural allusions. While effective for modeling Chinese humor, this cultural specificity may reduce performance on datasets from other linguistic or cultural contexts.

#### a.5.2 Demographic Biases

Weibo's user base skews toward younger, urban populations, potentially overrepresenting humor styles popular among these groups while underrepresenting those of older or rural populations.

#### a.5.3 Labeling Biases

Humor annotations reflect the subjective perceptions of annotators, influenced by their cultural and demographic backgrounds. This may lead to biases in labeling unconventional or less mainstream humor styles.

\begin{table}
\begin{tabular}{l c c c} \hline \hline  & **All** & **Humorless** & **Humorous** \\ \hline All & 42.34 & 41.48 & 43.75 \\ Train & 42.56 & 41.65 & 44.04 \\ Valid & 41.99 & 41.31 & 43.12 \\ Test & 41.68 & 40.86 & 43.03 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Average Text Length

\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **All** & **Humorless** & **Humorous** \\ \hline All & 5291 & 3281 & 2010 \\ Train & 3703 & 2287 & 1416 \\ Valid & 794 & 499 & 295 \\ Test & 794 & 495 & 299 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Number of Posts