Downloads · 30 days
29
21% of all-time downloads
dokster/gemma-3-4b-scambreaker-adapter
gemma-3-4b-scambreaker-adapter is a text generation model from dokster. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as gemma.
Fine-tuned Gemma-3-4b-it on a bilingual (English/Russian) scam-risk analysis instruction dataset for local-first scam defense for non-technical people, built for the AutoScientist Challenge — Personal-Finance category.
Downloads · 30 days
29
21% of all-time downloads
All-time downloads
140
Public
Repo size
154 MB
Likes
0
Public
Click a slice to open those files.
.safetensors119 MB · 77%
From the Hugging Face model README
Fine-tuned Gemma-3-4b-it on a bilingual (English/Russian) scam-risk analysis instruction dataset for local-first scam defense for non-technical people, built for the AutoScientist Challenge — Personal-Finance category.
Scams are a direct, first-party financial-loss problem: wire fraud, gift-card and crypto payments, and stolen banking credentials move money out of a victim's account in minutes, and are rarely recoverable afterward. The highest-risk targets — older adults, non-native speakers, and anyone unfamiliar with a scam's exact playbook — are also the least equipped to catch the manipulation in the moment. This model reads one suspicious message and, before any money or credentials move, tells the person in plain language whether it's dangerous, what the attacker is trying to extract, and the single safest next step. That is a personal-finance protection tool in the most literal sense: it exists to stop money from leaving a real person's account into a scammer's.
Click to image below or press here - Demo Video. Try the Model Demo to see the model analyze potential scam messages and explain how to avoid them.
Scambreaker-Gemma-3-4B is a LoRA fine-tuned version of Gemma-3-4b-it, adapted to analyze a single suspicious message (SMS, email, DM) and return a validated JSON safety card: a risk level, the scam type, the manipulation tactics used, a compact "scam DNA" breakdown, the single safest next action, a message to forward to a trusted person, and a short plain-language summary.
The base Gemma-3-4B model was chosen for its multilinguality and suitability for a small fine-tuning dataset. No additional data was used during fine-tuning; the goal was solely to teach the model the JSON output format and the scam-analysis task itself, not to expand its knowledge.

Given one suspicious message (English or Russian), it returns JSON scam-analysis:
risk_level: dangerous / suspicious / needs_check / safescam_type: fixed-vocabulary label, e.g. credential_theft, job_scam, tech_supporttactics: up to 3 short manipulation-tactic stringsscam_dna: impersonates / pressure / ask / risk — short descriptive phrases, in the message's languagesafest_action, trusted_person_message, summary: plain-language guidance, in the message's languageIntended as decision support for a non-technical person deciding whether to click, reply, or call — not an autonomous blocker.
Always present output as guidance to slow down and verify through an official channel — never as a definitive verdict, and never surface an action that tells the user to click the suspicious link or call the number in the message itself.
from transformers import AutoModelForImageTextToText, AutoTokenizer
from peft import PeftModel
import torch
base_model = AutoModelForImageTextToText.from_pretrained(
"google/gemma-3-4b-it",
dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "dokster/gemma-3-4b-scambreaker-adapter")
tokenizer = AutoTokenizer.from_pretrained("google/gemma-3-4b-it")
SYSTEM_PROMPT = "..." # full JSON schema + safety-rules prompt (see repo)
message = "USPS: Your package is held. Verify account details now: https://... Ref 1000."
prompt = tokenizer.apply_chat_template(
[{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": f"/no_think\n\nAnalyze this message for scam risk:\n\n{message}\n\nReturn only the JSON object."}],
tokenize=False, add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Note: google/gemma-3-4b-it is a gated model. Request access before loading
2,324 examples (1,200 English + 1,124 Russian), derived from the synthetic scam-message generator.
English examples are the deterministic generator output.
Russian examples were produced by translating only the natural-language fields (never the fixed risk_level/scam_type/tactics labels) with an LLM under strict brand-name and format-preservation rules,
then mapped back across the full row set. See dokster/adaption-scam-dataset-ru-en-v1 for full dataset documentation.
all-linearThis model achieves 94% winrate over base model. To approve this number I created special evaluation dataset. Evaluated on a "hard" synthetic eval suite — 632 English cases spanning boundary/calibration scenarios (credential theft, family impersonation, tech support, job scams, marketplace fraud, "wrong number" investment scams, and matched safe/benign controls), plus a 316 EN + 316 RU bilingual subset for a per-language read. This is a held-out synthetic suite, not real-world traffic — see Bias, Risks, and Limitations.
Full English hard suite (632 cases):
| Metric | Value |
|---|---|
| risk_level accuracy | 95.3% (602/632) |
| scam_type accuracy | 94.5% |
| mean tactic recall | 93.1% |
| dangerous → safe | 0 |
| dangerous → needs_check | 0 |
| safe → over-flagged | 0 |
| Invalid JSON / model errors | 0 / 0 |
Bilingual EN/RU (316 + 316 cases):
| Metric | EN (316) | RU (316) |
|---|---|---|
| risk_level accuracy | 96.5% (305/316) | 83.5% (264/316) |
| dangerous → safe | 0 | 2 |
| dangerous → needs_check | 0 | 1 |
| safe → over-flagged | 0 | 2 |
Zero safety-critical misses on the full, reliable English suite — no
dangerous case was ever mislabeled safe or needs_check, and no benign
message was ever over-flagged.
To isolate what fine-tuning actually contributes, the base google/gemma-3-4b-it
model (zero-shot, no LoRA adapter, same system prompt/schema) was evaluated on
the identical full English hard suite (632 cases):
| Metric | Base gemma-3-4b-it (no adapter) | Fine-tuned (this card) |
|---|---|---|
| risk_level accuracy | 65.2% (412/632) | 95.3% (602/632) |
| scam_type accuracy | 2.8% | 94.5% |
| mean tactic recall | 23.1% | 93.1% |
| dangerous → safe | 0 | 0 |
| dangerous → needs_check | 0 | 0 |
| safe → over-flagged | 13 | 0 |
| Invalid JSON / model errors | 0 / 0 | 0 / 0 |
The base model already produces valid JSON and never misses a dangerous case
outright — the system prompt alone gets it that far. What fine-tuning adds is
accuracy and calibration: +30 points on risk classification, a ~34x jump
in scam_type accuracy, and elimination of false alarms on benign messages
(13 → 0). This is the clearest evidence that the LoRA training taught the
model the task itself, not just the output format.
@misc{scam_detection_ru_en_2026,
title = {Scam-Risk Analysis: A Bilingual Structured-Output Dataset for Scam Defense},
author = {Sultanov Danial},
year = {2026},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/dokster/gemma-3-4b-scambreaker-adapter}},
note = {AutoScientist Challenge 2026 — Personal-Finance Category}
}
Danial Sultanov - Nazarbayev University, BSc Mathematics