Pun-Instruct: Structured Pun Systems
- Pun-Instruct is a framework for instruction-following systems that structures pun processing through a defined tuple capturing the pun word, alternative word, and associated senses.
- It consolidates canonical subtasks—detection, location, interpretation, and generation—by leveraging joint sequence labeling and multi-source understanding models to achieve high benchmark performance.
- Robust evaluation protocols combine automatic metrics and human judgments to diagnose failures and guide advancements in both text-based and multimodal pun processing.
Pun-Instruct denotes a survey-grounded framing of instruction-following systems that can understand, explain, and generate puns. In this framing, pun generation seeks to creatively modify linguistic elements in text to produce humour or evoke double meanings while preserving coherence and contextual appropriateness, and an instruction-oriented formulation extends that objective to prompts that specify pun type, target word, contextual keywords, or explanation cues (Su et al., 7 Jul 2025). Contemporary work treats pun processing as more than binary humor recognition: a system may be required to recover a pun word , an alternative word , and the senses or meanings licensed by context, and in multimodal settings the same structure must be grounded jointly in image and text (Xu et al., 2024, Zangari et al., 15 Sep 2025, Xu et al., 7 Apr 2026).
1. Conceptual scope and formal representation
A pun is defined in the recent literature as wordplay exploiting polysemy or phonetic similarity to create humor. The survey literature organizes the space into homophonic, heterographic, homographic, and visual puns, while text-oriented evaluation papers make the underlying structure explicit with a tuple of the form , where is the pun word, is the alternative word, and are the relevant senses or meanings (Su et al., 7 Jul 2025, Xu et al., 2024). In the decomposition used for robustness-oriented pun understanding, heterographic puns are cases where only appears in the text and is evoked by context, whereas homographic puns are cases where and the contrast is carried by different senses of the same form (Zangari et al., 15 Sep 2025).
This formalization matters because it converts puns from loosely defined humor into structured ambiguity. A Pun-Instruct system is therefore naturally asked not only whether a sentence is a pun, but which lexical unit carries the ambiguity, what the hidden or alternate lexical partner is, and how the surrounding context licenses both interpretations. The same logic extends to multimodal puns, where the tuple is reused, with 0 as the literal concrete object sense shown visually and 1 as the figurative behavior, state, or alternate sense implied by the caption (Xu et al., 7 Apr 2026).
2. Canonical subtasks and their formulation
The classical text-processing subtasks are pun detection, pun location, and pun interpretation. Joint modeling work formulates detection and location as a single sequence-labeling problem over a sentence 2 with a tag sequence 3, and introduces a 4 scheme in which words before the pun are tagged 5, the pun word is tagged 6, and words after the pun are tagged 7; if no pun is present, all words are tagged 8 (Zou et al., 2019). This encoding imposes the structural constraint that each context contains at most one pun, and the reported results show strong benchmark performance, including homographic detection 9 and location 0, and heterographic detection 1 and location 2 (Zou et al., 2019).
Pun interpretation has been treated either as sense selection or as sentence-pair classification. DANN reformulates pun location with a dual-attention neural network that combines contextual embeddings from BERT, sense-aware embeddings derived from WordNet glosses, and pronunciation-aware embeddings from phoneme sequences, then predicts a per-token label using the concatenated representation (Liu et al., 2021). The same work reframes interpretation as classification over pun–gloss pairs by concatenating the pun sentence, a [SEP] token, and a candidate gloss, assigning a binary yes/no label, and using the top-2 probabilities at test time to select the two meanings. On SemEval-2017 Task 7, DANN reports homographic pun-location performance of 3, 4, 5, heterographic performance of 6, 7, 8, and homographic interpretation 9 (Liu et al., 2021).
Instruction-oriented evaluations subsequently consolidated these tasks into recognition, explanation, and generation. In that formulation, recognition asks whether a text is a pun or non-pun; explanation asks for the pun pair and the two meanings; and generation asks for a new pun from a pun pair, optionally with contextual words (Xu et al., 2024). Context-situated generation adds a further step: given only a context, usually represented as keywords, the system must first identify a suitable pun pair and then produce a pun that fits that context (Sun et al., 2022). Multimodal work further expands the task set to detection, localization, and explanation over image-caption pairs, with extraction of the full tuple 0 in the hardest setting (Xu et al., 7 Apr 2026).
3. Datasets and benchmark resources
Modern Pun-Instruct work depends on benchmarks that expose not only positive puns but also contexts, explanations, adversarial negatives, and multimodal grounding (Sun et al., 2022, Zangari et al., 15 Sep 2025, Xu et al., 7 Apr 2026, Su et al., 7 Jul 2025).
| Resource | Size | Primary role |
|---|---|---|
| SemEval-2017 Task 7 | 2,250 homographic contexts and 1,780 heterographic contexts; 1,607 and 1,271 contain a pun | canonical text benchmark |
| CUP | 4,551 context–pun-pair tuples; 2,753 compatible and 1,798 incompatible | context-situated generation |
| ExPUNations | 1,999 items | explanations and funniness ratings |
| ChinesePun | 2,106 items | Chinese homophonic and homographic puns |
| PunnyPattern / PunBreak | 1,200 and 1,100 examples | robustness to templates and perturbations |
| MultiPun | 445 positives and 890 negatives | multimodal pun understanding |
SemEval-2017 Task 7 remains the central benchmark for location, interpretation, and many generation experiments. CUP extends that regime by explicitly encoding the many-to-many relation between context and pun pair: a single context can support many different pun pairs, which SemEval-style single-pair annotations miss (Sun et al., 2022). ExPUNations adds human explanations and funniness ratings, making it useful for instruction-style explanation and constrained generation (Su et al., 7 Jul 2025). ChinesePun, Pun Rebus Art, and UNPIE widen the landscape toward multilingual and multimodal settings, indicating that Pun-Instruct is not inherently English-only (Su et al., 7 Jul 2025).
The newer robustness benchmarks are designed to expose shortcut learning. PunnyPattern isolates six highly predictive pun-construction templates and balances puns and non-puns within those templates, while PunBreak constructs near-miss negatives that retain pun-like surface form but destroy the valid wordplay relation (Zangari et al., 15 Sep 2025). MultiPun performs a similar function for VLMs by pairing each positive multimodal pun with two adversarial distractors: Explicative Substitution, which removes ambiguity by paraphrasing the hidden meaning, and Random Substitution, which preserves scene coherence while breaking the pun relation (Xu et al., 7 Apr 2026).
4. Modeling paradigms
Joint sequence labeling treats pun detection and location as a single structured prediction problem. The BiLSTM-CRF architecture with character-level features, pretrained GloVe embeddings, and a position indicator exploits both contextual dependencies and the empirical tendency for puns to occur in the second half of a sentence; the 1 tagging scheme improves over a simpler 2 scheme because it naturally encodes the single-pun-per-context constraint (Zou et al., 2019).
Multi-source understanding models integrate semantics, phonology, and context rather than relying on a single cue. DANN uses WordNet definitions for sense attention, phoneme embeddings for pronunciation attention, and BERT sentence context, then concatenates 3, 4, and 5 before projection. The same paper removes hard dependence on an external WSD pipeline by attending over all available senses, and its case analysis shows that adding semantic information can correct pronunciation-driven errors such as predicting patent rather than lies in “He stole an invention and then told patent lies” (Liu et al., 2021).
Adversarial and reward-based generation treats puns as conditional generation under dual-sense constraints. Pun-GAN receives a target word and a pair of senses 6, uses a constrained neural LLM as generator, and trains it with discriminator-derived reward so that both senses are plausible and balanced in the generated sentence (Luo et al., 2019). On automatic metrics it reports unusualness 7, Dist-1 8, and Dist-2 9, outperforming LM, CLM, and CLM+JD; in human evaluation it reports ambiguity 0, fluency 1, and overall 2, still below human scores of 3, 4, and 5 (Luo et al., 2019).
Humor-principle-guided unified generation attempts to generate both homophonic and homographic puns within one framework. The unified framework of 2022 operationalizes ambiguity, distinctiveness, and surprise through a context word/phrase selector, a GPT-2 generation model trained on non-pun sentences, and a BERT-based label predictor that steers decoding with labels A, D1, and D2 (Tian et al., 2022). The full model reports human-evaluated success rates of 6 for homophonic puns and 7 for homographic puns, with human-written references at 8 and 9, and the paper attributes much of the homographic difficulty to poor substitute pun/alternative word pairs (Tian et al., 2022).
Retrieve-and-generate pipelines move from pun-word-conditioned generation to context-conditioned generation. In context-situated pun generation, a retrieval module first scores candidate pun pairs against context keywords using either supervised sentence-matching models such as BERT-base, RoBERTa-base, DeBERTa-base, RoBERTa-large-NLI, and BART-large-MNLI or an unsupervised GloVe distance baseline, and a T5-base generation module then produces the pun from the context, pun pair, and senses (Sun et al., 2022). The reported results show that RoBERTa-large-NLI reaches test 0 in retrieval, the supervised retriever yields 1, and the best generation model, T5PT+FT, reaches 2 success given a plausible tuple; the end-to-end pipeline with top-1 retrieval reaches 3 success, compared with a human success rate of 4 (Sun et al., 2022).
5. Evaluation protocols and instruction design
Pun-Instruct evaluation has moved from plain accuracy toward diagnostic metrics that expose whether a model has actually identified the pun mechanism. Recognition-oriented work measures TPR, TNR, prompt-induced 5 and 6, and Cohen’s 7 under dual-biased prompts so that prompt susceptibility becomes visible rather than hidden by aggregate accuracy (Xu et al., 2024, Xu et al., 7 Apr 2026). Explanation-oriented work evaluates whether the model mentions 8, 9, 0, and 1, and also uses pairwise comparison with win/tie/loss against human explanations; in the LLM pun-understanding benchmark, three annotators achieved Fleiss’ 2 on the punchline check, and GPT-4 judging showed strong correlation with human judgments (Xu et al., 2024).
Generation-oriented work combines legacy humor metrics with originality and controllability diagnostics. The survey consolidates ambiguity, distinctiveness, surprisal, unusualness, Dist-1, Dist-2, perplexity, and structure success as standard automatic measures, while human studies commonly score success, funniness, fluency, informativeness, coherence, and readability (Su et al., 7 Jul 2025). The LLM study adds the Overlap metric,
3
defines originality as 4, and calls generation that is both successful and original “Strict Success” (Xu et al., 2024).
Recent benchmark design also makes structured rationales part of the task. One robustness paper requires outputs of the form yes <w_p> <w_a> <s_p> <s_a> or no <> <> <> <>, then measures Pun Pair Agreement (PPA): 2 if both 5 and 6 are correct, 1 if one is correct, and 0 if neither is correct (Zangari et al., 15 Sep 2025). This instruction format aligns benchmark outputs with the latent objects that pun processing models are supposed to recover, and it reduces the possibility that a model can obtain a good label while identifying the wrong evidence. Multimodal evaluation uses the same philosophy by combining binary detection with mention ratios for 7 and 8 and pairwise judging of explanations against the ground-truth explanation (Xu et al., 7 Apr 2026).
6. Failure modes, robustness, and research directions
A central result of recent work is that apparent pun competence can be shallow. The robustness study on LLMs argues for an “illusion of humor understanding”: models may score well on familiar benchmarks but fail when puns are minimally perturbed, when recurrent templates are isolated, or when explicit rationales are required (Zangari et al., 15 Sep 2025). On PunnyPattern, precision drops by about 16–23% and 9 by 4–13% relative to PunEval, while on PunBreak even strong models often still predict “pun” for altered non-puns; the manual evaluation identifies missing contextual support and forcing an unsuitable pun pair as the most common rationale failures (Zangari et al., 15 Sep 2025).
Instruction-following LLMs also exhibit generation-specific pathologies. The 2024 benchmark identifies a “lazy pun generation” pattern in which models use multiple occurrences of 0, and for heterographic puns even multiple 1 forms, making the sentence mechanically punny but low quality under the evaluation standard (Xu et al., 2024). In classical neural generation, Pun-GAN reports single-sense sentences, over-generic short sentences, and grammar errors as dominant failure modes (Luo et al., 2019). In unified generation, homographic performance is limited by the quality of substitute word pairs derived from WSD and reverse-dictionary steps (Tian et al., 2022). In text understanding, DANN notes that some words have too many senses, making it difficult to identify exactly one correct meaning, and that pun interpretation remains relatively weak compared with pun location (Liu et al., 2021).
The multimodal setting reveals analogous hallucination problems. MultiPun shows that many VLMs have high TPR but very low TNR, often over-predicting “pun,” and that prompt wording can substantially change outputs; explanation prompts improve non-pun rejection but can reduce recall (Xu et al., 7 Apr 2026). The paper proposes Pun-CoT, a three-stage prompt requiring visual grounding, lexical anchoring, and cross-modal verification, and Pun-Tuning, which fine-tunes VLMs on MultiPun-style data with both pun and non-pun samples and both biased-to-pun and biased-to-non-pun prompts; together these strategies yield an average 2 improvement in 3 (Xu et al., 7 Apr 2026).
The future directions proposed across the literature are convergent. The survey emphasizes multilingual pun generation, multimodal pun generation, richer prompting strategies, more robust evaluation, and stronger mechanisms for diverse, non-repetitive, context-sensitive generation (Su et al., 7 Jul 2025). Context-situated generation suggests extension to metaphor generation and lyric generation (Sun et al., 2022). Robustness-oriented work argues that future instruction data should include hard negatives, perturbations targeting phonetic similarity, orthographic similarity, contextual support, and sense separation, as well as structured outputs that identify the minimal pun pair and both senses (Zangari et al., 15 Sep 2025). Taken together, these findings suggest that Pun-Instruct is best understood not as a single task, but as a family of tightly coupled instruction regimes for structured ambiguity, contextual reasoning, and controlled humorous generation.