Published in · HAHA@IberLEF 2026, León, Spain
Prompting and Fine-Tuning Approaches for Detection and Generation of Spanish Humor
Written by Osamah H. Alaini
We entered all three HAHA@IberLEF 2026 subtasks on Spanish humor. Fine-tuned Spanish encoders placed 2nd at detecting LLM-generated jokes.

Abstract
We describe our participation in all three subtasks of HAHA@IberLEF 2026, a shared task on humor detection and generation in Spanish. For the two classification subtasks — Humor Detection and LLM-Generated Humor Detection, we experiment with two complementary paradigms: ensemble prompting of locally served open-weight LLMs (Llama 3.2, Mistral 7B, Gemma 3) and fine-tuning of an ensemble of Spanish and multilingual pre-trained language models (RoBERTuito, BETO, XLM-RoBERTa). For Humor Generation we apply a best-of-𝑛 prompting strategy with LLM-based reranking. Our few-shot prompting ensemble ranks 5th on Subtask 1 (F1 =0.8567), and our Pre-trained Language Models PLMs ensemble ranks 2nd on Subtask 2 (F1 =0.8729) — only 0.0035 points behind the top system. On Subtask 3, our generation ensemble ranks 3rd (Elo =919), above the official baseline. Results show that the PLMs ensemble generalizes more consistently across both classification subtasks, while few-shot prompting is particularly effective at satirical headline detection but less reliable at detecting LLM-generated humor.
HAHA@IberLEF 2026, León, Spain
Our paper, "Prompting and Fine-Tuning Approaches for Detection and Generation of Spanish Humor," will be presented at HAHA@IberLEF 2026 in León, Spain, co-located with the 42nd conference of the Spanish Society for Natural Language Processing. The work is co-authored with Nasser Thmer of the University of Abyan and Ali Al-Laith of the University of Copenhagen. All three of us contributed equally.
This is a departure from the CI adoption research that occupies most of this blog. It is a shared task in computational humor — and the thing I did not expect going in was how sharply it would expose the difference between a model that has learned a task and a model that has merely been told about one.
Why humor is hard for machines
Humor runs on incongruity, irony, wordplay, and shared cultural knowledge. None of those are things a language model reads off the surface of a sentence. A satirical headline is deliberately written to look like a real one; that is the entire craft of it. So the signal that separates the two is not vocabulary or syntax but a judgment about whether the world being described is plausible.
HAHA 2026 poses three subtasks over Spanish text:
- Humor Detection — classify a news headline as satirical or real.
- LLM-Generated Humor Detection — decide whether a joke was written by a person or generated by a model.
- Humor Generation — produce a joke from a news headline, scored by human preference.
We entered all three.
Two paradigms, both built as ensembles
We deliberately ran two different approaches against each other rather than tuning a single one.
Prompting. Three open-weight models served locally through Ollama — Llama 3.2 (3B), Mistral 7B, and Gemma 3 (4B). Temperature fixed at 0.0 for classification, 0.7 for generation. For each classification subtask we wrote three prompt variants: a zero-shot prompt asking for a one-word label, a few-shot prompt carrying two labeled examples with satirical framing cues, and a chain-of-thought prompt that walks the model through plausibility and irony checks before emitting structured JSON. Inputs are prefixed with a country token ([ES], [MX], [AR]).
Predictions are combined by majority vote, ties broken toward the positive class. Extending the vote across all three models gives a Prompt×Model ensemble of nine voters per instance.
Fine-tuning. An ensemble of three Spanish and multilingual encoders — RoBERTuito, BETO, and XLM-RoBERTa — trained with a masked-language-modeling objective, as distinct from the decoder-only models used for prompting.
Generation used a best-of-n prompting strategy with LLM-based reranking.
What the leaderboard said
Subtask 1 — satirical headline detection. Our few-shot prompting ensemble placed 5th with an F1 of 0.8567. The fine-tuned ensemble came 7th of 13 at 0.8414, and zero-shot prompting 9th at 0.8237.
Subtask 2 — detecting LLM-generated humor. The fine-tuned ensemble placed 2nd out of 16 with an F1 of 0.8729 — 0.0035 behind the winning system. Few-shot prompting collapsed to 13th at 0.6535. Zero-shot came last, at 0.5095, below the official baseline.
Subtask 3 — humor generation. Our ensemble placed 3rd with an Elo of 919 against a baseline of 835. The confidence intervals do not overlap, so best-of-n reranking is a real improvement — though a wide gap remains to the top two systems at 1136 and 1110.
The result that actually taught us something
The interesting number is not the 2nd place. It is the distance between few-shot prompting's 5th place on Subtask 1 and its 13th place on Subtask 2.
Look at where it broke. On Subtask 2, few-shot prompting reached a recall of 0.9636 at a precision of 0.4944. It was calling almost everything machine-generated. The in-context examples we had written to teach it what satire looks like gave it a bias toward the positive class, and when the task changed from "is this satirical?" to "did a model write this?", that bias came along unchanged and stopped being useful.
The fine-tuned ensemble did not do this. It ranked 7th and 2nd on the two subtasks — never the best, but never falling apart either. Whatever it learned during fine-tuning transferred across both problems.
There is a practical reading here for anyone choosing between the two. Prompting is fast, cheap to iterate on, and can be excellent on the exact task you tuned your examples for. But the examples are the specification, and they carry assumptions you did not write down. Fine-tuning is slower and less flexible, and it was the only approach that stayed reliable when the ground moved.
Zero-shot prompting was our weakest approach on both classification subtasks, which is its own small lesson: for instruction-tuned models on a genuinely subjective task, the in-context calibration examples were doing most of the work.
Where this goes next
Future work is hybrid: combining prompting with fine-tuning rather than treating them as alternatives, and looking at whether humor-theoretic knowledge — incongruity theory in particular — can be built into the classification and generation pipelines rather than left for the model to infer.
Acknowledgment
Thanks to my co-authors Nasser Thmer and Ali Al-Laith, and to the HAHA@IberLEF 2026 organizers for the datasets and evaluation infrastructure that made the comparison possible.
Topics
The paper
Prompting and Fine-Tuning Approaches for Detection and Generation of Spanish Humor
HAHA@IberLEF 2026, León, Spain
PDF805 KB