CoolFace
Modelpublic

AdamLeung/qwen3-0.6b-suicide-risk-lora

sourceHugging Faceupdated 1mo agoView on Hugging Face
0likes14downloads
Model Card

Qwen3-0.6B · Suicide/Self-harm Risk LoRA

Model Details

Model Description

A LoRA adapter that fine-tunes Qwen3-0.6B to classify the suicide / self-harm risk expressed by the author of a short social-media post into a 5-level ordinal scale (0–4). Internal research artifact for a guardrails study — not a diagnostic or clinical tool.

Given a post, the model outputs a single digit 0–4 following this rubric (the exact prompt used for training and evaluation):

LevelMeaning
0No risk
1Negative emotion / distress, but no suicidal or self-harm ideation
2Passive death ideation (wish to be dead, no intent/act)
3Active suicidal / self-harm ideation (no method/plan/attempt)
4Has method, plan, attempt, or imminent risk

The risk is judged for the author themselves — posts that are about someone else (a friend, a partner, a child) are scored by the author's own distress.

  • —Model type: Qwen3-0.6B + LoRA adapter, used as an ordinal 5-class classifier
  • —Language(s): English
  • —Finetuned from: Qwen/Qwen3-0.6B
  • —LoRA config: r=16, alpha=32, dropout=0.05, bias=none, targets q/k/v/o_proj, gate/up/down_proj
  • —Framework: PEFT 0.18.1

How to Get Started with the Model

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

BASE = "Qwen/Qwen3-0.6B"
ADAPTER = "src/core/sagemaker/results/qwen3-suicide-risk-v1"

SYSTEM_PROMPT = (
    "You are a clinical risk assessment assistant. "
    "Read the social-media post and classify its suicide/self-harm risk level "
    "using this rubric:\n"
    "0 = no risk\n"
    "1 = negative emotion / distress, but no suicidal or self-harm ideation\n"
    "2 = passive death ideation\n"
    "3 = active suicidal / self-harm ideation\n"
    "4 = has method, plan, attempt, or imminent risk\n"
    "Answer with ONLY the single digit (0, 1, 2, 3, or 4)."
)

tok = AutoTokenizer.from_pretrained(ADAPTER, trust_remote_code=True)
base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.float32, device_map="auto")
model = PeftModel.from_pretrained(base, ADAPTER).eval()

def predict(text):
    prompt = tok.apply_chat_template(
        [{"role": "system", "content": SYSTEM_PROMPT},
         {"role": "user", "content": f"Post:\n{text}\n\nRisk level:"}],
        tokenize=False, add_generation_prompt=True, enable_thinking=False,
    )
    enc = tok(prompt, return_tensors="pt").to(model.device)
    out = model.generate(**enc, max_new_tokens=4, do_sample=False)
    return tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True).strip()

print(predict("i just want to sleep and never wake up"))

Evaluation

Results

Evaluated on a held-out test set of 875 posts (never seen in training):

PrecisionPeak VRAMavg latencyAccuracyMacro-F1Invalid
float32 (CPU)—704 ms0.80000.73930

Per-class precision / recall:

Class01234
Precision0.8780.6600.6560.7270.808
Recall0.9330.5350.7720.7270.726