HumorGen: Cognitive Synergy for Humor Generation in Large Language Models via Persona-Based Distillation
Organizations: Carnegie Mellon University Africa
Abstract
Humor generation poses a significant challenge for Large Language Models (LLMs), because their standard training objective (next-token prediction) inherently conflicts with the surprise and incongruity required for comedy. To bridge this gap, we introduce the Cognitive Synergy Framework, a methodology for generating highquality humor data inspired by psychological theories of humor. Utilizing a Mixtureof-Thought (MoT) approach, we deploy six cognitive personas (e.g., The Absurdist, The Cynic) to synthesize diverse comedic perspectives for a given prompt. This framework produces a theory-grounded dataset, which we use to fine-tune a 7B-parameter student model. We further evaluate two alignment strategies, Direct Preference Optimization (DPO) and an offline group-relative variant O-GRPO, finding that neither improves over SFT. However, our 7B HumorGen model variants significantly outperform larger instruction-tuned baselines and achieve top-tier open-weight performance while remaining competitive with frontier proprietary systems. These results suggest that cognitively driven data curation is more critical than alignment algorithms or model scale for humor generation.
Figures & tables
| Persona | Humor Theory | Mechanism | Cognitive Focus |
|---|---|---|---|
| Neurotic | Relief Theory | Tension Release | Internal anxiety, overthinking, and social insecurity. |
| Cynic | Superiority Theory | Social Critique | Hypocrisy, biting sarcasm, and moral contradictions. |
| Observer | Incongruity | Social Mapping | Mundane minutiae and unwritten awkward social norms. |
| Wordsmith | Linguistic | Ambiguity | Puns, double entendres, and phonological play. |
| Optimist | Benign Violation | Recontextualization | Wholesome misinterpretations of potentially negative traits. |
| Absurdist | Incongruity | Surrealism | Non-sequiturs, dream logic, and fractured causality. |
| Feature | % |
|---|---|
| Humor Mechanisms (winner) | |
| Incongruity | 85.2 |
| Absurdity | 84.9 |
| Surprise | 57.2 |
| Wordplay | 42.0 |
| Irony | 22.5 |
Appendix figures & tables32 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Rationale for Evaluation | Qualitative Observation |
|---|---|---|
| DeepSeek-67B | Top-tier open-source model available during initial development. | Generated jokes with poor comedic timing; subjectively less funny relative to Qwen-2.5-32B. |
| Qwen-2.5-32B | Selected as a robust baseline due to its strong performance-to-size ratio and high instruction-following capabilities, which proved highly effective for structurally complex joke generation. | Generated structurally sound and elaborate jokes, though often lacked concise punchiness. |
| Kimi-K2 | Explored specifically to introduce stylistic diversity alongside Qwen. | Generated consistently punchy, concise jokes with excellent comedic timing. |
| Feature | Qwen-2.5-32B | Kimi-K2 |
|---|---|---|
| Average Word Count | 54.7 words | 37.5 words |
| Structural Style | Elaborate setups, detailed narratives | Concise setups, rapid punchlines |
| Cognitive Tone | Analytical and descriptive | Punchy, sharp, and conversational |
| Dataset Partition | Qwen-2.5-32B Contribution | Kimi-K2 Contribution |
|---|---|---|
| SFT Training Corpus | 44.8% | 55.2% |
| DPO Chosen Pool | 40.9% | 59.1% |
| DPO Rejected Pool | 59.6% | 40.4% |
| O-GRPO Full Pool | 50.1% | 49.9% |
| Post-ranking statistic | Kimi-K2 | Qwen-2.5-32B |
|---|---|---|
| Mean Elo | 1003.9 | 996.2 |
| Mean finish rank ( ) | 11.5 | 13.4 |
| Rank-1 wins | 603 (54.8%) | 497 (45.2%) |
| Share of top-3 positions | 63.6% | 36.4% |
| Share of bottom-half positions (#11–24) | 46.2% | 53.8% |
| Judge model | Observation | Selected |
|---|---|---|
| Llama-3.3-70B-Instruct | Produced the most stable pairwise preferences and showed the strongest correspondence with human judgments in our blind calibration study. | Yes (primary) |
| Qwen-2.5-72B | Produced rankings broadly consistent with the primary judge, while providing an independent model-family perspective for cross-judge validation. | Yes (secondary) |
| Qwen3-32B | Produced less consistent ordering than the larger Qwen-2.5-72B judge in our preliminary comparisons. | No |
| GPT-OSS-120B | Produced more variable preferences and was less consistent with the primary and secondary judges. | No |
| Gemini-2.5-Pro | Provided generally coherent judgments, but its ordering was less consistent with the selected judges; its closed access also limited reproducibility. | No |
| Rank | Model | BT Rating | 95% CI | Wins / Losses |
|---|---|---|---|---|
| 1 | GPT-5 | 1336.18 | [1323.3, 1348.3] | 4738 / 862 |
| 2 | Kimi-K2 | 1259.98 | [1249.7, 1268.5] | 4362 / 1237 |
| 3 | HumorGen SFT-7B | 1128.14 | [1118.3, 1138.1] | 3565 / 2035 |
| 4 | HumorGen DPO-7B | 1123.72 | [1115.7, 1134.9] | 3536 / 2064 |
| 5 | HumorGen DPO-Think-7B | 1116.65 | [1107.9, 1127.1] | 3489 / 2110 |
| 6 | HumorGen SFT-Think-7B | 1085.31 | [1075.8, 1096.5] | 3281 / 2319 |
| Rank | Model | BT Rating | 95% CI | Wins / Losses |
|---|---|---|---|---|
| 1 | GPT-5 | 1268.25 | [1256.5, 1281.1] | 4418 / 1181 |
| 2 | Kimi-K2 | 1228.24 | [1217.3, 1239.4] | 4192 / 1408 |
| 3 | HumorGen DPO-Think-7B | 1147.52 | [1136.8, 1158.8] | 3686 / 1914 |
| 4 | HumorGen DPO-7B | 1138.05 | [1130.3, 1147.2] | 3623 / 1976 |
| 5 | HumorGen SFT-7B | 1132.41 | [1121.0, 1141.2] | 3586 / 2014 |
| 6 | HumorGen SFT-Think-7B | 1105.57 | [1094.0, 1115.2] | 3406 / 2194 |
| Rank | Model | BT Rating | 95% CI | Wins / Losses |
|---|---|---|---|---|
| 1 | GPT-5 | 1378.73 | [1346.1, 1421.5] | 605 / 94 |
| 2 | Kimi-K2 | 1279.63 | [1245.0, 1322.1] | 549 / 151 |
| 3 | Gemini-2.5-Pro | 1247.80 | [1212.4, 1279.7] | 528 / 172 |
| 4 | HumorGen SFT-7B | 1140.37 | [1107.9, 1173.2] | 449 / 251 |
| 5 | HumorGen DPO-7B | 1135.25 | [1101.9, 1160.2] | 445 / 255 |
| 6 | HumorGen GRPO-7B | 1089.84 | [1060.7, 1114.1] | 409 / 291 |
| Rank | Model | BT Rating | 95% CI |
|---|---|---|---|
| 1 | GPT-5 | 1285.15 | [1258.2, 1320.8] |
| 2 | Kimi-K2 | 1210.51 | [1188.5, 1233.9] |
| 3 | HumorGen DPO-7B | 1202.76 | [1175.5, 1227.0] |
| 4 | HumorGen SFT-7B | 1193.81 | [1162.0, 1228.2] |
| 5 | Gemini-2.5-Pro | 1144.23 | [1114.3, 1171.8] |
| 6 | HumorGen DPO-Think-7B | 1132.13 | [1103.0, 1170.3] |
| Dom. | Name | Status | Description and Example |
|---|---|---|---|
| A | Neutral Facts | OOD | Surprising declarative facts. “Bananas are technically berries.” |
| B | Everyday Life | OOD | First-person observational statements. “My printer hates me.” |
| C | Abstract Concepts | OOD | Bare noun-phrase prompts. “Bureaucratic nostalgia.” |
| D | Dialogic Quotations | OOD | Attributed utterances. “The fridge said: I’m judging you.” |
| E | Scenario Inputs | OOD | Situational irony setups. “A vampire is working in HR.” |
| F | Analogical Prompts | OOD | Cross-domain relational mappings. “Life is a subscription service you never read the terms for.” |
| Field | Value |
|---|---|
| Dataset name/version | Humor Transfer Bench (HTB), v1 |
| Primary objective | Measure humor transfer under prompt-domain shift while holding the generation task fixed |
| Task/instruction | Text-to-text humor generation ( Generate a funny joke given this prompt ) |
| File format/encoding | TSV, UTF-8, Unix line endings |
| Schema (columns) | id , domain , prompt |
| Identifier format | HTB_{DOMAIN}_{NNN} (e.g., HTB_A_001 ) |
| Persona | Pairwise win rate | Mean rank (of 24) | Top-3 rate |
|---|---|---|---|
| Neurotic | 63.4% | 9.3 | 26.6% |
| Absurdist | 55.8% | 11.3 | 17.6% |
| Cynic | 55.2% | 11.4 | 15.9% |
| Observer | 49.1% | 12.5 | 6.2% |
| Optimist | 41.1% | 14.4 | 5.7% |
| Wordsmith | 34.9% | 16.1 | 3.1% |
| Persona | O-GRPO pool | SFT (top-10) | DPO chosen | DPO rejected |
|---|---|---|---|---|
| N=28,789 | N=12,000 | N=6,000 | N=6,000 | |
| Neurotic | 4,800 (16.7%) | 2,899 (24.2%) | 1,650 (27.5%) | 328 (5.5%) |
| Absurdist | 4,796 (16.7%) | 2,364 (19.7%) | 1,316 (21.9%) | 783 (13.1%) |
| Cynic | 4,796 (16.7%) | 2,269 (18.9%) | 1,257 (20.9%) | 679 (11.3%) |
| Observer | 4,798 (16.7%) | 2,015 (16.8%) | 934 (15.6%) | 1,007 (16.8%) |
| Optimist | 4,799 (16.7%) | 1,375 (11.5%) | 542 (9.0%) | 1,334 (22.2%) |
| Theory | Persona | Summary |
|---|---|---|
| Relief Theory | Neurotic | Humor functions as a release mechanism for suppressed tension, anxiety, or socially restricted thoughts. Jokes provide a culturally sanctioned outlet for uncomfortable truths, transforming nervous energy into laughter through cathartic release. |
| Superiority Theory | Cynic | Dating back to Plato and developed by Hobbes (1650), humor arises from feelings of superiority over others’ failures, social hypocrisy, or misfortune. Laughter emerges through recognizing incompetence or pretension, reinforcing the observer’s relative standing via critique or sarcasm. |
| Incongruity Theory | Observer, Absurdist | Kant (1790) and Schopenhauer (1819): humor arises from violated expectations through unexpected juxtapositions or logical impossibilities. The Observer persona reflects everyday social mismatches; the Absurdist extends this to surreal and illogical extremes. |
| Linguistic Theories | Wordsmith | Raskin’s (1985) Semantic Script Theory of Humor and Attardo’s extensions: humor arises from language itself via ambiguity, phonological similarity, double meanings, and wordplay. Humor emerges from the gap between literal meaning and intended interpretation. |
| Benign Violation Theory | Optimist | McGraw and Warren (2010): humor occurs when a norm violation is simultaneously perceived as benign. The Optimist persona operationalizes this through positive reinterpretation of otherwise negative or threatening situations. |
| Normalization Method | Mean | Median | Std Dev | Fraction |
|---|---|---|---|---|
| Standard Z-Score | 0.000 | -0.479 | 1.000 | 50.5% |
| Winsorized Z-Score ( ) | - | -0.479 | - | 50.5% |
| Rank-Normalized (RankNorm) | 0.000 | 0.000 | 0.602 | 49.9% |
| Rank | Model | BT Rating | 95% CI |
|---|---|---|---|
| 1 | GPT-5 | 1379.04 | [1348.3, 1418.4] |
| 2 | Kimi-K2 | 1285.59 | [1259.8, 1327.1] |
| 3 | Gemini-2.5-Pro | 1254.02 | [1221.8, 1279.5] |
| 4 | HumorGen SFT-7B | 1145.16 | [1120.4, 1177.0] |
| 5 | HumorGen DPO-7B | 1137.32 | [1110.1, 1165.1] |
| 6 | HumorGen GRPO-7B | 1093.50 | [1061.2, 1121.6] |
| Parameter | SFT / SFT-Think | DPO / DPO-Think | GRPO / GRPO-Think |
|---|---|---|---|
| Learning Rate | (Linear) | (Constant) | (Constant) |
| Batch Size (Global) | 16 | 16 | 16 |
| Epochs (Configured) | 3 | 5 | 5 |
| Max Sequence Length | 1024 | 1024 (512 prompt) | 1024 |
| Optimizer | AdamW (8-bit) | AdamW (8-bit) | AdamW |
| LoRA Rank ( ) | 16 | 16 | 16 |
| Model Variant | Steps | Final Epoch | Final Loss | Eval Loss (Min) | Runtime |
|---|---|---|---|---|---|
| HumorGen-SFT-7B | 900 | 1.26* | 1.258 | 1.342 | 7.2m |
| HumorGen-SFT-Think | 900 | 1.26* | 1.768 | 1.908 | 7.8m |
| HumorGen-DPO-7B | 1,550 | 4.34* | 0.512 | 0.742 | 18.5m |
| HumorGen-DPO-Think | 1,550 | 4.34* | 0.528 | 0.756 | 21.2m |
| HumorGen-GRPO-7B | 6,050 | 3.66* | 0.456 | 1.593 | 23.7m |
| HumorGen-GRPO-Think | 6,850 | 4.02* | 5.901 | 1.461 | 6.0h |
| Parameter | Value |
|---|---|
| Learning Rate | (Cosine) |
| Batch Size | 16 |
| Epochs | 2 |
| Warmup Ratio | 0.05 |
| Optimizer | AdamW (8-bit) |
| Data Volume ( ) | 998 jokes |
| Class | Sub-Category | N | Research Question |
| Think Tax | 1a. SFT vs. SFT-Think | 5 | Do humans penalize CoT over-reasoning in SFT? |
| 1b. DPO vs. DPO-Think | 5 | Do humans penalize CoT over-reasoning in DPO? | |
| 1c. GRPO vs. GRPO-Think | 5 | Do humans penalize CoT over-reasoning in GRPO? | |
| SFT-7B | 2a. SFT-7B vs. GPT-4o | 5 | Can a 7B model hold its own against 1.5T weights? |
| 2b. SFT-7B vs. Gemini | 5 | Can a 7B model challenge a 1T+ frontier API? | |
| 2c. SFT-7B vs. Kimi | 5 | Can the student beat the teacher that generated its data? |