Transfer Learning for Humor Detection by Twin Masked Yellow Muppets
Paper · 2022 · Aseem Arora, Gaël Dias, Adam Jatowt et al.
Summary
A pun can turn on a word with several meanings. A punchline can overturn an expectation created by its setup. An edited headline can become funny through a single substitution. Humor detection treats these cases as a text classification problem: given a piece of writing, predict whether it belongs to the humorous or non-humorous class. Arora and colleagues ask whether training across forms gives a classifier evidence it would miss if it learned from each dataset in isolation. Their premise is that different kinds of jokes can share vocabulary, topics, and devices such as surprise, while still rewarding attention to the conventions of a particular format.
The authors build a classifier around two copies of BERT. Training first adapts BERT to the language of Shortjokes by asking it to recover masked words. One copy then learns to distinguish humorous from non-humorous writing in a mixture drawn from Puns, Reddit, Humicroedit, and Shortjokes. The authors limit Shortjokes’ contribution so that it will have less influence over the mixture. They freeze this shared copy and separately train a private copy for each target dataset. The final classifier reads both representations of the same text before making its prediction.
On the test splits, the full system achieves mean accuracies of 93.25 on Puns, 73.55 on Reddit, 81.36 on Humicroedit, and 98.77 on Shortjokes. It has the highest mean accuracy and F1 among the BERT-base variants the authors test on each dataset. The gains over ordinary BERT base are statistically significant in the reported tests. Against the literature benchmarks, the authors report new best results for Reddit and Shortjokes. Their own BERT Large comparison still scores higher on Humicroedit.
The controlled comparisons clarify where the gains come from. Adaptation through masked words gives a modest improvement when BERT is then trained on each dataset separately. The shared copy on its own falls short of the separately trained baseline, while the combination of shared and private copies does best when it uses both kinds of preliminary training. Using the full, Shortjokes-heavy pool also produces weaker final classifiers than using the restricted mixture. The authors’ examples suggest that shared training can help with vocabulary that recurs across jokes. They also show errors involving a word whose meanings must coexist, humor that depends on background knowledge, and a subtle change to a headline.
Deep dive: Transfer Learning for Humor Detection by Twin Masked Yellow Muppets
This study tests whether training BERT across different kinds of jokes improves humor detection while preserving cues specific to each dataset. · about 33 minutes to read
The problem and its context
A common label for different kinds of text
Humor detection asks for a compact judgment about text whose effects can depend on several quite different mechanisms. A setup gives the reader a reason to expect a certain kind of ending. A punchline can exploit that expectation by resolving the setup in a different way. A pun can invite the reader to recognize more than one meaning in the same expression, or to hear a familiar expression in a similar-sounding word. An edited headline supplies yet another structure. Most of the sentence retains its ordinary journalistic form while a substitution changes what the sentence means. Each case can receive the same label, even though the evidence for assigning it lies in different places.
The paper illustrates this range with jokes at several scales. Its example of wordplay about a musician has a short question and answer, with a musical term carrying the joke. The classroom story takes longer to establish its expectation. A lecturer makes a claim about the relation between grammatical form and meaning, and someone in the room answers with an expression whose intended force undercuts that claim. The headline example keeps the shape of a news report and introduces an animal where the original sentence had a conventional subject matter. The examples give substance to the paper’s concern about training on isolated forms. Knowing what kind of input one will receive can help a classifier, but a format also determines which clues it has opportunities to learn.
Some of those clues could recur in spite of the differences in format. A pun and a story can both depend on the reader revising an initial interpretation. A headline edit and a punchline can both bring together ideas that the surrounding words led the reader to keep apart. The authors also suggest overlap in the vocabulary of humor, including expressions associated with taboo material or particular communities. These are different grounds for expecting transfer. Vocabulary can recur in otherwise dissimilar texts, while a device such as incongruity can recur with completely different vocabulary. The proposal leaves room for either kind of overlap to help.
The label is also tied to how each corpus was made. A Reddit punchline receives its class through a cutoff on votes. A Humicroedit headline receives its class according to whether it is the original or the edited version. As a consequence, learning to predict both sets of labels entails more than learning the same decision rule under different wording. A cue that matters for a reader’s response to a punchline may have little relation to what identifies an altered headline. Shared training is useful to the extent that something learned from one source helps with another source’s decisions. The paper builds this assumption into the classifier and then tests how far it pays off.
For the paper, humor matters as a part of communication and as a longstanding subject in psychology and linguistics. Within natural language processing, it places classification alongside the separate task of producing humorous text. The ability to assign a label gives researchers a way to test what text representations capture. They can ask whether a system does better once it has encountered a broader range of humorous writing, or whether the relevant evidence is so specific to each corpus that joint training mainly adds noise. The study concerns classification. Its connection to generation is a motivation for understanding the cues on which classification depends.
From explicit clues to representations learned from context
The earlier work the authors describe gives several answers to the question of where a classifier should look. Mihalcea and Strapparava’s early study of short texts combined clues about writing style with clues about what the texts discussed. The separation between style and content is relevant here because the same choice comes up in a different form. A classifier might detect typical subject matter, recognize the way a piece of text is arranged, or benefit from both. In the paper’s account, explicit clues about style and topic were among the first ways to put that distinction to work in automatic humor recognition. Making Computers Laugh
Different media made different evidence available. Purandare and Litman added properties of speech, such as pitch and energy, to linguistic features for conversations. Zhang and Liu combined features of sound, word and sentence structure, meaning, usage, and affect for tweets. Bertero and Fung used learned representations at several levels together with features concerning such things as structure and sentiment to predict humor in sitcom dialogue. The paper also notes work that combines modalities. These examples all treat humor recognition as a task that can benefit from drawing on several clues, with the choice of clues shaped by where the texts came from and what accompanies them.
Chen and Soo used a convolutional architecture together with highway networks. Weller and Seppi then made BERT central to their approach. They assembled the Reddit dataset and used it for the problem of judging whether a joke is funny. They also tested BERT on Puns and Shortjokes. Their work supplied the present study with data, a baseline, and evidence for using contextual representations. Such representations let an expression contribute differently according to the words around it, an attractive property for passages whose ending can shift the interpretation of what came before. Humor Detection: A Transformer Gets the Last Laugh
Contextual representations still leave open a choice about which context the learning process should emphasize. Wang and colleagues worked with body-and-punchline texts in a multilingual setting and adapted BERT to tasks involving sentence relations and discrepancies. Xie and colleagues likewise concentrated on the relationship between setup and ending, using uncertainty and surprise as signals. Ziser and colleagues studied humorous questions in product question answering, where the type of input narrows the problem in another direction. These studies show why specialization can be productive. Researchers can design a task or features around a particular organization of text, giving the classifier a more direct route to evidence relevant in that setting.
The present paper retains that role for specialization and changes the point at which it happens. Earlier success on several datasets establishes that a general text encoder can be adapted to each one. The authors ask what happens when material from several humor datasets deliberately shapes a common encoder before the final adaptation. This is transfer learning in a concrete sense. Parameters learned during one training stage provide a starting point or a source of information at a later stage. What transfers here is a way of representing text, learned first from words in context and then from class labels across datasets. The classification boundary for each target still gets its own training.
The method, step by step
How the two encoders learn different things
An encoder turns a stretch of text into a sequence of vectors, which are lists of numerical values learned during training. A classifier can use one of those vectors as a representation of the whole input and map it to class scores. In this study, the same text eventually passes through two encoders. Both have the BERT-base architecture, but their parameters are shaped by different training experiences. The shared encoder has learned from a mixture of corpora, while the private encoder adapts to the corpus whose label the system must predict. The final classification layer receives both outputs.
The doubling happens after an initial stage that can serve either branch. The authors start with BERT and continue training it on Shortjokes using masked language modeling, abbreviated MLM. The task hides words and asks the encoder to support predictions about what should appear in those positions. It can therefore use humorous language directly, with the text supplying the targets for prediction. The examples do not have to take part in a humorous-versus-non-humorous decision for this stage to teach the encoder about which words occur together. The saved weights then supply a starting point for the next parts of the full architecture.
The shared branch receives a further stage of supervised training. Here, each example comes with a humor label, and BERT learns to make a binary prediction from examples pooled across the source datasets. The idea is to give its representations a common direction. Recovering words can teach an encoder about the way jokes are written, but the ability to recover a missing word is a different objective from recognizing the class of a passage. Pooled classification makes the latter decision explicit, and it exposes the encoder to positive and negative examples from several sources while doing so.
At the last stage, the parameters learned by the shared BERT are held fixed. A private BERT, initialized from the MLM adaptation in the full system, can change as it learns the classification task for a target dataset. The resulting pair processes each input, and a trainable classification layer decides how to use the two vectors. The procedure is repeated independently for each target. The term private thus refers to which dataset can shape those parameters during the final supervised stage. The shared encoder brings mixed training into all the target classifiers, while the private encoder and output layer can respond to the particular labeling task.
Training and prediction in the shared-private humor classifier
The steps in order.
Masked-word adaptation on Shortjokes
BERT is a Transformer encoder. Its contextual representation of a position can use information from elsewhere in the input. In masked language modeling, a word is hidden during training, so evidence from its neighbors and from the broader passage can help predict it. The authors take the existing BERT weights as their starting point and continue this training on Shortjokes. The dataset suits their purpose because it is much larger than their other sources and covers puns, setup-and-punchline jokes, and other short humorous texts. The texts range from 10 to 200 characters.
The adaptation is an instance of fine-tuning, in which an already trained encoder changes its parameters through additional training on a chosen objective or source of data. Here the objective is still word recovery, but the material is drawn from the joke collection. A word is masked with probability 0.15 in the authors’ description. MLM training uses a batch size of 6, meaning that the training calculation groups that many examples into a batch, and a learning rate of 2 × 10⁻⁵. The learning rate controls the scale of the updates made by the optimizer. The paper calls an encoder initialized with the result of this training +MLM.
The adaptation can help even if the humor of a sentence is hard to infer. To learn from that sentence at this stage, the system needs a training target at a masked position. It can receive a useful signal from common phrases or patterns of wording without a separate explanation of why the text is funny. Conversely, predicting a word from its context can succeed without detecting any joke. This distinction is what motivates giving the shared encoder a separate classification objective. It also motivates a baseline in which MLM adaptation is followed immediately by a target-corpus classifier. That baseline lets the authors see what the word-recovery stage contributes on its own.
Building the shared representation
The shared classification task brings together examples from the training partitions of Puns, Humicroedit, Reddit, and Shortjokes. It treats their existing binary labels as a common output. This gives each example the same role in the training objective even though a positive label can originate from different collection procedures. A class prediction made on a pun and a class prediction made on an edited headline both update the same encoder and its shared classification layer. A pattern that helps with several sources can thus influence a representation that later makes its way into each target classifier.
The authors describe including all training instances from Puns, Reddit, and Humicroedit and limiting Shortjokes to 21,000 training instances in the shared pool. For validation, they describe including all validation instances from the smaller corpora and 3,800 from Shortjokes. They report a shared validation pool of 9,547 examples. The split table gives separate positive and negative counts. Its reported pooled training counts and the description of which examples enter the pool are difficult to reconcile. The intended intervention is clear from the experimental comparisons: limit the contribution of Shortjokes in the shared stage and compare that setup with an alternative that uses the complete data.
Balance has a particular meaning in this procedure. The individual datasets already have roughly balanced positive and negative classes in their reported splits. The motivation for capping Shortjokes is to change the amount of training evidence supplied by the different sources. The three other corpora also differ in size, and Shortjokes itself includes more than one kind of joke. The mixture is therefore a way to limit the dominance of a large corpus, with corpus membership serving as a proxy for coverage of humor forms.
During shared classification, a text enters BERT with a special token written [CLS]. The encoder computes a contextual vector for that position, and the classification layer uses it as the representation of the input text. The paper denotes it as follows.
h_CLS ∈ ℝᵈ
Here h_CLS is the vector at the classification token and CLS identifies that token. The symbol ∈ means that the vector belongs to the stated space. ℝᵈ is the space of vectors with d real-valued coordinates. In the BERT-base encoders used for the paper’s shared-private architecture, d is 768. Though the vector comes from a particular token position, its role in this classifier is to carry information about the complete input.
A fully connected layer takes this vector and produces scores for the humorous and non-humorous classes. Each class score can depend on every coordinate of the vector. A softmax function turns the scores into a probability distribution over the classes. Training uses cross-entropy, which penalizes assigning low probability to the supplied label. The optimization of this loss can change the encoder as well as the classification layer during the shared stage. Once the authors select the shared encoder, its learned representation is available to the target classifiers.
There is no separate test split for the shared pool. Its training and validation examples support preparation of the shared encoder. The test predictions that matter for the main comparison are made on the individual datasets, using the classification setups the authors want to evaluate. This distinction also explains how to read the shared-only baselines. The authors can take the classifier learned from the pool and apply it to a target test set without a private branch. That is a test of how well the pooled decision works on that source’s held-out texts.
Joining shared and private representations
In the full classifier, each target text goes through both BERT encoders. The authors use the [CLS] output of the frozen shared encoder and the [CLS] output of the trainable private encoder. Their notation distinguishes the sources of these two vectors.
h_sCLS ∈ ℝᵈ
Here h_sCLS is the vector produced by the shared encoder, s means shared, and CLS indicates its token position. The membership symbol ∈ places the vector in ℝᵈ, the space of real-valued vectors with d coordinates. The shared vector can change from one text to another because it is a function of the input, even though the shared parameters stay fixed during this stage.
h_pCLS ∈ ℝᵈ
Here h_pCLS is the corresponding private vector, and p means private. The CLS position has the same role as before. The expression ∈ ℝᵈ again means that the vector has d real-valued coordinates. This time the encoder parameters are trainable, so the representation of a fixed text can also change during training as the private branch adapts to the target labels.
[h_sCLS, h_pCLS]
The brackets indicate concatenation. The coordinates of h_sCLS, the shared vector, are followed by those of h_pCLS, the private vector, with the comma marking their boundary. Concatenation preserves the two sets of coordinates as separate inputs to the output layer. The classifier can therefore learn different weights for the shared and private evidence. An average of the two vectors would lose that distinction, and a vote would require each branch to make a separate class prediction. Here the two branches supply features for a single prediction.
The output layer again uses a fully connected transformation followed by softmax, and it is trained with cross-entropy on the target labels. The fixed shared vector thus contributes to the prediction while the private encoder and classification layer learn from errors. Freezing protects the mixed-corpus representation from being reshaped by the final target training. The design still lets the classifier discount parts of that representation if they are unhelpful for the target. How much information actually comes from either branch on a given example is an empirical question. Concatenation supplies access to both and leaves the weighting to training.
Both classification stages, shared and shared-private, run with 16 examples per batch and a learning rate of 2 × 10⁻⁵. The authors report using Adam, an optimizer that adjusts parameters from the gradients of the training loss, with weight decay of 0.01. They train for 4 epochs for each dataset and save the checkpoint with the highest development accuracy. An epoch is a pass through the training data, and the development or validation partition is the held-out material used to choose a checkpoint before assessing test performance. The implementation uses PyTorch and the Hugging Face Transformers library, and the authors report releasing the code and datasets. PyTorch · Transformers
Experiments and results
What the datasets measure
Puns tests classification on humorous quotations whose humor takes the form of wordplay. Its negative texts were selected with attention to vocabulary and length so that those properties would be similar between the classes. This makes the comparison more informative than a contrast between puns and unrelated writing whose style immediately reveals its source. The authors use the splits from Weller and Seppi. The Puns training split has 1,809 positives and 1,810 negatives, and the test split has 155 positives and 147 negatives. The underlying collection comes from earlier work on recognizing humor and finding the elements that carry it. Humor Recognition and Humor Anchor Extraction
Reddit supplies jokes organized around a setup and a punchline. The cutoff on upvotes gives the study a way to assign a binary class to the punchline. A classifier operating on this collection is learning to predict labels derived from that response. A passage can still have the form of a joke when it receives the negative label, so recognizing the broad format provides limited help. The reported Reddit training split contains 9,719 examples in each class. The validation split contains 304 positives and 304 negatives, and the test split has that same pair of class counts. These figures describe distinct partitions.
Humicroedit uses ordinary news headlines together with edits designed to create humor. A single substituted word changes the sense of a headline, while much of its vocabulary and syntax remains in place. The authors assign the original headlines to the negative class and the edited headlines to the positive class. The task is consequently sensitive to local changes in otherwise similar text. The Humicroedit training partition has 9,652 texts per class, the validation partition has 2,419 per class, and the test partition has 3,024 per class. The paper’s later error analysis shows why an edited headline can be difficult even when the classifier handles another edit of the same original.
Shortjokes has broader coverage of short humor and supplies substantially more training material. It includes short puns and setup-and-punchline examples alongside other brief jokes. Its classification training split has 171,831 positive instances and 171,031 negative instances. The test split has 10,889 positives and 10,680 negatives. The paper gives less detail about the origin of its negative examples than it does for Puns or Humicroedit. Shortjokes also serves a separate role as the source for masked-word adaptation. Its resulting influence depends on the stage: the authors actively restrict its share of the pooled classification data, while choosing it as the source for the MLM procedure.
Together the datasets let the authors test the same architecture on inputs with different formats, sizes, and labeling rules. A score on one test split summarizes decisions against that split’s labels. Its level can reflect the nature of the negative examples, the source of the positive labels, the amount of training data, and the relation between the training and test texts. There is no common scale of joke difficulty independent of those choices. The most direct comparisons therefore hold the test corpus fixed and ask which training configuration predicts its labels more accurately.
Baselines and measures
The central baseline is BERT base trained for the target dataset. It has the same kind of encoder the proposed system uses in its branches and lacks the extra humor training and paired representation. A second target-specific baseline starts from the Shortjokes MLM weights, then learns the target labels. The difference between these baselines helps isolate the usefulness of the initial word-recovery stage. The paper also evaluates pooled classifiers directly. These have completed the shared classification stage and make test predictions without target-specific private training. They ask how far the common representation and common decision can go by themselves.
The other internal comparisons retain both encoders and alter the preliminary training. The label +MLM identifies prior masked-word adaptation. The label +Class identifies pooled humor classification for the shared component. Minus signs indicate the absence of the corresponding stage. The variants include both stages together, each stage by itself, and a configuration that uses the paired architecture without either. The two encoders are therefore present even in the last condition. This lets the authors distinguish the effect of adding an encoder from the effect of the training history they give it.
The paper reports accuracy and F1. Accuracy counts the fraction of classifications that agree with the labels. F1 combines precision and recall, which reflect how frequently a predicted positive is correct and how often a labeled positive is recovered. The paper gives F1 alongside accuracy but does not specify its averaging convention. All the main in-paper test scores are means over 5 runs, and the accompanying standard deviations describe how much the scores vary across those runs. The table containing comparisons with earlier work also shows the highest observed run for the experiments where the authors report an average and a maximum. A maximum describes the best run seen, whereas the mean describes the set of repeated runs.
The authors use a two-tailed t-test with a reported threshold of p-value < 0.05. The significance marks in the main ablation table refer to BERT base. In the comparison table with earlier systems, the marks instead refer to the authors’ BERT Large runs. This matters because a mark attached to the same full-system score can answer a different pairwise question depending on the table. The main comparison establishes significance against the ordinary target-specific BERT-base baseline on each of the target datasets. The paper does not attach the same claim to every numerical ordering among the variants.
Results on Puns and Reddit
On Puns, BERT base gives mean test accuracy of 90.71 and F1 of 90.70. Starting from the MLM adaptation brings both means to 90.88. The full shared-private classifier reaches 93.25 for both accuracy and F1, each with standard deviation 0.37. The highest run reported for the full system is 93.71 on both metrics. The contrast with the modest gain from MLM alone is informative. The full procedure benefits this corpus even though a pooled classifier without a private branch has difficulty matching a target-specific baseline on it.
The Reddit result also favors the full system, and the contrast with the pooled-only classifier is especially visible. BERT base achieves mean test accuracy of 70.43 and F1 of 69.43. Adding the masked-word stage to the single encoder yields 70.96 accuracy and 70.13 F1. With shared and private representations and both preliminary objectives, the means are 73.55 accuracy and 73.40 F1. The reported standard deviations are 0.41 for accuracy and 0.39 for F1. The strongest run has accuracy of 73.85 and F1 of 73.69.
Mean test F1 for BERT-base configurations on Reddit
The full shared-private classifier leads the single-encoder baselines and the partially trained paired variants.
The numbers
| System or setting | F1 |
|---|---|
| BERT base | 69.43 |
| BERT base with MLM adaptation | 70.13 |
| Shared only with both stages | 65.71 |
| Shared-private without either stage | 67.26 |
| Shared-private with pooled classification only | 67.45 |
| Shared-private with MLM adaptation only | 68.34 |
| Shared-private with both stages (this paper) | 73.40 |
The authors compare Reddit with the previously reported accuracy of 72.40 from Weller and Seppi. They also run their own BERT Large baseline, which averages 68.67 accuracy and 67.51 F1 on the Reddit test split. The reported prior result and the replicated average describe different evidence. One is the literature value used as a benchmark, and the other comes from the present authors’ repeated runs. The full classifier exceeds both reported accuracy figures and leads the replicated BERT Large runs on F1. The paper identifies Reddit as one of its new best results.
On Puns, the relation to earlier work depends on the split. The Weller and Seppi values in the paper are 93.00 accuracy and 93.10 F1. The full shared-private classifier leads those values and the authors’ BERT Large mean of 91.46 accuracy and 91.45 F1. Fan and colleagues report 93.88 accuracy and 93.93 F1 with a different partition of Puns. Their procedure also uses WordNet, an external lexical resource. The alternate split is the reason the paper warns against treating the scores as directly comparable. The resource difference describes an additional difference in what each approach uses.
Results on Humicroedit and Shortjokes
On Humicroedit, the ordinary BERT-base classifier averages 80.18 accuracy and 80.10 F1. The single-encoder MLM variant reaches 80.62 on both metrics. The full shared-private system improves the means to 81.36 accuracy and 81.35 F1, with standard deviations of 0.31 and 0.30 respectively. The largest values observed across the full system’s runs are 81.81 accuracy and 81.80 F1. The gains over BERT base show the value of the training procedure within that family of configurations.
The ranking changes when BERT Large enters the comparison. Its mean test accuracy on Humicroedit is 82.22, and its mean F1 is 82.20. Its best run also scores above the best run of the proposed architecture. Xie and colleagues report 83.65 accuracy and 83.63 F1 on a version of Humicroedit prepared through cleaning, for which the paper gives a total of 3,341 examples. That result concerns a different evaluation population. The BERT Large comparison suffices to establish that the proposed classifier can lead the BERT-base configurations and still fall short of a stronger baseline on the same benchmark.
Mean test accuracy for repeated BERT comparisons on Humicroedit
The shared-private classifier improves on the base encoders, while BERT Large has the highest mean in this comparison.
The numbers
| System or setting | accuracy % |
|---|---|
| BERT base | 80.18 |
| BERT base with MLM adaptation | 80.62 |
| Shared-private with both stages (this paper) | 81.36 |
| BERT Large | 82.22 |
On Shortjokes, BERT base has mean test accuracy and F1 of 98.55, each with standard deviation 0.08. MLM adaptation followed by target training brings the means to 98.58, each with standard deviation 0.05. The full system reaches 98.77 on both metrics with standard deviation 0.03, and the best run reaches 98.78 on each. These scores are close together on the reported scale. Their ordering is supported by the repeated runs in the paper, which makes the standard deviations particularly relevant to the comparison.
The authors’ BERT Large experiments on Shortjokes give mean accuracy and F1 of 98.69, and the best run obtains 98.76 on both. The earlier Weller and Seppi result is 98.60 for each metric. The authors treat Shortjokes as their other new best result. Here the complete system improves on the dataset used to supply the initial MLM adaptation as well as on datasets from other sources. The experiment demonstrates the value of the full training recipe on Shortjokes, although the contribution of the other corpora has to be interpreted through the controls on the shared stage.
Across the benchmarks, the paired classifier improves on the authors’ BERT Large means for Puns, Reddit, and Shortjokes. Humicroedit is the exception. The paper puts the comparison in terms of parameter count as well, giving about 220M parameters for the proposed classifier and 340M for BERT Large. The paired architecture uses two base encoders and still has the smaller reported parameter count in this comparison. Parameter count establishes the relative sizes of the systems. The study provides no timing comparison that would turn those sizes into claims about the time needed for training or for a prediction.
What the ablations show
The effect of masked-word training
The closest test of the MLM stage compares ordinary target-specific BERT with an encoder that differs by its prior adaptation to Shortjokes. Mean accuracy and F1 rise on every test corpus in that comparison. On Reddit, for example, mean F1 goes from 69.43 to 70.13. On Humicroedit it goes from 80.10 to 80.62. The two settings both learn a target-specific classifier, so the improvement follows the changed initialization. The result supports using joke text for preliminary word recovery even when the downstream task assigns labels by a different procedure.
A second comparison puts MLM before pooled classification and evaluates the resulting shared head directly. Mean scores improve on every corpus relative to pooled classification initialized from ordinary BERT. On Puns, shared-only mean F1 is 88.06 without MLM and 88.93 with it. On Shortjokes, the corresponding values are 95.48 and 95.88. In both cases, the MLM stage helps the encoder make better use of the pooled objective without enabling the resulting shared decision to match the target-trained BERT baseline. This pattern separates a useful change in representation from a stronger claim that a pooled classifier can do every target job on its own.
The paired variants give a more qualified picture of MLM in isolation. With neither pooled classification nor MLM, the two-branch system reaches mean accuracy of 80.61 on Humicroedit. With MLM alone, the mean is 80.49. On Shortjokes, the corresponding means are 98.62 and 98.56. The Puns and Reddit paired results do improve when MLM is added to that same no-classification setting. The paper’s broad account of gains from MLM is clearest for the single-encoder and shared-only comparisons, and when MLM contributes to the complete paired configuration. The isolated stage behaves differently across some paired settings.
Why the private branch matters
The pooled classifier is a direct way to test how much common supervision transfers by itself. It has seen training examples from each target source through the shared pool, so its test is whether a common decision generalizes to held-out examples from each source. For all the datasets, each of the shared-only variants scores below the ordinary target-specific BERT baseline on mean accuracy and F1. On Reddit, the stronger shared-only variant obtains mean test accuracy of 66.37, compared with 70.43 for BERT base trained specifically on Reddit. On Humicroedit the corresponding means are 79.32 and 80.18.
The complete architecture uses the shared encoder in a different role. Its vector supplies features, and the classification boundary is fitted on the target. The private encoder also learns features from that target. The improved scores with this setup are consistent with different corpora needing different evidence even when they benefit from a common representation. For instance, a pooled classifier can encounter both punchlines and edits, yet target-specific training lets the head place greater weight on whichever evidence serves the corpus being evaluated. This comparison changes the availability of the private representation and the target-specific classification head together. It supports the complete adaptation procedure and leaves the separate contribution of each of those changes unresolved.
The authors also test the paired architecture before giving either branch the proposed humor training. That configuration is competitive on some datasets. On Puns its mean accuracy is 91.19, compared with 90.71 for the ordinary BERT-base classifier, and on Shortjokes it achieves 98.62 compared with 98.55. On Reddit it reaches 68.95, below the ordinary baseline. An extra representation can help under some conditions, but the effect varies by source. The consistent lead belongs to the configuration that combines the two branches with both preliminary objectives.
The contrast between partial and full training is especially helpful here. On Puns, the mean accuracy for the paired variant with pooled classification alone is 91.13, and for the variant with MLM alone it is 91.72. Both trails end below the full system’s 93.25. On Reddit, the corresponding partial settings give 68.75 and 69.41, and the full one reaches 73.55. The experiment shows that the proposed stages are most valuable when used together in this architecture. It does not identify a particular coordinate, collection of words, or kind of incongruity as the source of that advantage.
What changes when Shortjokes dominates the mixture
The authors repeat the shared training with a complete mixture that uses the available examples rather than restricting the largest corpus. They evaluate shared-only classifiers under this change both with and without MLM. They also evaluate the full shared-private classifier after changing the shared mixture. The comparison addresses a practical question about pooled supervision. Adding many texts gives the shared encoder more observations, while simultaneously increasing the influence of the source supplying those texts.
For shared-only prediction, the restricted mixture does better on Puns, Reddit, and Humicroedit in both initialization settings. With MLM, Puns mean test accuracy is 88.94 under the restricted mixture and 84.24 with the complete mixture. Reddit has 66.37 and 64.31 under the same comparison. Humicroedit has 79.32 and 78.71. The ordering without MLM is the same across those corpora. In the paper’s interpretation, a shared encoder trained on the complete pool becomes more oriented toward Shortjokes. A decision learned with that emphasis transfers less well to the other sources.
When the shared-only classifier is tested on Shortjokes itself, the pattern reverses. With MLM, mean test accuracy and F1 are both 95.88 with the restricted pool and 98.48 with the complete pool. Without MLM they are 95.48 with the restricted pool and 98.47 with the complete pool. In this setting, the corpus that gains the most representation in the mixture is also the corpus on which the shared decision is tested. The shared-only scores expose the local benefit of the shift and the corresponding cost visible on the other test sets.
Mean test accuracy on Shortjokes under restricted and complete shared training
The complete pool helps shared-only prediction, while the restricted pool gives the paired classifier its highest mean.
The numbers
| System or setting | accuracy % |
|---|---|
| Shared only with MLM, restricted pool | 95.88 |
| Shared only with MLM, complete pool | 98.48 |
| Shared-private with both stages, complete pool | 98.60 |
| Shared-private with both stages, restricted pool (this paper) | 98.77 |
Once the authors restore private target training, the full classifier does better with the restricted pool on every corpus, including Shortjokes. With complete shared data, it yields mean test accuracy of 92.52 on Puns, 71.48 on Reddit, 80.38 on Humicroedit, and 98.60 on Shortjokes. This differs from the shared-only result because the private encoder already adapts to Shortjokes when that corpus is the target. The paper’s architecture gives the restricted shared encoder a chance to contribute information alongside that specialization. The experiment supports that combination, though changing the pool alters both the relative representation of sources and the volume of training material. It does not isolate those effects in separate controls.
Run-to-run variation supplies a further distinction. The full restricted configuration has the smallest accuracy standard deviation in the main comparison on Puns, Reddit, and Shortjokes. For Humicroedit the target-specific BERT-base run has standard deviation 0.23 on accuracy, compared with 0.31 for the full system. In the pooled-data comparison, the Shortjokes full system with complete shared data has standard deviation 0.01 on accuracy, compared with 0.03 for the restricted mixture. Stability and mean performance are related questions that the tables let the reader assess separately. A very consistent setting can still settle at a lower mean.
What the inspected errors reveal
The qualitative comparison presents cases where the paired system detects humor and the ordinary BERT classifier misses it. One joke turns an apparent shortening of a name into an insult that has little to do with the person’s actual name. Another brings together music playing in a hospital and a word that can characterize either illness or music. A third uses the option of sorting products from the most expensive down to make a joke about people with exceptional wealth. The authors point to vocabulary connected with sex, illness or strangeness, and money as possible cues with relevance across joke forms.
These examples suggest a path by which the shared encoder can help without resolving the full structure of each joke. Familiar associations can make a humorous reading more salient in a passage that an independently trained encoder finds difficult. The examples also leave open which cue led to a prediction. The wealth example, for instance, combines a topic associated with jokes and a deliberately exaggerated inference about who would use an ordinary shopping feature. A correct label cannot distinguish detection of the exaggeration from a response to the subject matter. The paper offers the lexical interpretation as a hypothesis.
The examples both classifiers miss bring different challenges into view. The river joke makes its effect depend on the financial and geographical senses of bank. Selecting the sense favored by the surrounding words can lose the second interpretation that makes the line work. The answer about where to find the books is funny only if the reader connects it to paranoia. A remark about politicians invites an inference about the relationship between causing a problem and then using it in a campaign. The authors associate these errors with simultaneous meanings, background knowledge, and reasoning. The diagnoses explain plausible routes to the humor and do not measure those abilities independently.
The Humicroedit example keeps the original headline almost intact and tries alternative words for an official. Both classifiers correctly handle the original and recognize the edit that inserts a monkey. Both miss the humorous label for the version involving an assassin. The authors suggest that the animal has a stronger conventional association with comic material, so the successful decision can follow a relatively conspicuous cue. The other substitution requires closer attention to what the new role implies in the context of the headline. A controlled change to a word thus exposes a difference that the aggregate mean combines with thousands of other decisions.
Limitations
Limits identified by the authors
The authors explicitly identify polysemy, external knowledge, context, and reasoning as remaining difficulties. Their error examples illustrate why success on the binary task can coexist with a failure to capture the point of a joke. Some texts require a reader to sustain more than one interpretation. Others expect the reader to bring information to the passage and infer a connection that the words never make explicit. Adding more humor examples or another representation can improve classification overall while leaving those demands unresolved. The conclusion takes the examples as evidence of continuing difficulty with such cases, without supplying separate quantitative tests for each type.
The authors also qualify their rankings against prior work. The higher Fan and colleagues scores use a different Puns partition. The Xie and colleagues comparison on Humicroedit uses a cleaned subset, and their approach is described as designed around setup-and-punchline structure. These comparisons help situate the size and applicability of the present results, but they involve different evaluation conditions. The authors’ own BERT Large runs show a clear limit under their Humicroedit setup: a larger single encoder can achieve higher mean scores than the proposed pair.
Limits visible in the experimental design
The central transfer result concerns improvement on held-out examples from known datasets. The shared training pool already contains labeled training examples from each of the sources on which the full system is evaluated. The private branch receives target-specific training as well. A test on a new joke form or collection excluded entirely from shared training would ask a stronger question. It would show whether the representation supports transfer when no examples from that source contributed to its shared classification stage. The current results support combining evidence across these corpora for familiar targets.
The MLM stage also has an asymmetry built into it. Shortjokes supplies the masked-word material for every classifier initialized through that stage. The paper then changes the role of Shortjokes in pooled classification by restricting its share. The comparison establishes that the specified training sequence is effective. It does not show how choosing another MLM source, or constructing a mixture for word recovery itself, would change the outcome. It also reports no control pairing humor-domain adaptation with a comparable amount of additional masked training on a different kind of text. The results therefore leave room for several explanations of what additional word recovery contributes.
The balanced and complete pool comparison concerns corpus composition. Corpora are an imperfect stand-in for humor types. Some formats overlap across datasets, and Shortjokes combines forms internally. A change in the source mixture can affect subject matter, style, and the distribution of labeling cues along with the representation of different humor devices. The paper gives no breakdown of test gains by device within each corpus. A reader can conclude that controlling the large source’s contribution helped the tested paired architecture. The results cannot identify an ideal distribution of forms or show that the same mixture would work best at another scale.
The reporting also leaves some details open for reproduction from the paper itself. The shared-pool totals and the account of the sampling procedure do not fully align, and the Shortjokes description leaves its negative examples less clearly characterized than the other corpora’s. These details affect the interpretation of source balance. An exact replication of the data comparison needs the actual split membership and the implemented sampling procedure. The authors’ release of code and data gives those details a separate place to be specified.
The binary labels impose another limit. Reddit upvotes, selection of pun quotations, and deliberate headline editing give ways to operationalize humor for the experiments. Those sources encode different judgments. In particular, an edit can receive a positive label by construction, while a punchline receives its Reddit label according to a response threshold. The experiments do not report agreement between readers, variation among audiences, or results by demographic group. They measure how well the systems recover the corpus labels. Nothing in the design makes the resulting score a measure of how funny a text would be to an arbitrary reader.
The qualitative cases make the distinction between prediction and explanation concrete. They show that a shared-private classifier can correctly handle some examples that ordinary BERT misses, and they offer plausible accounts of those improvements. They also show cases where both systems fail. The selected examples do not establish how often either pattern occurs or whether the shared representation is the source of a given correct prediction. Neither branch is removed at prediction time for those examples, and the vocabulary explanations are not tested by a systematic intervention. The result is a set of observations that can guide further evaluation of how predictions arise.
Finally, robustness in the tables refers to variation across repeated runs under the stated benchmark conditions. The small standard deviations in several settings support reliability in that sense. They do not measure sensitivity to a new source, different labeling conventions, or otherwise equivalent rewrites of the inputs. The significance tests support the comparisons marked in the paper. Broader claims about robustness or general humor recognition would require evidence tied to those other conditions.
What came after
Turgeman and colleagues cite the study in a later paper that asks about the possibility of generalizing humor detection. That question takes up a distinction visible in Arora and colleagues’ design. Sharing training across several known datasets can improve the classifier prepared for each one. Generalization can also mean recognizing humor outside the sources and labeling conditions represented in training. The earlier study supplies evidence for the first setting, and the later title puts the broader question at the center of the investigation. One Joke to Rule them All? On the (Im)possibility of Generalizing Humor Detection
The citation and title establish this connection at the level of the research question. They leave the later paper’s procedures and findings unspecified, including whether it reused a dataset, replicated the paired BERT architecture, or tested an extension of it. Arora and colleagues’ clearest contribution to that question is the comparison among a target-trained encoder, a shared decision, and a classifier that learns from both shared and private representations. It gives a concrete example of where pooling helps and where specialization still pays off, with the training exposure for each target defining the scope of the result.
Cite
Cite as Aseem Arora, Gaël Dias, Adam Jatowt and Asif Ekbal. 2022. Transfer Learning for Humor Detection by Twin Masked Yellow Muppets. Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 2: Short Papers).
@inproceedings{arora2022transfer,
title = {{Transfer Learning for Humor Detection by Twin Masked Yellow Muppets}},
author = {Aseem Arora, Gaël Dias, Adam Jatowt and Asif Ekbal},
booktitle = {Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 2: Short Papers)},
year = {2022},
doi = {10.18653/v1/2022.aacl-short.1},
url = {https://doi.org/10.18653/v1/2022.aacl-short.1}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/arora-2022-transfer-learning-humor-detection-twin/