HumorGen-7B

A 7B humor generation model fine-tuned from Qwen/Qwen2.5-7B-Instruct using the Cognitive Synergy Framework โ€” six psychologically-grounded AI personas generate and rank joke candidates, and only the best make it into training data. The result is a compact model that outperforms Qwen-2.5-32B and GPT-OSS-120B on automated humor evaluation.

๐Ÿ“„ HumorGen: Cognitive Synergy for Humor Generation in Large Language Models via Persona-Based Distillation


Install

pip install "unsloth[colab-new]" bitsandbytes xformers trl peft transformers
pip install -U "bitsandbytes>=0.46.1"

Usage

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

model = PeftModel.from_pretrained(
    AutoModelForCausalLM.from_pretrained(
        "unsloth/qwen2.5-7b-instruct-unsloth-bnb-4bit", device_map="auto"
    ),
    "Jayi2424/HumorGen-7B",
)
tokenizer = AutoTokenizer.from_pretrained("unsloth/qwen2.5-7b-instruct-unsloth-bnb-4bit")

prompt = "Write a funny joke about: Monday meetings\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=150, temperature=0.8, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Chat format

SYSTEM = (
    "You are a joke generator. Given a headline or topic, generate a funny joke. "
    "Output ONLY the joke. No reasoning, no explanation."
)
messages = [
    {"role": "system", "content": SYSTEM},
    {"role": "user", "content": "Write a funny joke based on: Denzel Washington reveals he doesn't watch movies anymore"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

Benchmark (SemEval 2026 MWAHAHA, 43k pairwise comparisons)

Model BT Rating Win %
GPT-5 1323.7 84.7%
Kimi-K2 1221.6 75.3%
Gemini-2.5-Pro 1190.3 72.0%
HumorGen-7B (this model) 1083.9 59.5%
GPT-OSS-120B 989.2 47.7%
Qwen-2.5-32B-Instruct 964.3 44.5%
Base Qwen-7B 607.1 10.8%

Model Info

Base model Qwen/Qwen2.5-7B-Instruct
Method SFT + LoRA (r=16, ฮฑ=16)
Framework Unsloth + TRL
Training data 12,000 examples from 1,200 MWAHAHA prompts

Citation

@misc{ajayi2025humorgen,
  title        = {HumorGen: Cognitive Synergy for Humor Generation in Large Language Models via Persona-Based Distillation},
  author       = {Ajayi, Edward and Mitra, Prasenjit},
  year         = {2025},
  howpublished = {\url{https://edwardajayi.github.io/assets/papers/HumorGen_CSF.pdf}},
  note         = {Preprint}
}
Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Jayi2424/HumorGen-7B

Base model

Qwen/Qwen2.5-7B
Adapter
(2127)
this model