A Template Is All You Meme

Luke Bates, Peter Ebert Christensen, Preslav Nakov, Iryna Gurevych · OpenReview

Abstract

Memes are a modern form of communication and meme templates possess a base semantics that is customizable by whomever posts it on social media. Machine learning systems struggle with memes, which is likely due to such systems having insufficient context to understand memes, as there is more to memes than the obvious image and text. Here, to aid understanding of memes, we release a knowledge base of memes and information found on www.knowyourmeme.com, which we call the Know Your Meme Knowledge Base (KYMKB), composed of more than 54,000 images. The KYMKB includes popular meme templates, examples of each template, and detailed information about the template. We hypothesize that meme templates can be used to inject models with the context missing from previous approaches. To test our hypothesis, we create a non-parametric majority-based classifier, which we call Template-Label Counter (TLC). We find TLC more effective than or competitive with fine-tuned baselines. To demonstrate the power of meme templates and the value of both our knowledge base and method, we conduct thorough classification experiments and exploratory data analysis in the context of five meme analysis tasks.

The "Templatic" Nature of Memes

In the landscape of digital communication, memes represent a "final boss" for artificial intelligence. Traditional computer vision and natural language processing models often treat memes as static images paired with OCR-extracted text. However, this approach ignores the fundamental "templatic" nature of memes. A meme's meaning is rarely derived solely from its literal components; instead, it relies on a shared cultural understanding of a specific structure.

Variations of the 'Is this a pigeon?' meme template demonstrating how a single base structure can be adapted for diverse contexts.

For instance, the "Is this a pigeon?" template signals a character’s comical misinterpretation of reality. As shown in Figure 6, a single template can be remixed across countless fandoms and contexts—from Sesame Street to Attack on Titan—while maintaining its underlying semantic structure. Without recognizing this underlying template, a model might focus on the literal butterfly or the man, missing the sarcastic or ironic intent entirely. This "context blindness" is a significant hurdle for current AI systems.

The Know Your Meme Knowledge Base (KYMKB)

To bridge the gap between raw pixels and cultural context, the researchers introduced the Know Your Meme Knowledge Base (KYMKB). This massive library consists of 5,200 meme templates and 54,000 specific examples scraped from the "Know Your Meme" website. Each entry in the KYMKB is a rich data point containing the base template image, its origin, its intended meaning, and various instances of its use. This structured database allows models to ground their interpretations in established cultural semantics rather than relying on visual features alone.

Methodology: TSplit, TLC, and RAG

The paper introduces several novel methods to leverage this knowledge base:

  1. TSplit (Template-Aware Splitter): Existing datasets often suffer from data leakage, where the same template appears in both training and testing sets. This allows models to "cheat" by memorizing layouts. TSplit uses CLIP-based embeddings to ensure that specific templates are confined to either the training or test set, forcing models to generalize to unseen formats.
  2. TLC (Template-Label Counter): This is a non-parametric, retrieval-based classification approach. Instead of complex fine-tuning, TLC identifies a new meme's "nearest neighbor" templates in the KYMKB and assigns a label based on the historical usage of those templates.
  3. RAG for Memes: The authors also explored Retrieval-Augmented Generation, providing Large Multimodal Models (like LLaVA) with the "About" section of a meme's template to provide necessary cultural background before classification.

Key Insights: Templates as Semantic Anchors

A primary finding of this research is that the template itself often carries the bulk of a meme's meaning. In many classification tasks, identifying the template proved more predictive than analyzing the overlaid text. This "templatic signal" also facilitates multilinguality; because the visual structure remains constant, a model that understands a template can interpret memes in different languages without explicit translation.

A specific instance of the 'Is this a pigeon?' template applied to the field of NLP.

Furthermore, the study highlights the "cheating" problem in previous state-of-the-art results. When TSplit was applied to prevent models from simply memorizing layouts, performance metrics dropped, revealing that many models were not truly "understanding" the memes but rather recognizing familiar patterns. Figure 2 demonstrates how a template's core meaning—misinterpretation—is mapped onto a specific domain, such as the excitement and skepticism surrounding ChatGPT in the NLP community.

Results and Performance

The proposed methods achieved state-of-the-art results across four major benchmarks: MultiOff (offensive content), Memotion 3 (sentiment/emotion), FigMemes (figurative language), and MAMI (misogyny). On the MultiOff dataset, the template-aware approach reached an F1 score of 66.16. Additionally, grounding LLaVA with KYMKB data improved its performance on the difficult FigMemes dataset, demonstrating that even advanced models benefit from explicit cultural context.

Conclusion and Future Directions

While the KYMKB is a significant step forward, it currently reflects a bias toward Western, English-speaking internet culture. Future work will focus on expanding the knowledge base to include more diverse languages and non-static formats, such as video and audio memes. By developing a more formal taxonomy of visual humor, the researchers hope to move AI closer to a truly human-like understanding of digital culture.

Summary updated

BibTeX
@inproceedings{bates2025template,
  author = {Luke Bates and Peter Ebert Christensen and Preslav Nakov and Iryna Gurevych},
  title = {{A Template Is All You Meme}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.525},
}
Figure