qwen3-4b-phishing-detection

This repository contains a phishing-focused model derived from Qwen3-4B. It is intended to support defensive workflows by labeling email content as PHISHING or LEGIT.

Depending on what you uploaded, this repo is either:

  • Adapter-only (LoRA/QLoRA): requires the base model + this adapter, or
  • Merged/fused model: can be loaded directly without separately applying an adapter.

Base model

  • Qwen/Qwen3-4B (use the exact base model you fine-tuned from)

Dataset

This model was fine-tuned using the following dataset:

Intended behavior

Given an email, the intended output is exactly one label:

  • PHISHING
  • LEGIT

Recommended prompt format:

You are a security assistant. Classify the following email as PHISHING or LEGIT.

EMAIL:
<paste email here>

Answer with exactly one word: PHISHING or LEGIT.

pip install -U torch transformers peft accelerate bitsandbytes safetensors

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

MODEL_ID = "rudycaz/qwen3-4b-phishing-detection"  # this repo

tok = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    device_map="auto",
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
)

email_text = """Subject: Verify your account
Body: Please click the link below to verify...
"""

prompt = (
    "You are a security assistant. Classify the following email as PHISHING or LEGIT.\n\n"
    f"EMAIL:\n{email_text}\n\n"
    "Answer with exactly one word: PHISHING or LEGIT."
)

inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=4)
print(tok.decode(out[0], skip_special_tokens=True))
Downloads last month
82
Safetensors
Model size
0.6B params
Tensor type
BF16
ยท
U32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for rudycaz/qwen3-4b-phishing-detection

Finetuned
Qwen/Qwen3-4B
Adapter
(969)
this model

Space using rudycaz/qwen3-4b-phishing-detection 1