Skip to content
/ PsyLLM Public

Beyond Empathy: Integrating Diagnostic and Therapeutic Reasoning with Large Language Models for Mental Health Counseling

Notifications You must be signed in to change notification settings

Emo-gml/PsyLLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PsyLLM

project logo

arXiv Model Weights Dataset License: Apache 2.0

🌸 About📰 News📦 Dataset🧠 PsyLLM🔥 Quick Start📜 Citation

🌸 About

This repository contains the official evaluation code and data for the paper "Beyond Empathy: Integrating Diagnostic and Therapeutic Reasoning with Large Language Models for Mental Health Counseling". See more details in our paper.

PsyLLM is the first large language model explicitly designed to combine diagnostic and therapeutic reasoning for mental health counseling. Unlike traditional LLM-based systems that mainly provide empathetic or surface-level responses, PsyLLM simulates the reasoning process of professional therapists — assessing symptoms, applying international diagnostic standards (DSM/ICD), and selecting suitable therapeutic strategies (such as CBT, ACT, and psychodynamic approaches) to produce clinically grounded, context-sensitive counseling dialogues.

📰 News

📦 Dataset

OpenR1-Psy Dataset Overview
Figure: Overview of the OpenR1-Psy dataset construction pipeline.

OpenR1-Psy is a large-scale psychological counseling dataset that integrates diagnostic reasoning and therapeutic reasoning to train and evaluate large language models for mental health dialogue generation. It goes beyond empathy-focused corpora by incorporating explicit reasoning traces grounded in DSM/ICD diagnostic standards and diverse psychotherapy frameworks such as CBT, ACT, psychodynamic, and humanistic therapy.

🧠 PsyLLM

PsyLLM is a large language model specialized in psychological counseling and mental health dialogue generation. It unifies diagnostic reasoning and therapeutic reasoning, grounded in established clinical frameworks such as DSM and ICD, and integrates diverse therapeutic paradigms including CBT (Cognitive Behavioral Therapy), ACT (Acceptance and Commitment Therapy), and psychodynamic therapy.

PsyLLM is trained on the OpenR1-Psy dataset, which features multi-turn counseling dialogues enriched with explicit reasoning traces. These traces enable clinically informed, empathetic, and interpretable AI-assisted therapeutic interactions.

The model training and fine-tuning pipeline are implemented using the open-source framework LLaMA-Factory. For more details, please refer to the Code.

🔥 Quick Start

from transformers import AutoModelForCausalLM, AutoTokenizer

model_path = "GMLHUHE/PsyLLM"

# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
    model_path,
    torch_dtype="auto",
    device_map="auto"
)

# prepare the model input
prompt = "I have participated in big group sessions before where I was left to find my own safe place, but it hasn't worked for me."
messages = [
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=True 
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

# conduct text completion
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=32768
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()

# parsing thinking content
try:
    index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:
    index = 0

thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")

print("PsyLLM thinking content:", thinking_content)
print("PsyLLM content:", content)

📜 Citation

@article{hu2025beyond,
  title={Beyond Empathy: Integrating Diagnostic and Therapeutic Reasoning with Large Language Models for Mental Health Counseling},
  author={Hu, He and Zhou, Yucheng and Si, Juzheng and Wang, Qianning and Zhang, Hengheng and Ren, Fuji and Ma, Fei and Cui, Laizhong},
  journal={arXiv preprint arXiv:2505.15715},
  year={2025}
}

🧩 License

For research and educational use only.

Please ensure compliance with ethical and legal standards in mental health AI research.

🔥Please contact huhe@gml.ac.cn if you encounter any issues.

About

Beyond Empathy: Integrating Diagnostic and Therapeutic Reasoning with Large Language Models for Mental Health Counseling

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages