A Template Is All You Meme (2025)

Abstract: Templatic memes, characterized by a semantic structure adaptable to the creator’s intent, represent a significant yet underexplored area within meme processing literature. With the goal of establishing a new direction for computational meme analysis, here we create a knowledge base composed of more than 5,200 meme templates, information about them, and 54,000 examples of template instances (templatic memes). To investigate the semantic signal of meme templates, we show that we can match memes in datasets to base templates contained in our knowledge base with a distance-based lookup. To demonstrate the power of meme templates, we create TSplit, a method to reorganize datasets, where a template or templatic instance can only appear in either the training or test split. Our re-split datasets enhance general meme knowledge and improve sample efficiency, leading to more robust models. Our examination of meme templates results in state-of-the-art performance for every dataset we consider, paving the way for analysis grounded in templateness.

## introduction memes are a form of communication capable of succinctly conveying complicated messages. they have been defined as a unit of cultural transmission or of imitation and replication (dawkins, 1976), but all memes possess the trait of referencing a cultural moment shared by a group of people. despite their basis in internet culture, they exhibit sociolinguistic traits of in-group communication (styler, 2020; holm, 2021). a meme's meaning can therefore be opaque to those who do not belong to the in-group. meme templates are common patterns or elements, such as text or images, that are used to create novel memes. they can be difficult to parse because they can be combined in different ways and each one has its own unique meaning, the specific semantics of which is customizable by the person posting the meme (the poster). the template and its message can be referenced by an image, but may not be directly related to that image. if the viewer is not familiar with the template in question, they may not understand the meme's meaning. for example, in figure 1 , we see three instances of the popular is this a pigeon? foot_1 template. this template conveys the idea that the subject of the person is misinterpreting the object of the butterfly due to his own worldview or limited knowledge. the meaning can be tuned by the poster using overlaid text or images. importantly, such altered images are considered instances of the same template. to interpret memes, one must recognize the entities in the meme and the template the meme uses, if any. it is important to distinguish between templatic memes and other meme types. templatic memes reference a meme template, which is a commonly reused material (e.g., text, images, audio), to create a novel instance that is still grounded in the meme template's semantics. non-templatic memes can be (visual) puns, jokes, or emphasis that might not directly reference a meme template and can be understood without knowledge about meme templates or even memes (see section a.9). know your meme (kym), 3 the internet meme database, is a valuable resource for information related to memes, and especially, to templatic memes. even people familiar with memes may not be aware of a specific template and can look it up on kym. the meme entries provide the base template and information about it, such as its meaning, origin, examples, etc. by reviewing entries of unfamiliar templates, users learn how to interpret and use the template themselves to create novel instances for their specific communication needs. memes are of interest to the machine learning community (aggarwal et al., 2023) because they are difficult, but can still be formulated as classification or generation tasks (peirson and tolunay, 2018). they are also used to spread misinformation and hate speech (pramanick et al., 2021a). memes usually express concepts humorously, and humor has been shown to increase the persuasiveness of an idea (walter et al., 2018). thus, developing systems that can understand memes is important to prevent the spread of harmful content. however, ai researchers and datasets treat memes as static images with text (du et al., 2020; qu et al., 2022) despite memes having their own unique characteristics, such as being templatic or not. here, we analyze memes as memes, rather than as images, text, or a combination of both. to support this, we introduce the know your meme knowledge base (kymkb), a database of meme templates and associated information sourced from kym. we hypothesize that knowledge of meme templates provides valuable context for understanding memes. using a distance-based lookup, we match templatic instances to base templates in the 3 https://knowyourmeme.com/ kymkb, enabling retrieval of meme-specific context. this context is useful for prompting large language models (llms) or multimodal vision-lms in a retrieval-augmented generation (rag) framework, as demonstrated in section a.14. to investigate the effect meme templates have on modelling, we create a method for (re)splitting meme datasets such that a template and its instances can only appear in either the training or test split, which we call the template-aware splitter (tsplit). tsplit (re)organizes dataset entries based on their distance in embedding space from the kymkb. we find that controlling for template awareness makes tsplit more sample-efficient than standard fine-tuning or random sampling. we also show that tsplit has strong regularization effects in scenarios where models are likely to overfit. our analysis of meme templates results in stateof-the-art (sota) performance for all datasets we consider, establishing a robust foundation for future research grounded in templateness. our contributions are as follows: ## related work there has been a lot of work on analyzing memes in various task formulations. memes as harmful content this includes multioff (suryawanshi et al., 2020), a dataset of offensive memes related to the 2016 us presidential election. the mami dataset (fersini et al., 2022) is composed of two datasets from semeval-2022: in subtask a, the goal is to identify misogyny in memes, while in subtask b, it is to determine different types of misogyny expressed by a meme. lin et al. (2023) recognized that the surface-level text and the image of memes are insufficient and employed large language model (llm) knowledge distillation to classify dangerous memes. memes as a form of language dimitrov et al. (2021) pointed out that memes can be persuasive by exploiting more than 20 different propaganda techniques. figmemes (liu et al., 2022) scraped images from a politically incorrect and infamously toxic board on 4chan, /pol/, @xcite and labeled over five thousand memes with six different types of figurative language used in the meme, recognizing that memes are capable of expressing abstract and complicated messages. mishra et al. (2023) released memotion 3, which is composed of memes in hindi and english, labeled for sentiment, emotion detection, and emotion intensity. hwang and shwartz (2023) released a dataset of meme explanations to aid in resolving metaphors in memes. zhou et al. (2024) showed that memes and meme templates can be clustered by their semantic function. context for memes all the above work finetuned multimodal plms or prompted llms on their respective datasets, but did not use additional context in order to increase meme understanding. this is a trend in meme-related ml research. one exception is memex (sharma et al., 2023). they use wikipedia and quora to assemble explanations to ask if an explanation document is relevant for a meme, formulating a novel task and multimodal model. notably, this work uses meme-external information (wikipedia/quora), but not meme knowledge, e.g., information about the template used by the meme. we emphasize that the context they inject is common knowledge or knowledge about named entities, not knowledge about memes. tommasini et al. (2023) developed a knowledge graph of memes by scraping and querying different sources of information, such as kym, to connect memes to the information they reference. however, they do not leverage the graph in a downstream task, nor is it clear how their graph could be applied to meme 4 https://boards.4chan.org/pol/ analysis due to a lack of demonstrations. ## the know your meme knowledge base know your meme, the "internet meme database", can be thought of as the wikipedia for memes. users create web pages of a meme template and document information about it, e.g., its meaning, and add examples of its usage (see figure 2 ). the community reviews and approves entries, updating them as the template's usage evolves. template instances are important for meme understanding. in figure 2 , we see that the template can be altered via overlaid text and images to tune it for a specific communication goal. existing approaches rely on ocr to extract the text and/or the named entities (kougia et al., 2023), but this would not work in many cases, e.g., if the entities are images referencing a popular youtube video. @xcite kym is a valuable resource that has been underutilized by the ai community. to address this, we create the kymkb, a collection of meme templates, examples, and information about the meme's usage. to ensure the quality of the entries, we crawl templates from kym that are approved by the community, scraping 5,220 base templates and 49,531 examples (see section a.9). memes may deviate from their template-based origin, and the kymkb accounts for this. consider our running example of is this a pigeon?. this template was popularized in 2011, but it then had a resurgence in april of 2018. by june 2018, a female version of the template had emerged, which was interpreted by some users as an example of gender transitioning. such usage and evolution is documented by kym users in the form of both text and images. popular template instances that differ from their origin often become their own template, such as pepe the frog foot_3 vs. feels bad man/sad frog. @xcite the former is a template originally used in a manner similar to emoticons, while the latter is a popular instance of pepe that became its own template expressing sorrow or disappointment. by collecting examples, user-curated information, and distinct but related templates, the kymkb is organized for the dynamic nature of memes. ## template-meme analysis to investigate the power of templates, we conducted exploratory data analysis on four meme datasets, multioff, memotion 3, figmemes, and mami. specifically, we encoded the kymkb templates, fit a nearest neighbor lookup, as this is an intuitive and commonly used vector-similarity measure (buitinck et al., 2013), query the 500 closest neighbors in the datasets, and manually inspect the similarities between template-meme pairs. henceforth, we use clip as our encoder as it is a commonly-used plm for vision and language learning problems and memes (pramanick et al., 2021b), but the encoding function is ultimately arbitrary and we refer to it as f . in our analysis, we group memes into four categories, detailed below: figure 3 shows a sample of our template-meme pairs and ## template-aware splitter given that we are able to successfully match memes to templates in the kymkb, we hypothesize that many meme datasets are composed of nothing more than templatic instances, which may already be contained within our knowledge base. this would then create a strong signal we could leverage in a downstream task. to investigate this, we demonstrate another use case and develop a tool from the kymkb called the template-aware splitter (tsplit), which quantifies templateness by comparing base templates to their examples (see figure 2 ). tsplit embeds a template (@xmath0, then computes the euclidean distance between them (dists [i] = dist(ref, examp [j] )). these distances are used to compute a threshold value, such as the median distance (threshold [i] = median(dists [i] )). we explore four threshold methods: maximum, median, mean, and 25 th percentile distances. using 9 https://knowyourmeme.com/memes/you-get-use d-to-it 10 https://en.wikipedia.org/wiki/hyperdimension _neptunia the maximum provides a lenient definition of a template instance, allowing greater visual variance (see figure 3 ), while the 25 th percentile offers a stricter interpretation. tsplit encodes a meme, matches it to the closest template in the kymkb, and compares the distance to the template's threshold. if the distance exceeds the threshold, the meme is assigned a unique identifier (ui); otherwise, it is recorded as an instance of the template. while our focus is on templatic memes, tsplit also handles non-templatic memes via uis. we use tsplit to reorganize datasets and assign memes to a template or declare them non-templatic. tsplit samples our templates and uis without replacement, such that a template or ui cannot appear in both the training and the test data. our goal is to decouple the data distribution from template robustness, inspired by work done in qa, nli, and bias detection on adversarial dataset creation and modelling (jia and liang, 2017; gururangan et al., 2018; baly et al., 2020). note that tsplit is task agnostic (see section a.2). to examine the effect tsplit has on dataset sampling, we tested various versions of tsplit on six meme classification datasets: figmemes with seven labels of different types of figurative language, multioff a binary dataset where the labels can be offensive or non-offensive, memotion 3, where task a has three labels for sentiment analysis and task b has four for different types of emotion, and mami with task a being binary misogyny detection and task b having four labels with different types of misogyny being expressed (see tables 18 and 19 ). we choose these datasets because they were made to address the issue of harmful meme detection and to frame our analysis of meme templates in the light of this important goal. each dataset used google vision to provide ocr text overlaid on memes. @xcite to avoid overlapping templates and unique identifiers between dataset splits, we construct an array of distinct objects, meaning detected templates or unique identifiers. we randomly shuffle the array and then create a test split index. everything that appears before the index is an object that can appear in the training data and everything after can appear in the test data. we use the following formula to create this index: ⌊( t size d size ) * o size ⌋, where t size is the number of test examples in the original dataset, d size is the total size of the dataset, and o size is the number of distinct detected objects (templates or unique identifiers). we maintain the original dataset ratios (for example training 60%, validation 20%, and test 20%), but because we sample the resplit datasets based on detected templates, it is difficult to maintain the exact numbers. finally, it is possible that a template in the kymkb does not have any examples. in such cases, we use a global threshold value calculated by taking the maximum, median, mean, or 25 th percentile value of all template thresholds. ## conclusion and future work we analyzed the power of meme templates. to anchor our analysis to memes, we created the kymkb, containing more than 54,000 images and 5,200 base templates with detailed information about each one. we first showed that a comparison of templates to memes creates a strong signal that we can leverage in downstream tasks. we therefore proposed tsplit and found it is sample-efficient and can result in robust models. it was not our goal to create state-of-the-art meme classifiers, but we believe our methods are convincing demonstrations of the strength of meme templates -memes may be difficult to analyze, but they are not random. the potential applications of meme templates are vast. our findings demonstrate their significant impact on topics such as retrieval (see section 4), sample efficiency, model performance, and even multilingual capabilities. however, our work represents only an initial exploration of this area. future research could further investigate these applications and other critical directions, contributing to a deeper understanding of the role and utility of meme templates in computational research. our resources provide unified, inexpensive tools for future research grounded in meme knowledge, and specifically, meme templates. in future work, we will apply the kymkb to more datasets and languages in a cross-language setup and explore automatically augmenting the kymkb with new memes and with new templates.