--- license: llama3 base_model: meta-llama/Meta-Llama-3-8B-Instruct datasets: - AIMH/SQPsychConv_llama3 language: - en pipeline_tag: text-generation library_name: transformers tags: - mental-health - psychotherapy - counseling - cbt - conversational - synthetic-data - therapist-roleplay --- # Model Card for SQPsychLLM-8b-llama3.3 `SQPsychLLM-8b-llama3.3` is a chat model fine-tuned to **roleplay a therapist** in synthetic, Cognitive Behavioral Therapy (CBT)-informed counseling conversations. It is part of the **SQPsychLLM** family released with the paper *Roleplaying with Structure: Synthetic Therapist-Client Conversation Generation from Questionnaires*. This checkpoint is **Llama-3-8B-Instruct** supervised-fine-tuned on **SQPsychConv (Llama 3.3)**, the synthetic corpus generated by `meta-llama/Llama-3.3-70B-Instruct` from real, de-identified structured client profiles and psychological questionnaires (BDI, HAM-D). > ⚠️ **Research use only.** This model is **not** a medical device and **not** a substitute for professional mental-health care. It must not be deployed to interact with patients or anyone in distress without rigorous further validation and qualified clinical oversight. See [Out-of-Scope Use](#out-of-scope-use). ## Model Details ### Model Description - **Developed by:** Doan Nam Long Vu and collaborators (Technical University of Darmstadt; Philipps-University Marburg; Justus Liebig University Giessen; University of Münster), released under the AIMH ("AI for Mental Health") organization - **Funded by:** LOEWE Center DYNAMIC (Hessian LOEWE program), grant LOEWE1/16/519/03/09.001(0009)/98 - **Model type:** Decoder-only causal language model (instruction/chat), fine-tuned for therapist roleplay - **Language(s):** English - **License:** llama3 (inherited from the base model; see [License and data provenance](#license-and-data-provenance)) - **Finetuned from model:** [meta-llama/Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) ### Model Sources - **Repository (code):** https://github.com/AI-MH/questionnaire2dialogue - **Project page:** https://ai-mh.github.io/SQPsych - **Paper:** https://arxiv.org/abs/2510.25384 - **Datasets:** https://huggingface.co/collections/AIMH/sqpsychconv - **Model family:** https://huggingface.co/collections/AIMH/sqpsychllm ## Uses ### Direct Use Research on synthetic mental-health dialogue: generating therapist-side turns in CBT-style counseling conversations, studying privacy-preserving synthetic data, and benchmarking counseling-oriented language models. For the full questionnaire-conditioned, dual-agent (therapist + client) generation pipeline, see the [code repository](https://github.com/AI-MH/questionnaire2dialogue). ### Downstream Use As a starting point for further research fine-tuning, or as a component in supervised, human-in-the-loop training and education settings (e.g., clinician/student practice simulations) under appropriate oversight and ethics approval. ### Out-of-Scope Use This model must **not** be used to: - provide therapy, diagnosis, or any clinical decision to real people; - act as a crisis, emergency, or safety-critical support system; - interact with patients or people in distress without further validation, clinical supervision, and regulatory approval; - impersonate, or be presented as, a real licensed clinician. ## Bias, Risks, and Limitations - **Hallucination and unsafe output.** Like all LLMs, it can produce incorrect, fabricated, or clinically inappropriate content, including advice that is not evidence-based. - **Limited clinical scope.** The conditioning data covers **major depressive disorder**; other conditions, comorbidities, severities, and acute-risk presentations are out of scope and underrepresented. - **Limited population coverage.** The source cohort's demographics, language, and cultural context constrain generalization. - **Inherited bias.** Outputs reflect biases of the base model (Llama-3-8B-Instruct) and of the model (`meta-llama/Llama-3.3-70B-Instruct`) used to generate the training corpus. - **Synthetic-vs-real gap.** Generated dialogues may not capture the full complexity or risk dynamics of real clinical interactions. ### Recommendations Keep a qualified human professional in the loop for any applied use, validate on your own population, obtain your own ethics approval before any study involving people, and add explicit safety guardrails and crisis-resource handling in any interactive system. See the project [ETHICS statement](https://github.com/AI-MH/questionnaire2dialogue/blob/main/ETHICS.md). ## How to Get Started with the Model ```python from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "AIMH/SQPsychLLM-8b-llama3.3" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto") messages = [ {"role": "system", "content": "You are an empathetic therapist conducting a CBT-informed session."}, {"role": "user", "content": "I've felt down and unmotivated for weeks and I don't know why."}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, return_tensors="pt" ).to(model.device) outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7, do_sample=True) print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)) ``` Serve with vLLM (OpenAI-compatible API): ```bash vllm serve "AIMH/SQPsychLLM-8b-llama3.3" ``` ### Training Data [AIMH/SQPsychConv_llama3](https://huggingface.co/datasets/AIMH/SQPsychConv_llama3), synthetic therapist-client conversations generated by `meta-llama/Llama-3.3-70B-Instruct`, conditioned on de-identified structured profiles and questionnaire scores (BDI, HAM-D) from the cohort of Kircher et al. (2019). The instruction-formatted split used for training is `AIMH/SQPsychConv_llama3_finetune`. ## License and data provenance The model weights derive from **Llama-3-8B-Instruct (Llama 3 Community License)**. The training data was **generated by `meta-llama/Llama-3.3-70B-Instruct`**, so the [Llama 3.3 Community License](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct) may apply to the synthetic data; review it before redistribution. The source structured data is de-identified and pre-anonymized, and the released conversations are synthetic and contain no personally identifiable information. Released for research only.