Downloads · 30 days
41
5% of all-time downloads
SeeYangZhi/Llama-3.2-1B-Sarcasm-Rewriter
Llama-3.2-1B-Sarcasm-Rewriter is a text generation model from SeeYangZhi. Use it when you need the model to write or continue text. The card lists the license as llama3.2.
A fine-tuned Llama-3.2-1B-Instruct that rewrites sarcastic news headlines as neutral, factual equivalents while preserving the underlying meaning.
Downloads · 30 days
41
5% of all-time downloads
All-time downloads
846
Public
Parameters
1.2B
5 GB on disk
Likes
0
Public
Click a slice to open those files.
.gguf2.5 GB · 50%
From the Hugging Face model README
A fine-tuned Llama-3.2-1B-Instruct that rewrites sarcastic news headlines as neutral, factual equivalents while preserving the underlying meaning.
Built by CS4248 Team 14 (NUS, AY2025/26 Semester 2) as part of a sarcasm style transfer research project.
Input: A sarcastic news headline (e.g. "Area Man Passionate Defender Of What He Imagines Constitution To Be") Output: A non-sarcastic rewrite (e.g. "A man strongly defends his interpretation of the Constitution")
meta-llama/Llama-3.2-1B-Instructq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projsar_to_non_context_enhanced.merge_and_unload().from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "SeeYangZhi/Llama-3.2-1B-Sarcasm-Rewriter"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
messages = [
{
"role": "system",
"content": (
"You are a writing assistant. Rewrite sarcastic news headlines as neutral, "
"factual equivalents that preserve the core meaning without irony or mockery. "
"Respond with only the rewritten headline, no explanation."
),
},
{
"role": "user",
"content": "Rewrite this sarcastic headline as a neutral, non-sarcastic news headline:\n\narea man passionate defender of what he imagines constitution to be",
},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Evaluated on a 2,857-sample held-out test split against 13 other models (BART variants, T5 baselines, ablation studies). Metrics:
| Metric | Description | Direction |
|---|---|---|
| Hard Flip Rate | % of samples where sarcasm was removed (classifier-detected) | higher ↑ |
| Flip Delta | Mean change in irony score | higher ↑ |
| Semantic Similarity | all-MiniLM-L6-v2 cosine between input and output | higher ↑ |
| BLEU vs input | Lower = more genuine rewriting | lower ↓ |
| Perplexity (GPT-2) | Fluency | lower ↓ |
| Edit Distance (norm) | Proportion of words changed | higher ↑ |
| Paraphrase Score | Paraphrase detection (low = real rewriting) | lower ↓ |
Full per-metric numbers are published alongside the project webapp.
This model is released under the Llama 3.2 Community License. The model name starts with "Llama-" as required by Meta's terms. Built with Llama.
If you use this model, please cite the underlying Llama 3.2 release and the NHDSD dataset. Project writeup available upon request.