CoolFace
Modelpublic

Jayi2424/HumorGen-7B

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
1likes61downloads
Model Card

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

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

Usage

python
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

python
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)

ModelBT RatingWin %
GPT-51323.784.7%
Kimi-K21221.675.3%
Gemini-2.5-Pro1190.372.0%
HumorGen-7B (this model)1083.959.5%
GPT-OSS-120B989.247.7%
Qwen-2.5-32B-Instruct964.344.5%
Base Qwen-7B607.110.8%

Model Info

Base modelQwen/Qwen2.5-7B-Instruct
MethodSFT + LoRA (r=16, ฮฑ=16)
FrameworkUnsloth + TRL
Training data12,000 examples from 1,200 MWAHAHA prompts

Citation

bibtex
@misc{ajayi2026humorgen,
  title         = {HumorGen: Cognitive Synergy for Humor Generation in Large Language Models via Persona-Based Distillation},
  author        = {Ajayi, Edward and Mitra, Prasenjit},
  year          = {2026},
  eprint        = {2604.09629},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CL},
  url           = {https://arxiv.org/pdf/2604.09629}
}