Table of Contents
Fetching ...

Exploring Chinese Humor Generation: A Study on Two-Part Allegorical Sayings

Rongwu Xu

TL;DR

This work investigates how language models can understand and generate Chinese humor through two-part allegorical sayings. It compares a three-stage fine-tuning pipeline on a Pinyin-augmented mT5 (PmT5) with contrastive learning against zero-shot and few-shot prompting of a large LLM (ChatGPT) across completion and from-scratch generation tasks. Evaluation combines automatic metrics (BLEU, ROUGE, BERTScore) with human judgments on coherency and humor, aided by a learned scoring model trained on annotated data. Findings show that prompting an LLM can match the fine-tuned model in many cases, but human creativity remains superior; Pinyin augmentation and contrastive learning improve generation quality, highlighting the potential and current limits of computational Chinese humor generation.

Abstract

Humor, a culturally nuanced aspect of human language, poses challenges for computational understanding and generation, especially in Chinese humor, which remains relatively unexplored in the NLP community. This paper investigates the capability of state-of-the-art language models to comprehend and generate Chinese humor, specifically focusing on training them to create allegorical sayings. We employ two prominent training methods: fine-tuning a medium-sized language model and prompting a large one. Our novel fine-tuning approach incorporates fused Pinyin embeddings to consider homophones and employs contrastive learning with synthetic hard negatives to distinguish humor elements. Human-annotated results show that these models can generate humorous allegorical sayings, with prompting proving to be a practical and effective method. However, there is still room for improvement in generating allegorical sayings that match human creativity.

Exploring Chinese Humor Generation: A Study on Two-Part Allegorical Sayings

TL;DR

This work investigates how language models can understand and generate Chinese humor through two-part allegorical sayings. It compares a three-stage fine-tuning pipeline on a Pinyin-augmented mT5 (PmT5) with contrastive learning against zero-shot and few-shot prompting of a large LLM (ChatGPT) across completion and from-scratch generation tasks. Evaluation combines automatic metrics (BLEU, ROUGE, BERTScore) with human judgments on coherency and humor, aided by a learned scoring model trained on annotated data. Findings show that prompting an LLM can match the fine-tuned model in many cases, but human creativity remains superior; Pinyin augmentation and contrastive learning improve generation quality, highlighting the potential and current limits of computational Chinese humor generation.

Abstract

Humor, a culturally nuanced aspect of human language, poses challenges for computational understanding and generation, especially in Chinese humor, which remains relatively unexplored in the NLP community. This paper investigates the capability of state-of-the-art language models to comprehend and generate Chinese humor, specifically focusing on training them to create allegorical sayings. We employ two prominent training methods: fine-tuning a medium-sized language model and prompting a large one. Our novel fine-tuning approach incorporates fused Pinyin embeddings to consider homophones and employs contrastive learning with synthetic hard negatives to distinguish humor elements. Human-annotated results show that these models can generate humorous allegorical sayings, with prompting proving to be a practical and effective method. However, there is still room for improvement in generating allegorical sayings that match human creativity.
Paper Structure (14 sections, 6 equations, 4 figures, 3 tables)

This paper contains 14 sections, 6 equations, 4 figures, 3 tables.

Figures (4)

  • Figure 1: (Top) Examples of Chinese two-part allegorical sayings. The "riddle" parts are marked in black with the "explanation" in blue. Pinyin and translation are noted in red and underlined texts, respectively. The three representative types of allegorical sayings are: I.Metaphor/Allegory-based saying, II.Reasoning-based saying, and III.Homophone-based saying. (Bottom) Two generation tasks: A. Completion of explanations on given riddles and B. Generation of complete sayings on given entities that act as topics.
  • Figure 2: An overview of our PmT5 language model, which includes Pinyin inputs. The modifications are highlighted within the red dashed frame. Our enhancements consist of two main components: (a) a Pinyin embedding layer that converts Pinyin into vectors of size $d_{model}$, and (b) a multi-head attention layer to fuse the Pinyin embedding with token embeddings, resulting in a combined fusion embedding, also of size $d_{model}$. (In the original T5/mT5 model, where token embeddings are directly added with positional encodings to serve as the encoder's input.)
  • Figure 3: An illustration of the contrastive learning process for allegorical sayings. The semi-circular rectangles represent the output from the encoder. Within each mini-batch, riddle $i$ serves as the Anchor, and its correct explanation is identified as the Positive, aiming to maximize their alignment. Explanations corresponding to different riddles are considered as Negatives, and a normal (not humorous) completion of riddle $i$ which serves as a Hard Negative, both intended to minimize agreement with the Anchor.
  • Figure 4: Prompt templates for generating Chinese allegorical sayings.