Laughing Heads: Can Transformers Detect What Makes a Sentence Funny?
Not on the map. Why?
Abstract (arXiv)
The automatic detection of humor poses a grand challenge for natural language processing. Transformer-based systems have recently achieved remarkable results on this task, but they usually (1)~were evaluated in setups where serious vs humorous texts came from entirely different sources, and (2)~focused on benchmarking performance without providing insights into how the models work. We make progress in both respects by training and analyzing transformer-based humor recognition models on a recently introduced dataset consisting of minimal pairs of aligned sentences, one serious, the other humorous. We find that, although our aligned dataset is much harder than previous datasets, transformer-based models recognize the humorous sentence in an aligned pair with high accuracy (78%). In a careful error analysis, we characterize easy vs hard instances. Finally, by analyzing attention weights, we obtain important insights into the mechanisms by which transformers recognize humor. Most remarkably, we find clear evidence that one single attention head learns to recognize the words that make a test sentence humorous, even without access to this information at training time.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 12 of its 47 references that are in the map. First posted on arXiv 19 May 2021.
Builds on
12 of 47 references.
References · 12
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 994
- 2019Attention is not Explanationcited by 916
- 2019Attention is not not Explanationcited by 629
- 2019Revealing the Dark Secrets of BERTcited by 300
- 2018Learning Word Vectors for 157 Languagescited by 279
- 2019Humor Detection: A Transformer Gets the Last Laughcited by 46
- 2019"President Vows to Cut <Taxes> Hair": Dataset and Analysis of Creative Text Editing for Humorous Headlinescited by 27
- 2019Reverse-Engineering Satire, or "Paper on Computational Humor Accepted Despite Making Serious Advances"cited by 15
- 2020Stimulating Creativity with FunLines: A Case Study of Humor Generation in Headlinescited by 10
Built on by
Citing papers per year: 2022: 3; 2023: 2; 2024: 2; 2025: 2.
9 papers.
- 2025Everything, Everywhere, All at Once: Is Mechanistic Interpretability Identifiable?cited by 32
- 2023A Glitch in the Matrix? Locating and Detecting Language Model Grounding with Fakepediacited by 24
- 2024Getting Serious about Humor: Crafting Humor Datasets with Unfunny Large Language Modelscited by 9
- 2022Vision Transformers: State of the Art and Research Challengescited by 7
- 2023Representation biases in sentence transformerscited by 7
- 2024Creativity in AI: Progresses and Challengescited by 7
- 2022Transformers Go for the LOLs: Generating (Humourous) Titles from Scientific Abstracts End-to-Endcited by 6
- 2022The Naughtyformer: A Transformer Understands Offensive Humorcited by 5
- 2025Toward Machine Interpreting: Lessons from Human Interpreting Studiescited by 0
- 2025Toward Machine Interpreting: Lessons from Human Interpreting Studies11 Aug 2025
- 2025Everything, Everywhere, All at Once: Is Mechanistic Interpretability Identifiable?28 Feb 2025
- 2024Creativity in AI: Progresses and Challenges22 Oct 2024
- 2024Getting Serious about Humor: Crafting Humor Datasets with Unfunny Large Language Models23 Feb 2024
- 2023A Glitch in the Matrix? Locating and Detecting Language Model Grounding with Fakepedia4 Dec 2023
- 2023Representation biases in sentence transformers30 Jan 2023
- 2022Transformers Go for the LOLs: Generating (Humourous) Titles from Scientific Abstracts End-to-End20 Dec 2022
- 2022The Naughtyformer: A Transformer Understands Offensive Humor25 Nov 2022
- 2022Vision Transformers: State of the Art and Research Challenges7 Jul 2022