Federated Learning with Diversified Preference for Humor Recognition
Xu Guo1 , Pengwei Xing1 , Siwei Feng1 , Boyang Li 1 , Chunyan Miao1,2
1School of Computer Science and Engineering, Nanyang Technological University (NTU), Singapore
2
Alibaba-NTU Singapore Joint Research Institute{xu008, pengwei.xing, siwei.feng, lily.liboyang, ascymiao}@ntu.edu.sg

Abstract
Understanding humor is critical to creative language modeling with many applications in humanAI interaction. However, the perception of humor is
personal due to different humor preferences. Thus,
a given passage can be regarded as funny to different degrees by different readers. This makes
training humorous text recognition models that canadapt to diverse humor preferences highly challenging. In this paper, we propose the FedHumor approach to recognize humorous text contents
in a personalized manner through federated learning (FL). It is a federated BERT model capable ofjointly considering the overall distribution of humor scores with humor labels by individuals forgiven texts. Extensive experiments demonstratesignificant advantages of FedHumor in recognizing
humor contents accurately for people with diverse
humor preferences compared to 9 state-of-the-art
humor recognition approaches.

1

Introduction

Humor plays an important role in social communications.
Unlike many objective classification tasks, the task of humor recognition is constrained by its subjectivity. Given thesame jokes, it is difficult to achieve consensus among people due to the fact that human preferences lead to different
degrees of perception on what is funny [Aykan and Nalçacı,
2018], which is as illustrated in Figure 1. This makes it challenging for humor recognition models to generalize to moreusers in practice, as they are trained on humorous and nonhumorous examples labelled by experimenters [Yang et al.,2015; Chen and Soo, 2018] or employed annotators [Zhang
and Liu, 2014; Hossain et al., 2019]. To achieve more robust
humor recognition from a wider range of populations, it isnecessary to consider diverse preferences of users.
Previous research on automated humor recognition cast thetask as a binary classification problem [Yang et al., 2015;
Chen and Soo, 2018]. These methods mainly focus on
how to design humor-related linguistic features as input toa classifier to obtain high classification performance. With
well-established computational humor theories [Shultz, 1976;
Gruner, 1997; Binsted et al., 2006], they can curate many

ServerTextual content……

……

Humor preference

Humor preference

Non-humorous
Humorous
Humorous Non-humorous
Non-humorous
Humorous

Figure 1: User preferences lead to disagreement on what is funny.

heuristics to extract informative features. The key of heuristic rules is to design effective approaches to capture special
linguistic patterns [Yang et al., 2015; Liu et al., 2018] or tocount n-gram statistics [Taylor and Mazlack, 2004] that candistinguish humorous text from plain text. These methods areable to characterize intra-sentence and/or inter-sentence dependencies that are unique to humor, and thus do not rely a
lot on the complexity of classifiers. Nevertheless, the feature
generation process requires significant efforts and many havedifficulties to cope with newly encountered terms [Zhang andLiu, 2014].
Deep learning has shed light on the feature engineering using neural networks. Especially, Convolutional Neural Networks [Chen and Soo, 2018] and Transformer-based language models [Mao and Liu, 2019] has been used for endto-end humor recognition. Most of previous studies are conducted on curated datasets where their humorous and nonhumorous examples are taken from different sources [Yang etal., 2015; Liu et al., 2018; Chen and Soo, 2018] or different
distributions [Zhang and Liu, 2014; Mao and Liu, 2019] andthen prepared to be balanced. This experimental setting implies an underlying assumption that people all agree what aretreated as humorous and what are non-humorous, which neglected human preferences and thus limited their applicability
in practice.
Federated Learning, a technique that trains a deep neural network based on iterative averaging of decentralized lo-cal updates, has been proved to be robust to unbalanced andnon-IID data distributions [McMahan et al., 2017]. Inspiredby recent progress of federated learning in diversity [Ramaswamy et al., 2019] and personalization [Arivazhagan etal., 2019], we propose to improve the generalization abilityof humor recognition models on a variety of user preferenceswith the help of federated learning. We name the model as FedHumor. Especially, we adopted the Federated Averaging(FedAvg) algorithm [McMahan et al., 2017] as the base training setting, then fine-tuned a pretrained Transformer-based
language model on our task, and employed a diversification
strategy [Ramaswamy et al., 2019] to handle diverse user
preferences.
The main idea of our solution is to force the humor recognition model to learn from a diverse range of user preferences,
thereby enhancing the adaptability to new users. For this purpose, there are two important issues to consider. First, as
users are increasingly aware of privacy issues and reluctant
to provide personal information [Yang et al., 2019], it is impossible to aggregate explicit user preference information that
reside on their personal devices. To address this, we propose
an approximation strategy to generate implicit user feedback(i.e., labels) on given humorous text and we diversify the label
distributions to represent diverse user preferences. Second,
marginal distributions of user preferences (reflected as hardly
amused or easily amused personalities) often lead to salientclass imbalance issue which requires us to select a more suitable evaluation metric rather than widely adopted accuracy.
As such, we use F1 score, the harmonic mean of precisionand recall, to evaluate and select best models.
To the best of our knowledge, FedHumor is the first federated learning-based humor recognition model. Extensive
results show that our approach is able to increase the generalization bounds of the humor recognition model compared to 9
state-of-the-art approaches. It is a promising approach to help
future AI applications recommend suitable humorous texts tousers under a stricter data privacy protection landscape [Yanget al., 2019], thereby enabling more complex human-AI interactions to emerge.

2

Related Work

The mainstream verbal humor recognition approach leverages a set of humor-related features from linguistic perspectives to train a text classification model that distinguishes
humorous text from non-humorous text. Traditional humor
studies use static or stereotyped instances of humor found inliterary compilations or online repositories. [Mihalcea andStrapparava, 2005] retrieved a large number of one-liners
from web pages using explicitly indicated humor-related contents. They designed three humor-specific stylistic features:
alliteration, antonym, and adult slang and trained a classifier
to detect humorous one-liners.
Statistical analysis on humor-specific language structures
has also been leveraged for humorous text recognition. [Yanget al., 2015] extracted a set of statistical features from four
humor-related semantic structures: incongruity, ambiguity,interpersonal effect and phonetic style to trained a Random
Forest classifier based on a combination of these handcraftedfeatures under Word2Vec representations. With the development of social platforms, new forms of expression emerge.
[Zhang and Liu, 2014] collected a set of tweets and let a native English speaker to filter out humorous ones. They combined humor-related linguistic features suited for Twitter texts
to train a Gradient Boosted Regression Trees classifier to detect humorous tweets.
To avoid manually designing curated features, deep neuralnetworks have been applied to learn humor-related features
automatically from humorous texts. [Chen and Lee, 2017] designed a Convolutional Neural Network (CNN) to recognize
verbal humor from TED talks. [Chen and Soo, 2018] augmented CNN with the Highway Network [Srivastava et al.,2015] to improve performance in short joke detection. [Maoand Liu, 2019] utilized the pretrained multilingual BERT andfine-tuned it on the HAHA task [Chiruzzo et al., 2019] to recognize humorous tweets in Spanish.
Although deep learning-based humorous text recognition
models do not rely on feature engineering, the labels in the
training datasets they use depends on the annotators’ personal preference. Such biased datasets may limit the applicability of the trained model on other user populations.
Recent FL text processing models start to focus on personalization to cope with statistical heterogeneity among different participants’ local datasets [Arivazhagan et al., 2019;
Ramaswamy et al., 2019]. However, they assume that different users face different data instances. In this work, we
address the personalization issue of the same texts viewed bydifferent users producing diverse humor labels.

3

Methodology

In this section, we illustrate our problem context and present
the detailed design of FedHumor solution for humor recognition.

3.1

Preliminaries

Task definition. A traditional humor recognition task isdefined as: given a piece of text X, a humor recognition
model, denoted as f , should predict it as humorous or not:f (X) = y, y ∈ {0, 1}, where the label y is empirically determined by a small scope of annotators. Our task extends
the setting by relaxing the confidence of the labels, where themodel f should predict the label that are agreed by the majority of n different user preferences: f (x) = Maj(yi , ..., yn ).
While such information can not be determined directly due toprivacy protection, it is iteratively learned through federated
learning.
Implicit label generation. Jokes should have different intensities of funniness and different people will give different ratings to the same jokes [Hossain et al., 2017]. However, it is difficult to aggregate such explicit feedback froma diverse population on the same jokes in the privacy protection setting. As such, we approximately generate implicit labels and diversify their distributions, which heavily rely on two assumptions: (1) Given a set of n jokes
S = {(X1 , α1 ), ..., (Xn , αn )} sorted by their degrees of funniness, α ∈ A|A = (α1 , ...αn ), people would agree on thejokes whose funniness is close to the marginal boundaries of8000

Number of instances

1200
1000

6000

800

4000

600
400

2000

200
0

non-humorous
humorous

0

1

(a)

2

3

0

= 0.8

(b)

= 1.3

Figure 2: Implicit label generation strategy. (a) The distributionof explicit funniness ratings on a set of jokes. (b) Implicit humorous and non-humorous label distributions from different user preferences controlled by the user preference α.

the funniness interval, max∀s∈S α(s) and min∀s∈S v(s) (i.e.,
not funny and very funny), and may disagree on the middle
jokes that are far away the two extremes (e.g., slightly funny
and moderately funny). (2) A user’s preference is characterized by a specific transition point in the funniness interval αk ∈ A where the user would dislike the jokes below
the funniness value αk and like the jokes beyond that funniness. In this paper, we only consider scenarios that satisfy thetwo assumptions to investigate effects of federated learningon the generalization capability of humor recognition models. Based on the assumptions, the liked and disliked results
are treated as implicit humorous and non-humorous labels,y ∈ {0, 1}, for the humor recognition models to learn. To
gain an overview, the resulted implicit label distributions that
imply users’ different personal preferences are illustrated in
Figure 2.

3.2

Humor Recognition through Federated
Learning

The purpose of federated learning solution for humor recognition is to enhance the generalization performance of traditional humor recognition models when dealing with newuser preferences under the privacy protection policy. In order to learn such a model without aggregating personal preference information into a central storage location, FedHumor is designed similar to Google’s GBoard scenario [Ramaswamy et al., 2019] based on the FL paradigm. We employed the Transformer-based encoder - BERT [Devlin etal., 2018] to capture contextualized sentence representations
as the feature learning part of our model and fine-tune its
pretrained weights on our task. BERT tokenizes the jokes
into tokens in its vocabulary and encodes every sequenceof tokens T = (t1 , ..., tm ) into 12 distinct hidden states,{Hi }12i=1 |Hi = (h1 , ...hm ), which are computed in parallel through 12 self-attention layers, where H ∈ Rrh ×m andrh = 768 in our task. A linear layer, as a classifier to be optimized, is applied on the pooled hidden states followed bySoftmax operation to predict the labels of jokes. Users join
the federated learning following the same protocol as in Federated Averaging [McMahan et al., 2017].

Federated Model Training
Robustness is a major concern in federated learning as decentralized devices may contain corrupted data, such as diverse preferences on jokes in our task, making the federated learning system vulnerable to arbitrarily skewed distributions [Ghosh et al., 2019]. To mitigate this shortcoming,
we incorporated an adaptation mechanism into the federated
training which aims to personalize model predictions to local distributions. The mechanism can provide punishment or
reward and the degree is determined by the empirical distributions on each client device. As shown in Eq. (1), the predicted probability of each class Pb(yi = y) for i-th joke Xi
is scaled by dividing them over the empirical probability ofeach class P (yi = y) for a specific user, where y ∈ {0, 1} andP ∈ (0, 1) as we assume users will perceive at least some of
the jokes as humorous and some are not.
!
b(yi = y|Xi )P
Pe(yi = y|Xi ) = Softmax(1)
P (yi = y)βwhere β is a scaling factor which can be determined
empiricallyP through experiments and Softmax(xi ) =exp(xi )/ j exp(xj ) aims to recompute the adjusted probabilities. The denominator term P (yi = y)β overall serves
as either a punishment or a reward depending on the comparison of predictions and actual distributions. For example, if
the predicted probability is Pb(yi = 1) = 0.9 while the actual distribution for y = 1 is Pb(yi = 1) = 0.7, then the
denominator serves as a punishment to adjust the prediction
to be Pe(yi = 1) ≈ 0.72 for β = 1, which is closer to the actual distribution. Such empirical probabilities are determined
locally according to each client’s personal preference α.
We follow the FedAvg algorithm to aggregate client model
parameter updates after each round of local training to produce a global model. At each training round t, the current global FL model with parameters wt is sent to k clientsrandomly selected from the device population. A more detailed discussion about the selection strategy can be foundin [McMahan et al., 2017]. Each client is initialized with aunique personal humor preference α to produce implicit labels, as introduced in Section 3.1. Eq. 2 shows the optimization problem on client m, ∀m ∈ [1, k]:
N

min −
(m)

wt

1

1 XX
(m)
log(Pe(yi = y|Xi , wt ))N i=0 y=0(2)where N is the number of instances in a minibatch andPe(yi = y) is the scaled probability for each prediction as
defined in Eq. (1). The client weight parameter updates arethen averaged across devices for the FL server to compute thePk(m)
new global FL model parameters, wt+1 = k1 m=1 wt .
The FL model training process of FedHumor is illustrated in
Figure 3. Throughout the process, User’ sensitive personal
humor preference information did not leave their own device.
Federated Inference
After completing FL model training, the global FL model willbe transferred to the clients to facilitate personalized humor

Server

FedAvg
Local update

Global model

Wi

W1

……

Wn

i) Initial model and data arereceived from the serverii) Labels are produced locallyFigure 3: The training process of FedHumor: 1) the FL server sends
the current global model and text contents to a group of clients; 2)
the clients provide humor labels for the contents based on their own
preferences, update the model locally, and send their model parameters to the server; 3) the server aggregates these local updates to
produce a new global model.

recognition. In this stage, the predicted probability Pb(yi =y) for i-th joke Xi on each client is re-scaled by multiplying
it with the empirical probability P (yi = y) stored on thatclient, as shown in Eq. (2).
Pe(yi = y|Xi ) = Softmax(Pb(yi = y|Xi )P (yi = y)β ) (3)The scaling and re-scaling operations are performed oneach client locally. By applying Eq. (1) in the FL modeltraining stage and Eq. (2) in the federated inference stage, we
achieve the goals of learning a federated model for humorous
text recognition from decentralized data sources with diverse
preference, and customizing the federated model when it isapplied for inference by each client locally. The pseudo-code
for FedHumor is given in Algorithm 1.

4

Experimental Evaluation

In this section, we study the properties of FedHumor and evaluate its performance against 9 state-of-the-art humor recognition approaches through experiments on real-world data.

4.1

Real-world Dataset

To study humor recognition on a diverse populations, weuse a challenging dataset from SemEval-2020 Task 7 - assessing the funniness of edited news headlines [Hossain etal., 2019], which contains humorous text that are edited using incongruous words. The training/dev/test sets consistof 9,652/2,419/3,024 instances and they provide fine-grained
funniness scores to every edited news headline, with intensity
ranging from 0 to 3. For example, a news headline titled Royal wedding : Meghan’s dress in detail - was micro-edited
by replacing dress with elbow to produce a funny version Royal wedding : Meghan’s elbow in detail - which received
an average funniness score of 2 by five selected annotators.
We reuse the dataset as a basis to experimentally study theeffectiveness of FedHumor for handling diverse personal humor preferences. We generated implicit labels and diversify
the distributions for different users using the strategy introduced in Section 3.1. Given the same jokes, increasing the

Algorithm 1: FedHumor. The K clients are indexedby k; Dtr is the training set and Dte is the test set;
β set is set by the FL server; αk depends on client k;
B is the number of batches; E is the number of local
epoches; and η is the learning rate.
Server executes:
Initialize w0 from pretrained weights;
for each round t = 1, 2, ..., T dofor each client k = 1, 2, ..., K in parallel dokwt+1← ClientUpdate (k, wt , β);PK1kwt+1 ← K
k=1 wt+1 ;ClientUpdate (k,w,β) : // run on client k
Compute prior probability
P (yk = 0|αk ), P (yk = 1|αk );Select βk from β based on αk ;B ← (split Dtr into batches)for each local epoch i = 1, 2, ..., E dofor batch b ∈ B do
Compute loss L based on Eq. (1) and Eq.
(2);w ← w − η 5 L(w; b);return w to serverInference:for each client k = 1, 2, ..., K do
B ← (split Dte into B batches)
Given P (yk = 0|αk ), P (yk = 1|αk ), βk ;for batch b ∈ B do
Make predictions based on Eq. (3);Evaluate global model performance on client k;

threshold of being amused or what we call user preference (α)
can make more samples being annotated as non-humorous, asshow in Figure 4.

4.2

Evaluation Setup

We set up the evaluation metric for comparing our federated
learning based humor recognition model with other comparable models, and for selecting the best models in total training
epochs. Other experimental settings were set as default.
Generalizability evaluation. The generalization capability of a humor recognition model can be measured by its performance on unseen data set that has different marginal distribution from the observed set. Intuitively, the higher the test
performance it produces, the more generalizable a model isto new users. A relevant proof of generalization bound versus
robustness is discussed in [Xu and Mannor, 2012].
Metric selection. Diverse preferences of humor can resultin very unbalanced datasets stored on different users. Under
this condition, a model can achieve an artificially high accuracy by predicting all the labels to be the dominant class.
In order to provide fair evaluation for model performance,
we consider precision, recall and F1-score in instead of thewidely used accuracy metric. Macro average is more strict
than other averaging methods when computing overall performance on an imbalanced dataset. For example, if a modelScaling factor 𝛽

Number of instances8000

non-humoorus
humorous

6000
4000
2000
0

2.0

100

1.5

75

1.0

50

0.5

25

0.0

0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0

0
0.5
1.0
1.5
User preference 𝛼

2.0

Figure 4: Implicit humorous/non-humorous label distributions in thedataset after personal humor preferences are taken into account.

Figure 5: Sensitivity analysis for parameter α and β on model performance evaluated using F1 score.

achieves 100% recall on a negative class with 90 samples and
0% recall on a positive class with 10 samples, macro averaging produces an overall recall of 50% while micro averaging produces an overall recall of 90%. Therefore, we use
macro averaging to report the precision, recall and F1-scoreachieved by each model on the test dataset in order to pay
more attention to their performance on the minority class.
We adopt the following metrics to evaluate the performance of a model based on the i-th user preference:PTN
1. Macro Precision: Pi = 12 ( T PT+F
P + T N +F N )label distribution ranging from 20% to 75%. For users who
have too low (α < 0.5) or too high (α > 1.5) humor preference values (which results in a very unbalanced dataset), β
is recommended to set to a low value (e.g., around 0.1). For
users who have medium humor preference value, the model
performance is not sensitive to value of β, making it robust
under such conditions.

2.

P
TN
Macro Recall: Ri = 21 ( T PT+F
N + T N +F P )TPTN
3. Macro F1: Fi = 2·T P +F
N +F P + 2·T N +F N +F P

Where TP, TN, FP and FN are calculated based on how many
humorous instances are classified as True Positive (TP) or
False Negative (FN) and how many non-humorous instances
are classified as True Negative (TN) or False Positive (FP).
To evaluate the performance of a model on a diverse rangeof n users, we adopt the following metrics:
Pn
1. Overall Precision: P = n1 i=1 PiPn
2. Overall Recall: R = n1 i=1 RiPn
3. Overall F1: F = n1 i=1 Fi

4.3

Experiment 1: Sensitivity Analysis

In this experiment, we aim to understand the impact of diverse
humor preferences (α) on the performance of FedHumor andto what extent personalization (controlled by β) should beapplied. To do so, we varied the values of α from low degree(α = 0.2) to high degree (α = 2.0), and at the same time,increased the scale factor β from small value (β = 0) to large
value(β = 2.0), all in increments of 0.1, to conduct a numberof tests. We regenerate the humor labels each time α is varied.
We trained the model for each combination of α and β and thebest model is selected using F1 score.
The results on test set are shown in Figure 5. For every α
value, there are multiple β values that can achieve the best
personalization performance. It means that our model is notvery sensitive to β and a reasonable value would be suffice.
In general, a model can achieve better performance on a preference range of (0.5, 1.5), which produce a non-humorous

4.4

Experiment 2: Federated Learning

We evaluate federated learning based approach with othercomparable learning strategies for humor recognition on two
groups of clients with different degrees of diversity:• Group 1: a small group of 3 clients with humor preference values α = [0.3, 0.9, 1.8], representing an easily
amused personality, a neutral personality and a hardly
amused personality; and• Group 2: a large group of 18 clients with humor preference values, α, ranging from 0.2 to 1.9 in an incrementof 0.1, representing a more diverse range of population.
For both groups, we empirically set the value of scaling factor
β to 0.1 for clients whose preferences α are below 0.5 orabove 1.5 and set β to 1.0 for those clients whose preference
values are within the range [0.5, 1.5]. They are determinedthrough iterative experiments as discussed in Section 4.3.
We design two intuitive learning strategies to train a humor recognition model and compare them with the one usingfederated learning strategy, described as follows:
1. AGG: to aggregate all the implicit labels from local
client into the central database, and treat them as groundtruth to learn a BERT-based humor recognition model,
which follows the traditional way of training machinelearning models.
2. INDV: to train an individual humor recognition modelfor every user based on their local ground truth labels.
The same penalty mechanism as the one in FedHumor isapplied on every user to cope with their individual classimbalance problems. However, this solution is not practical when we want to scale up to a large population ofusers. In addition, whenever a new user comes, a newmodel needs to be established.

Table 1: Results of three learning strategies on the test set.

Group 1

Group 2

AGG
INDV
FED
AGG
INDV
FED

Precision
58.59
56.30
60.03
57.40
58.14
61.67

Recall
54.89
55.32
65.57
51.25
55.61
66.62

Table 2: Results for Experiment 3 (in percentage).

F1
41.66
53.52
55.61
33.05
53.03
57.48

DV-LR
WV-RF
WV-CNN-HN
BERT-FZ
BERT-FT
BERT-L-FT
BERT-C-FTBERT-M-FTALBERT-FT
FedHumor

3. FED: as we introduced in Section 3, this approach isthe federated learning-based humor recognition model
incorporated with a distribution adaptation mechanism.
The average performance of the approaches on each groupon their test sets are shown in Table 1. FED achieves better
performance in terms of precision, recall and F1-score than
AGG and INDV on both the small group and the large group.
FED is better than INDV means the issue of data insufficiency
is alleviated by federated learning, which is the core of FedHumor. FED is better than AGG means FedHumor considers
personalization and can be adapted to different users.

4.5

Recall
53.67
56.10
54.70
53.71
64.88
64.48
62.65
62.08
61.05
66.56

F1
53.64
55.20
51.90
52.53
64.87
64.47
62.62
62.06
61.04
66.53

• ALBERT-FT: We fine-tuned one of the upgraded BERT
variant - ALBERT [Lan et al., 2019] on our humor
recognition task for comparison.
• FedHumor: The proposed approach which pretrained
the BERT model under FL framework on a group of 18
diverse humor preferences. We apply the model on thesame test set to compare with the other humor recognition models.

Experiment 3: Humor Recognition

The advent of BERT [Devlin et al., 2018] has opened a new
era in natural language research by presenting SOTA results
on many downstream NLP tasks. These models are pretrainedon large amounts of existing text using self-supervision withno data annotation required, and thus are often treated as encoders primed with knowledge of a language. In this experiment, we compare the performance of FedHumor against thefollowing humor recognition baseline models and BERT variants on the personalized humorous text recognition task.
• DV-LR: We trained Doc2Vec [Mikolov et al., 2013] using the distributed bag of words approach and applied
logistic regression for classification.

Precision
53.69
56.70
56.20
54.15
64.91
64.48
62.69
62.11
61.06
66.60

• WV-RF: We reproduced the humor recognition modelin [Yang et al., 2015], which used a pretrained
Word2Vec model for sentence representation and a Random Forest for classification.
• WV-CNN-HN: We reproduced the model in [Chen andSoo, 2018], which augmented a CNN with a Highway
Network for humor recognition.

User preference value α is fixed at 1 in this experiment, making its test dataset balanced (as presented in Figure 4). All
the comparison models are trained using the same training set
and FedHumor is trained following its own paradigm. Theirperformance on the same test set is reported in Table 2.
The first three models (i.e., DV-LR, WV-RF, WV-CNNHN) are stationary word representation models which arewidely adopted in humor recognition tasks before the advent of transformers. Their performance are generally notgood on this dataset. The following six models (i.e., BERTFZ, BERT-FT, BERT-L/C/M-FT, ALBERT-FT and FedHumor) are BERT variants. The results of BERT-FZ are muchworse than the rest, which shows that fine-tuning pretrainedmodels can enable better feature representations. FedHumor,
which is powered by FL diagram, achieved better results than
the above models across metrics. This can be attributed to
the federated training and personalization strategy that forced
the model to learn from diversified user preferences and thus
presented better generalization performance on the test set.

• BERT-FZ: We applied the pretrained BERT model andfreezed the model parameters. A fully connected layer isapplied on top of BERT and is trained for classification.

5• BERT-FT: We applied the pretrained BERT and finetuned its parameters together with a classification layer.
• BERT-L/C/M-FT1 : We fine-tuned other versions of
BERT, including the one pretrained on a much larger
dataset (BERT-L), the one pretrained with words cased(BERT-C), and the one pretrained on multilingual
dataset (BERT-M), and model parameters are updated
together with the classification layer to form three baseline approaches.
1

https://huggingface.co/transformers/pretrained models.html

Conclusions

In this paper, we propose the FedHumor approach - a humorous text recognition model following the federated learning
paradigm which can provide personalized humor recognition
based on labels stored in distributed sources. It is able toaccount for diversity in each person’s activation point for perceived funniness for the same text contents. Through extensive experiments comparing FedHumor with 9 state-of-theart approaches, we show that it is able to achieve better personalization when recognizing humor from text contents. To
the best of our knowledge, it is the first federated learningbased personalized humorous text recognition model.

Acknowledgments
This work is supported, in part, by Alibaba Group through Alibaba Innovative Research (AIR) Program and Alibaba-NTU
Singapore Joint Research Institute (JRI), Nanyang Technological University, Singapore.

References[Arivazhagan et al., 2019] Manoj Ghuhan Arivazhagan,
Vinay Aggarwal, Aaditya Kumar Singh, and Sunav
Choudhary.
Federated learning with personalization
layers. CoRR, arXiv:1912.00818, 2019.
[Aykan and Nalçacı, 2018] Simge Aykan and Erhan Nalçacı.
Assessing theory of mind by humor: The humor comprehension and appreciation test (tom-hcat). Frontiers in psychology, 9, 2018.
[Binsted et al., 2006] Kim Binsted, Anton Nijholt, Oliviero
Stock, Carlo Strapparava, G Ritchie, R Manurung, H Pain,
Annalu Waller, and D O’Mara. Computational humor.
IEEE Intelligent Systems, 21(2):59–69, 2006.
[Chen and Lee, 2017] Lei Chen and Chong MIn Lee. Convolutional neural network for humor recognition. CoRR,
arXiv:1702.02584, 2017.
[Chen and Soo, 2018] Peng-Yu Chen and Von-Wun Soo.
Humor recognition using deep learning. In NAACL, pages
113–117, 2018.
[Chiruzzo et al., 2019] Luis Chiruzzo, S Castro, Mathias
Etcheverry, Diego Garat, Juan José Prada, and Aiala Rosá.
Overview of haha at iberlef 2019: Humor analysis basedon human annotation. In IberLEF, 2019.
[Devlin et al., 2018] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training ofdeep bidirectional transformers for language understanding. CoRR, arXiv:1810.04805, 2018.
[Ghosh et al., 2019] Avishek Ghosh, Justin Hong, Dong Yin,
and Kannan Ramchandran.
Robust federated learning in a heterogeneous environment. arXiv preprint
arXiv:1906.06629, 2019.
[Gruner, 1997] Charles R. Gruner. The game of humor: A
comprehensive theory of why we laugh. Transaction Publishers, 1997.
[Hossain et al., 2017] Nabil Hossain, John Krumm, Lucy
Vanderwende, Eric Horvitz, and Henry Kautz. Filling theblanks (hint: plural noun) for mad libs humor. In EMNLP,
pages 638–647, 2017.
[Hossain et al., 2019] Nabil Hossain, John Krumm, andMichael Gamon. “President Vows to Cut Hair”: Dataset
and analysis of creative text editing for humorous headlines. CoRR, arXiv:1906.00274, 2019.
[Lan et al., 2019] Zhenzhong Lan, Mingda Chen, SebastianGoodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations. CoRR, arXiv:1909.11942, 2019.

[Liu et al., 2018] Lizhen Liu, Donghai Zhang, and Wei
Song. Exploiting syntactic structures for humor recognition. In Proceedings of the 27th International Conference
on Computational Linguistics, pages 1875–1883, 2018.
[Mao and Liu, 2019] Jihang Mao and Wanli Liu. A bertbased approach for automatic humor detection and scoring. In IberLEF, 2019.
[McMahan et al., 2017] Brendan McMahan, Eider Moore,
Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-Efficient Learning of Deep Networks
from Decentralized Data. In AISTATS, pages 1273–1282,
2017.
[Mihalcea and Strapparava, 2005] Rada Mihalcea and Carlo
Strapparava. Making computers laugh: Investigations in
automatic humor recognition. In EMNLP, pages 531–538,
2005.
[Mikolov et al., 2013] Tomas Mikolov, Ilya Sutskever, Kai
Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NeurIPS, pages 3111–3119, 2013.
[Ramaswamy et al., 2019] Swaroop Ramaswamy, Rajiv
Mathews, Kanishka Rao, and Françoise Beaufays. Federated learning for emoji prediction in a mobile keyboard.
CoRR, arXiv:1906.04329, 2019.
[Shultz, 1976] Thomas R Shultz. A cognitive-developmental
analysis of humour. 1976.
[Srivastava et al., 2015] Rupesh K Srivastava, Klaus Greff,
and Jürgen Schmidhuber. Training very deep networks.
In NeurIPS, pages 2377–2385, 2015.
[Taylor and Mazlack, 2004] Julia M Taylor and Lawrence J
Mazlack. Computationally recognizing wordplay in jokes.
In Proceedings of the Annual Meeting of the Cognitive Science Society, volume 26, 2004.
[Xu and Mannor, 2012] Huan Xu and Shie Mannor. Robustness and generalization. Machine learning, 86(3):391–
423, 2012.
[Yang et al., 2015] Diyi Yang, Alon Lavie, Chris Dyer, and
Eduard Hovy. Humor recognition and humor anchor extraction. In EMNLP, pages 2367–2376, 2015.
[Yang et al., 2019] Qiang Yang, Yang Liu, Yong Cheng, Yan
Kang, Tianjian Chen, and Han Yu. Federated Learning.
Morgan & Claypool Publishers, 2019.
[Zhang and Liu, 2014] Renxian Zhang and Naishi Liu. Recognizing humor on twitter. In CIKM, pages 889–898,2014.