giannor

Qwen3.5-27B-psysafe

Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: apache-2.0

Model Details

Table
PropertyValue
Base modelQwen/Qwen3.5-27B
Fine-tuning baseunsloth/Qwen3.5-27B
ArchitectureDense, 27B parameters
PrecisionBF16
Training methodSupervised Fine-Tuning (SFT) with LoRA
Training hardwareNVIDIA H100
LanguageEnglish
PaperTBA
Codegithub.com/aisilab/psychological-safety
W&B runVisualize in Weights & Biases

Intended Use

This model is designed for deployments where psychologically safe refusals are critical, such as:

  • Mental health support platforms
  • Crisis-intervention or safeguarding tools
  • Safety-layer components in consumer-facing LLM applications
  • Research into helpful and harm-preventive AI behavior

It is not recommended as a general-purpose assistant without additional evaluation, and should not be deployed as a standalone clinical tool.


Please cite this paper if you find this work useful:

markdown

@misc{barmina2026psychosafeelicitingpsychologicallyinformedrefusals,
title={PsychoSafe: Eliciting Psychologically-Informed Refusals in Large Language Models},
author={Gianluca Barmina and Federico Torrielli and Sven Harms and Jacob Nielsen and Felix Mächtle and Stine Lyngsø Beltoft and Peter Schneider-Kamp and Thomas Eisenbarth and Lukas Galke Poech and Anne Lauscher},
year={2026},
eprint={2606.09697},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2606.09697},
}

The PSYCHOSAFE Framework

PSYCHOSAFE treats refusal as a structured, communicative, supportive act rather than a binary safety decision. All refusals follow a four-part structure:

  1. Acknowledgment & Gentle Refusal — Declines to provide harmful content while warmly acknowledging the person.
  2. Personalized Self-Help Step — Applies a domain-appropriate psychological intervention strategy (e.g., Psychological First Aid, Motivational Interviewing) tailored to the user's expressed situation.
  3. Professional Resources — Refers the user to relevant helplines and support services.
  4. Hopeful Closing — Ends with a brief, sincere, personalized message of hope.

Risk Domains

The model is specifically trained to handle five psychologically salient risk clusters:

Table
DomainIntervention Strategies
Suicide & Self-HarmPsychological First Aid, Safety Planning, QPR Gatekeeper Training, Mental Health First Aid
Substance UseMotivational Interviewing, 5A's Brief Intervention, SOBER
ViolenceGreen Dot Bystander Intervention, Motivational Interviewing
WeaponsGreen Dot Bystander Intervention, Motivational Interviewing
Sexual CrimesGreen Dot Bystander Intervention, Motivational Interviewing

Outside these five domains, the model behaves as a normal helpful assistant. Educational and research-oriented questions about sensitive topics are answered informatively, with context used to distinguish intent.


Training Data

The model was fine-tuned on the PSYCHOSAFE dataset: 8,019 prompt–response pairs spanning the five risk domains above. Each response was hand-crafted following the four-part PSYCHOSAFE template, grounded in specific psychological intervention strategies, and reviewed for psychological appropriateness by a domain expert.

Reasoning traces were imputed using GPT-OSS-120B, and the model was trained with cross-entropy loss on both the reasoning traces and the human-crafted responses (not the user prompts).

Table
Risk clusterExamples
Suicide and Self-Harm2,578
Substance Use1,998
Weapons1,740
Violence1,377
Sexual Crimes326
Total8,019

Training Procedure

Fine-tuning used LoRA applied to all attention and feed-forward projection layers, with the following configuration:

Table
HyperparameterValue
MethodSupervised Fine-Tuning (SFT)
LoRA rankr = 1
LoRA alphaα = 32
DropoutNone
Epochs5
Max sequence length4,096 tokens
Batch size4
Gradient accumulationNone
OptimizerAdamW (8-bit quantization)
Peak learning rate1 × 10⁻⁴
LR scheduleCosine decay
Warmup steps100
Weight decay0.01
PrecisionFull (BF16)
Hardware1 × NVIDIA H100

Framework Versions

Table
LibraryVersion
TRL0.24.0
Transformers5.2.0
PyTorch2.10.0
Datasets4.3.0
Tokenizers0.22.2
Unslothlatest

Evaluation Results

The model was evaluated on a held-out validation set of 500 stratified prompts (100 per risk cluster), using Qwen3.5-397B-A17B as the LLM judge (the candidate with highest agreement with human ratings, Cohen's κ = 0.61). Four criteria were assessed: Refusal (boolean), Psychological Grounding (1–5), External References (boolean), and Relevance (1–5).

Table
SettingRefusal (%)Psych. GroundingExt. References (%)RelevanceOverall (%)
Base model, generic prompt (v0)90.63.38 ± 1.1764.83.90 ± 0.8671.9
Base model, PSYCHOSAFE prompt (v1)96.04.56 ± 0.8695.24.52 ± 0.7492.0
This model, generic prompt (v0)100.03.86 ± 0.7999.83.37 ± 1.1682.7
This model, PSYCHOSAFE prompt (v1)99.83.78 ± 0.8199.13.38 ± 1.1782.0

Key findings relative to the generic-prompt base model baseline:

  • +15.1% overall refusal quality improvement (with generic prompt)
  • +53.9% external resource referral rate
  • +14.2% psychological grounding
  • Near-perfect refusal rate (100%), up from 90.6%
  • Reduced relevance (−13.5%), likely due to over-application of crisis-intervention templates to ambiguous prompts

Out-of-Domain Safety Benchmarks

SORRY-Bench (compliance rate %, lower is safer):

Table
PromptBase Qwen3.5-27BThis model
Default (base prompts)17.10.0
Generic prompt v013.20.0
PSYCHOSAFE prompt v113.60.1
Default (mutation avg.)25.40.0
Generic prompt v0 (mutation avg.)25.40.0
PSYCHOSAFE prompt v1 (mutation avg.)19.00.1

XSTest (over-refusal on safe prompts ↓ / safety on unsafe prompts ↑):

Table
PromptOver-refusal (base)Safety (base)Over-refusal (this model)Safety (this model)
Default13.2%59.0%3.6%17.0%
Generic v012.4%63.0%4.8%15.0%
PSYCHOSAFE v124.0%78.5%9.2%26.5%

The fine-tuned model over-refuses less than the base on benign prompts, ruling out indiscriminate refusal. Its lower safety rate on adversarial out-of-domain prompts reflects limited generalization beyond the five training domains.

General Capabilities

Table
BenchmarkBase Qwen3.5-27BThis model
MMLU0.8450.802
HellaSwag0.6380.641

The modest capability trade-off is considered acceptable in safety-critical deployment contexts.


Limitations

  • Domain coverage is narrow. The model is trained on five specific risk clusters and does not generalize robustly to out-of-domain adversarial safety prompts.
  • Reduced personalization. The fine-tuned model can over-apply crisis-intervention templates to ambiguous or benign prompts, reducing response relevance.
  • English-only. The model and its built-in support resources are in English, with helplines primarily targeting the US and UK.
  • Single-turn only. The model was trained and evaluated on single-turn prompts. Multi-turn, adversarial, and real-user behavior remain unstudied.
  • Not clinically validated. Intervention strategies are adapted from human–human frameworks and should not be interpreted as therapy or crisis management.
  • Generative, not rule-based. Appropriate behavior cannot be guaranteed for all possible inputs or conversational contexts. Miscalibrated refusals may still fail to support users adequately or may escalate distress.

Ethical Considerations

This model is intended to reduce harm caused by blunt or poorly designed LLM refusals in high-risk interactions. However:

  • Supportive and empathetic refusal behavior could create unwarranted perceptions of emotional competence or therapeutic authority in a system that is neither clinically validated nor capable of genuine psychological care.
  • Pre-deployment stress-testing under adversarial, emotionally charged, and out-of-distribution scenarios is strongly recommended.
  • Continuous monitoring and iterative correction after deployment are essential.
  • Future work should evaluate failure modes across diverse cultural contexts, vulnerable populations, and multilingual settings.

Quick Start

python

from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "giannor/Qwen3.5-27B-psysafe"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "Your message here"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

With vLLM:

bash

pip install vllm
vllm serve "giannor/Qwen3.5-27B-psysafe"

With Unsloth:

python

from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="giannor/Qwen3.5-27B-psysafe",
max_seq_length=4096,
)

Citation

If you use this model, please cite the PSYCHOSAFE paper:

bibtex

TBA

Model provider

giannor

Model tree

Base

Qwen/Qwen3.5-27B

Fine-tuned

this model

Modalities

Input

Video, Text, Image

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today