Downloads · 30 days
12
18% of all-time downloads
amiya/qwen2.5-3b-style-detox
qwen2.5-3b-style-detox is a text generation model from amiya. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
LoRA fine-tune of Qwen/Qwen2.5-3B-Instruct for English text detoxification — rewriting toxic / profane text in neutral language while preserving meaning. Trained on ParaDetox (18,993 SFT pairs). LoRA weights are fused…
Downloads · 30 days
12
18% of all-time downloads
All-time downloads
67
Public
Parameters
3.1B
6.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6.2 GB · 100%
From the Hugging Face model README
LoRA fine-tune of Qwen/Qwen2.5-3B-Instruct for English text detoxification — rewriting toxic / profane text in neutral language while preserving meaning. Trained on ParaDetox (18,993 SFT pairs). LoRA weights are fused into the base, so this repo is a drop-in replacement for the base model.
Validation loss on a 379-sample held-out ParaDetox split:
| Iter | Val loss |
|---|---|
| 1 (baseline) | 5.842 |
| 200 | 0.762 |
| 400 | 0.770 |
| 1200 | 0.741 (best, promoted) |
| 1600 | 0.770 |
| 2000 | 0.940 (overfit) |
Trained 3,000 iters on an Apple M2 Max in ~13 minutes; the iter-1200 snapshot was promoted to adapters.safetensors because that's where val loss bottomed out.
from mlx_lm import generate, load
model, tokenizer = load("amiya/qwen2.5-3b-style-detox")
prompt = tokenizer.apply_chat_template(
[
{
"role": "system",
"content": "Rewrite the user's text in a neutral, non-toxic way while preserving meaning.",
},
{"role": "user", "content": "that is dumb"},
],
tokenize=False,
add_generation_prompt=True,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=40))
# -> "That is not smart"
PyTorch users: transformers.AutoModelForCausalLM.from_pretrained("amiya/qwen2.5-3b-style-detox") works the same way.
Rewrite the user's text in a neutral, non-toxic way while preserving meaning.
Use that exact prompt for in-distribution behavior. Chat template is Qwen's ChatML.
| Input | Output |
|---|---|
that is dumb | That is not smart |
you suck at this | You are not good at this. |
he is a fucking idiot | He is not a smart person. |
this code is shit | This code is bad. |
shut the hell up | Shhh |
Qwen/Qwen2.5-3B-Instruct (3.09 B params)s-nlp/paradetox (18,993 toxic → neutral pairs), converted to ChatML SFT.@misc{qwen25_3b_style_detox,
title = {qwen2.5-3b-style-detox: LoRA-tuned Qwen2.5-3B for English detoxification},
author = {amiya},
year = {2026},
url = {https://huggingface.co/amiya/qwen2.5-3b-style-detox}
}
Underlying corpus: Logacheva, Dementieva et al. ParaDetox: Detoxification with Parallel Data, ACL 2022.