Views
No views yet
"General Wordplay" query placeholder. The simplicity of this prompt produces more consistent supervision than the structured typed alternative.
Serve as complementary correctors to the primary Qwen judge.| Adapter folder | Base model | LoRA r | Training data | Ensemble weight | MAP (standalone) |
|---|---|---|---|---|---|
| adapter_model.safetensors | gemma-4-31b-it | 32 | Generic rationales, no aug | 0.30 | 0.5718 |
1from transformers import AutoTokenizer, AutoModelForImageTextToText, BitsAndBytesConfig
2from peft import PeftModel
3import torch
4
5base_model_id = "google/gemma-4-31b-it"
6adapter_id = "DS4AI-UPB/jokes-on-gemma4-31b"
7
8bnb_config = BitsAndBytesConfig(
9 load_in_4bit=True,
10 bnb_4bit_quant_type="nf4",
11 bnb_4bit_compute_dtype=torch.bfloat16,
12)
13
14tokenizer = AutoTokenizer.from_pretrained(base_model_id)
15model = PeftModel.from_pretrained(
16 AutoModelForImageTextToText.from_pretrained(
17 base_model_id,
18 quantization_config=bnb_config,
19 device_map="auto",
20 ),
21 adapter_id,
22)
23model.eval()
24
25SYSTEM = (
26 "You are a humor and wordplay detection judge. You evaluate whether a text is relevant to a "
27 "query AND contains humor, jokes, puns, wordplay, or any form of linguistic wit (double "
28 "meanings, homophones, malapropisms, ironic twists). Answer only YES or NO."
29)
30
31def score(query: str, text: str) -> float:
32 messages = [
33 {"role": "system", "content": SYSTEM},
34 {"role": "user", "content": f'Query: "{query}"\nText: "{text}"\nIs this a relevant joke? Answer YES or NO.'},
35 ]
36 tokenized = tokenizer.apply_chat_template(
37 messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
38 )
39 ids = tokenized["input_ids"].to(model.device)
40 with torch.no_grad():
41 logits = model(ids).logits[:, -1, :]
42 yes_id = tokenizer.convert_tokens_to_ids("YES")
43 no_id = tokenizer.convert_tokens_to_ids("NO")
44 return torch.softmax(torch.stack([logits[0, yes_id], logits[0, no_id]]), dim=0)[0].item()pip install -U transformers peft bitsandbytes accelerateRequirestransformers >= 5.5.0,peft >= 0.14,bitsandbytes >= 0.43. Requires a CUDA GPU with ~30GB VRAM for 4-bit quantization (e.g. A100 on Colab Pro).
gemma4:e4b via Ollama). Rationale generation scripts are available in the code repository.1@InProceedings{Mocanu2026IROH,
2 author = {Mocanu, Ana-Maria Luisa and Mocanu, Sebastian and Truică, Ciprian-Octavian and Apostol, Elena-Simona},
3 title = {IROH: Insightful Ranking Of Humor using Multi-Stage Hybrid Retrieval with Rationale-Distilled LLM Judges for JOKER 2026 Track Task 1 English},
4 booktitle = {Working Notes of CLEF 2026},
5 month = {September},
6 year = {2026}
7}| Resource | Link |
|---|---|
| Paper | WIP — will be updated when proceedings are published |
| arXiv | WIP |
| Code | GitHub — DS4AI-UPB/VANGUARD-CLEF2026-JOKER |
| Primary judge | jokes-on-qwen2.5-7b |