STAMPsy: Towards SpatioTemporal-Aware Mixed-Type Dialogues for Psychological Counseling

Jieyi Wang, Yue Huang, Zeming Liu, Dexuan Xu, Chuan Wang, Xiaoming Shi, Ruiyuan Guan, Hongxing Wang, Weihua Yue

TL;DR

This paper introduces STAMPsy, the first spatiotemporal-aware, mixed-type dialogue dataset designed to bring real-world context and goal guidance to online psychological counseling. Alongside the dataset, the authors propose Self-STAMPsy, a generative framework that utilizes adaptive retrieval-augmented generation (RAG) and an iterative self-feedback loop to deliver highly empathetic, context-specific therapeutic responses.

What Problem Does This Paper Address?

While large language models (LLMs) show promise in mental health support, current systems suffer from two major flaws: they are typically restricted to a single dialogue type (like basic empathetic chitchat or rigid question-answering) and they lack "world awareness."

In real-world therapy, a counselor naturally blends multiple dialogue types—proactively moving from a diagnostic assessment to a knowledge-grounded recommendation, interspersed with emotional comfort. Furthermore, external factors like time, location, and weather heavily dictate appropriate clinical advice. For instance, a therapist will give vastly different advice to a client suffering from insomnia at midnight in their bedroom versus a client waking up anxious at 6:00 AM before a long commute. Existing systems fail to naturally mix these dialogue goals or perceive these crucial spatiotemporal cues.

Methods

The authors introduce Self-STAMPsy, an end-to-end generative framework built on top of Qwen2-7B. As illustrated in the framework diagram below, the system consists of four core modules:

Figure 4: The framework of the proposed Self-STAMPsy. A detailed prompt template is open-sourced.
  1. Helping Skills Selection: A fine-tuned BERT classifier analyzes the dialogue context to predict the most appropriate counselor "helping skill" (e.g., Open Questions, Reflection of Feelings, Direct Guidance) for the next turn.
  2. SpatioTemporal Stamp Processing (STSP): This module extracts environmental cues (time, location, weather) and translates them into emotional state stamps ($ST_i$) to guide the model's situational awareness.
  3. Adaptive Retrieval-Augmented Generation (RAG): If the predicted helping skill requires professional knowledge, the framework adaptively queries a structured psychological knowledge graph using LangChain to inject accurate factual context.
  4. Iterative Self-Feedback: Simulating a real-world clinical supervision report, this module prompts the LLM to self-reflect on the consultation process (evaluating explicit/implicit content, defense mechanisms, and countertransference) to iteratively refine its final response.

Datasets

The primary contribution of this work is the STAMPsy dataset, which stands out significantly from existing emotional support datasets:

Comparison of STAMPsy with other datasets
  • Data Composition: It contains 5,006 multi-turn dialogues and 61,832 utterances. Each dialogue naturally weaves together at least three distinct conversational activities.
  • Theoretical Grounding: The data generation and annotation were guided by professional clinical psychologists using Meichenbaum’s 9-Box Case Conceptualization Model (CCM).
  • The GHSC Benchmark: The authors also developed the Golden Helping Skills Case (GHSC) test, a specialized benchmark based on the Hill Counselor Verbal Response Category System, to evaluate how well models actually understand distinct therapeutic techniques.

Key Insights and Ideas

  • Spatiotemporal Context Drives Empathy: One of the paper's most striking insights is that "world awareness" directly impacts perceived empathy. When a model understands where and when a client is speaking, its advice shifts from generic, robotic platitudes ("establish a routine") to highly tailored, comforting actions ("try stepping into the morning sunlight").
  • Goal Planning Prevents Conversational Drift: Without explicit helping-skill guidance, LLMs tend to act like educational advisors rather than therapists. For example, if a parent complains about a child's grades, a standard LLM immediately tries to solve the educational problem. Self-STAMPsy, guided by a "Reflection of Feeling" goal, correctly focuses on comforting the parent's emotional distress first.

Key Results

The framework was evaluated against strong baselines, including GPT-4 and specialized psychological models like MindChat and EmoLLM.

  • GHSC Benchmark: Self-STAMPsy achieved the highest score of 70.91, outperforming GPT-4 (69.09) and drastically beating standard fine-tuned LLMs (which scored between 9.10 and 25.45).
  • Ablation Impact on Empathy: In manual evaluations conducted by professional psychotherapists, removing the spatiotemporal information caused the model's empathy score to plummet from 1.82 to 1.31 (a massive 38% drop), proving that environmental context is vital for emotional resonance.
  • Dialogue State Tracking: The model achieved a 99.21% accuracy in tracking dialogue slots, demonstrating highly robust performance in complex, multi-turn tracking scenarios.

Limitations and Future Work

The authors explicitly state that their tool is intended to augment, not replace, human therapists. From a technical standpoint, a notable limitation is the model's tendency to ask multiple questions simultaneously during "Open Question" phases (e.g., "Can you describe the feeling in detail? And what are your expectations?"). In real therapy, a rapid succession of questions can overwhelm a client. Future work will focus on optimizing the pacing and inquiry style of the model to ensure clients feel safe and unhurried.

Summary updated

Abstract

Online psychological counseling dialogue systems are trending, offering a convenient and accessible alternative to traditional in-person therapy. However, existing psychological counseling dialogue systems mainly focus on basic empathetic dialogue or QA with minimal professional knowledge and without goal guidance. In many real-world counseling scenarios, clients often seek multi-type help, such as diagnosis, consultation, therapy, console, and common questions, but existing dialogue systems struggle to combine different dialogue types naturally. In this paper, we identify this challenge as how to construct mixed-type dialogue systems for psychological counseling that enable clients to clarify their goals before proceeding with counseling. To mitigate the challenge, we collect a mixed-type counseling dialogues corpus termed STAMPsy, covering five dialogue types, task-oriented dialogue for diagnosis, knowledge-grounded dialogue, conversational recommendation, empathetic dialogue, and question answering, over 5,000 conversations. Moreover, spatiotemporal-aware knowledge enables systems to have world awareness and has been proven to affect one's mental health. Therefore, we link dialogues in STAMPsy to spatiotemporal state and propose a spatiotemporal-aware mixed-type psychological counseling dataset. Additionally, we build baselines on STAMPsy and develop an iterative self-feedback psychological dialogue generation framework, named Self-STAMPsy. Results indicate that clarifying dialogue goals in advance and utilizing spatiotemporal states are effective.
BibTeX
@inproceedings{wang2025stampsy,
  author = {Jieyi Wang and Yue Huang and Zeming Liu and Dexuan Xu and Chuan Wang and Xiaoming Shi and Ruiyuan Guan and Hongxing Wang and Weihua Yue and Yu Huang},
  title = {{STAMPsy: Towards SpatioTemporal-Aware Mixed-Type Dialogues for Psychological Counseling}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i24.34725},
}
Figure