XMeCap: Meme Caption Generation with Sub-Image Adaptability

Yuyan Chen, Songzhou Yan, Zhihong Zhu, Zhixu Li, Yanghua Xiao

Understanding humor is one of the "final frontiers" for artificial intelligence. While Large Language Models (LLMs) have become adept at text, memes present a unique challenge: they are multi-modal, culturally nuanced, and often rely on complex multi-image structures to deliver a punchline.

In their recent paper, "XMeCap: Meme Caption Generation with Sub-Image Adaptability," researchers from Fudan University and Peking University introduce a framework designed to bridge the gap between visual sub-regions and humorous text generation.

TL;DR

XMeCap is a novel framework for generating meme captions that excels at handling multi-image memes by aligning specific visual regions with textual tokens. By combining supervised fine-tuning (SFT) and reinforcement learning (RL) with a custom reward model, it outperforms state-of-the-art baselines by up to 8.5% in caption quality and humor.

What Problem Does This Paper Address?

Most existing research in meme analysis focuses on single-image memes. However, social media is dominated by multi-panel memes where the humor emerges from the relationship between different images (e.g., an "Expectation vs. Reality" comic).

Existing models struggle with two main issues:

  1. Effective Integration: How do you fuse information from multiple sub-images into a single, coherent narrative?
  2. Shared Captions: In multi-panel memes, one caption must often fit the context of several distinct visual states.

As shown in Figure 1, the transition from a single-image expression to a multi-image story about deteriorating Wi-Fi signals requires the model to understand temporal or logical progression, not just static objects.

Figure 1: The distinction between single-image and multi- image memes.

Methods

The XMeCap framework consists of three main stages:

  1. Feature Extraction & Sub-Image Identification: The authors use OpenCV to identify sub-image boundaries and LLaVA-1.5-7B as a visual encoder. They also employ a "Chain-of-Humor" (CoH) template, which prompts the model to explicitly consider the core concept, emotion, event, consequence, and humor elements before generating the final text.
  2. Adaptive Transformation: This layer maps visual and textual features into a unified space. Crucially, it uses a self-attention mechanism to calculate token-level similarity. This ensures the model knows exactly which word in the caption corresponds to which part of the image (e.g., matching the word "beating" to a pained facial expression).
  3. Attention-Guided Generation: The model is refined through a two-step process:
  4. Supervised Fine-Tuning (SFT): Incorporates a Kullback-Leibler (KL) divergence loss to align the LLM’s predicted similarity with the actual visual-textual grounding.
  5. Reinforcement Learning (RL): A reward model is trained using both human rankings and "attention-based rankings" to ensure the generated captions are not just descriptive, but actually funny and human-preferred.
Figure 2: The overview of the proposed Chinese Meme caption generation framework XMeCap.

Datasets

The researchers constructed a new large-scale Chinese meme dataset containing 12,320 memes.

  • Structure: 54% single-image, 46% multi-image.
  • Sentiment Categories: Self-praise, praise of others, self-mockery, and mockery of others.
  • External Benchmarks: To test generalization, they also evaluated XMeCap on humor detection tasks using the UR-FUNNY, MUStARD, and MHD datasets.

Key Insights and Ideas

  • Local Attention is Key: The "aha moment" of this research is that global image features are insufficient for humor. Humor often resides in a tiny detail—a raised eyebrow or a specific icon. By forcing the model to attend to these "local" similarities, the captions become significantly more relevant.
  • The "Negative" Advantage: Interestingly, XMeCap performs better on memes with negative connotations (self-mockery and mocking others) than positive ones. The authors suggest that the contrastive nature of humor is more easily captured in these "negative" spaces.
  • LLMs as Judges: The study found a very high correlation (0.935) between human scores and GPT-4o evaluations, suggesting that advanced LLMs are becoming reliable proxies for subjective human metrics like "creativity" and "humor."

Key Results

XMeCap demonstrated clear superiority over both traditional multi-modal models and general-purpose LLMs like GPT-4v:

  • Single-Image Memes: Achieved an average evaluation score of 75.85, outperforming the best baseline by 6.75%.
  • Multi-Image Memes: Achieved a score of 66.32, an 8.56% improvement over baselines.
  • Humor Detection: On the UR-FUNNY benchmark, XMeCap reached 91.36% accuracy, significantly higher than specialized humor detection models like HKT (77.36%).
Figure 3: Illustrative interpretation of meme-caption associations in single-image and multi-image memes.

Limitations and Future Work

Despite its success, XMeCap isn't perfect. The authors note that while the model is precise in its descriptions, it occasionally misses the "creative spark" that makes a meme truly viral. There are also ongoing challenges regarding cultural sensitivity—humor that is funny in one culture may be offensive or nonsensical in another.

Future work will likely focus on cross-cultural adaptability and integrating more sophisticated semantic analysis tools to refine the "wit" of the generated captions.

Summary updated

BibTeX
@inproceedings{chen2024xmecap,
  author = {Yuyan Chen and Songzhou Yan and Zhihong Zhu and Zhixu Li and Yanghua Xiao},
  title = {{XMeCap: Meme Caption Generation with Sub-Image Adaptability}},
  booktitle = {ACM Multimedia},
  year = {2024},
  doi = {10.1145/3664647.3681332},
}
Figure