HumorGen_GRPO_7B / README.md
Jayi2424's picture
Upload folder using huggingface_hub
5143000 verified
|
Raw
History Blame Contribute Delete
2.31 kB
---
language:
- en
license: apache-2.0
tags:
- text-generation
- humor
- computational-humor
- peft
- lora
- qwen
- cognitive-synergy-framework
- headline-humor
base_model: Qwen/Qwen2.5-7B-Instruct
pipeline_tag: text-generation
---
# HumorGen GRPO — 7B
Part of the [HumorGen Collection](https://huggingface.co/collections/Jayi2424/humorgen) · SaLT Lab, Carnegie Mellon University
---
Offline Group Relative Policy Optimization (O-GRPO) on the SFT checkpoint. Trains on the full group of six persona candidates per headline rather than a single binary pair.
**Paper(s):** [arXiv:2604.09629](https://arxiv.org/abs/2604.09629)
---
## Training
| Property | Value |
|:---|:---|
| Stage | Offline Group Relative Policy Optimization (O-GRPO) |
| Initialized from | HumorGen_SFT_7B |
| Backbone | Qwen2.5-7B-Instruct (QLoRA 4-bit) |
| Group size | 6 (one per CSF persona) |
| Reward | HumorRank Bradley-Terry scores |
## Usage
This is a PEFT LoRA adapter. Load the base model and apply the adapter:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct", torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, "Jayi2424/HumorGen_GRPO_7B")
headline = "AI writes entire novel; readers say it felt a little too human"
prompt = (
"<|im_start|>system\n"
"You are a comedy writer. Write one sharp, witty joke for the headline.\n<|im_end|>\n"
f"<|im_start|>user\n{headline}<|im_end|>\n"
"<|im_start|>assistant\n"
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=120, temperature=0.9, top_p=0.95)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
## Citation
```bibtex
@misc{ajayi2026humorgen,
title = {HumorGen: Cognitive Synergy for Humor Generation in Large Language
Models via Persona-Based Distillation},
author = {Ajayi, Edward and others},
year = {2026},
eprint = {2604.09629},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2604.09629}
}
```