Punny Captions: Witty Wordplay in Image Descriptions

Arjun Chandrasekaran, Devi Parikh, Mohit Bansal

TL;DR

This paper introduces a novel zero-shot framework for generating witty, pun-based image captions without requiring any humorous training data. By modeling humor as a two-stage process of linguistic incongruity and resolution, the authors' generative model outperforms standard captioning baselines and even beats constrained human writers in a Turing-style evaluation.

What Problem Does This Paper Address?

While AI has made massive strides in literally describing what is in an image, teaching machines to express humor, wit, or sarcasm remains an open challenge. Humor is deeply contextual and grounded in specific situations.

The primary bottleneck in developing humorous vision-language models is data scarcity. Collecting a large-scale dataset of witty captions is incredibly expensive and difficult because being funny on command is hard for humans, let alone machines. To bypass this, the authors tackle the task of generating pun-based remarks for ordinary, everyday images without relying on a corpus of witty captions for training.

Methods

The authors base their approach on a classic two-stage cognitive account of humor: incongruity (the introduction of an unexpected stimulus) followed by resolution (the context that allows the perceiver to make sense of the unexpected stimulus).

The system operates via the following pipeline:

  1. Extracting Tags: The model identifies concepts in the image using a state-of-the-art image classifier (Inception-ResNet-v2) combined with non-stopword tokens from a standard, literal image caption.
  2. Identifying Puns: The system cross-references these image tags against a pre-mined vocabulary of heterographic homophones (words that sound identical but are spelled differently, such as bear and bare).
  3. Generating Captions: Instead of training a new model from scratch, they modify the inference procedure of a vanilla, pre-trained image captioning model. At a specific time-step during beam search, they restrict the decoder's vocabulary to force the injection of a pun's phonological counterpart (e.g., forcing the word "bored" when the image contains a wooden "board"). They employ both forward (fRNN) and reverse (rRNN) decoders to allow the pun to appear naturally at either the beginning or the end of the sentence.
  4. Retrieving Captions (Alternative Approach): As a baseline alternative to generation, they search a massive text corpus for human-written sentences that already contain the target pun and at least one other image tag.
  5. Ranking: Candidate captions from both generation and retrieval are ranked using the log-probability score of the vanilla image captioning model to ensure grammatical correctness and contextual flow.
Figure 2: Our models for generating and retrieving image descriptions containing a pun (see Sec. 3).

Datasets

  • Evaluation Set: 100 random images sampled from the MS COCO validation set that contained objects matching their pun vocabulary.
  • Retrieval Corpus: A dataset of approximately 13.5 million sentences compiled from the Book Corpus and the NLTK toolkit.
  • Pun Vocabulary: A mined list of 1,067 unique words obtained from the web and augmented using a pronunciation similarity model based on fine-grained articulatory representations.

Key Insights and Ideas

  • Humor via Constraints, Not Data: The paper proves that humor can be treated as a constrained optimization problem. You do not need a dataset of jokes to generate wit; you simply need to intelligently break the expectations of a standard language model using phonological substitutes.
  • The Constraint Paradox: One of the most striking findings is that when humans are subjected to the exact same vocabulary and stylistic constraints as the machine (i.e., forced to use a specific pun word and avoid first-person narratives), the machine actually generates wittier captions than humans.
  • Contextual Baggage Hurts Retrieval: Generating a new sentence around a pun works significantly better than retrieving an existing one. Retrieved sentences from books often bring along specific narrative context that feels irrelevant or distracting when paired with a new image.

Key Results

The models were evaluated by human judges on Amazon Mechanical Turk (AMT) via pairwise comparisons:

  • AI vs. Baselines: The top generated captions were judged wittier than standard literal captions 68% of the time, and beat a naive word-substitution baseline 54.2% of the time.
  • The Constrained Turing Test: When human copywriters were forced to use the same pre-specified pun words and captioning style, the model's top generation was voted wittier than the human caption 55% of the time.
  • Unconstrained Creativity: Unsurprisingly, when humans were given complete creative freedom (allowed to choose any pun, sentence length, or style), they easily outperformed the model, winning the wittiness vote 90% of the time.
Examples of generated, retrieved, and human-written witty captions

Limitations and Future Work

  • The Relevance Trade-off: Forcing a pun into a description inherently makes it less literally accurate. Human judges found the witty captions to be less relevant to the images than standard boring captions.
  • Rigid Vocabulary: The model relies entirely on a pre-defined list of homophones and cannot generate more complex forms of humor like situational irony, sarcasm, or visual metaphors.
  • Creative Freedom: The current model is tightly bound to caption-like syntax. The authors note that training models to intelligently navigate true creative freedom—such as varying sentence lengths and abstract storytelling—remains an exciting open challenge for the NLP community.

Summary updated

BibTeX
@inproceedings{chandrasekaran2018punny,
  author = {Arjun Chandrasekaran and Devi Parikh and Mohit Bansal},
  title = {{Punny Captions: Witty Wordplay in Image Descriptions}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=r1W9FXbu-S},
}
Figure