COCOA: CBT-based Conversational Counseling Agent using Memory Specialized in Cognitive Distortions and Dynamic Prompt

Suyeon Lee, Jieun Kang, Harim Kim, Kyoung-Mee Chung, Dongha Lee, Jinyoung YeoarXiv 2024 · DOI

Introduction

The global demand for mental health support is rapidly increasing, yet traditional therapy remains costly and often carries a social stigma. While AI-driven "empathetic" chatbots have emerged as a scalable alternative, they typically provide general emotional support without addressing underlying psychological issues. A significant gap exists in the ability of general Large Language Models (LLMs) to maintain the structured, goal-oriented nature of Cognitive Behavioral Therapy (CBT). CBT requires counselors to identify specific "cognitive distortions"—such as all-or-nothing thinking or mind-reading—and systematically guide clients through therapeutic stages. Standard LLMs often lose track of these clinical goals during extended conversations or fail to prioritize which issues to address first.

To bridge this gap, we present COCOA (CBT-based Conversational Counseling Agent), a specialized framework designed to provide structured clinical interventions rather than just general comfort.

Methodology: Specialized Memory and Dynamic Prompting

COCOA's architecture is built on two innovative pillars: specialized memory management and dynamic prompt composition.

The COCOA architecture, featuring dual-memory management and a multi-stage dynamic prompting strategy.

Specialized Memory Management

Unlike standard agents that rely on a simple chat history, COCOA utilizes two distinct memory types to maintain clinical focus:

  • Basic Memory: Captures general personal insights and context about the client.
  • Cognitive Distortion (CD) Memory: Logs identified negative thought patterns, including the specific utterance, the type of distortion, and a severity score (1–5).
  • Prioritization Logic: The agent employs a scoring function based on recency, frequency, and severity. This allows the system to mimic a human therapist's triage process, deciding which cognitive distortion to address first.

Dynamic Prompt Composition

To ensure adherence to clinical roadmaps, COCOA uses a "Chain-of-Thought" prompting strategy. Before generating a response, the system:

  1. Determines the optimal CBT technique (e.g., Socratic Questioning, Decatastrophizing).
  2. Identifies the current "stage" of that technique (e.g., "Stage 3: Challenge Assumptions").
  3. Retrieves relevant examples to guide the LLM's tone and strategy.

This approach allows COCOA to generate responses based primarily on the immediate preceding utterance and the structured memory, significantly improving efficiency over long-context history processing.

Evaluation Framework

Due to the privacy constraints of real-world clinical data, the authors developed a novel evaluation dataset using Client Simulacra. Eight distinct "clients" were simulated using Character.ai, based on historical or fictional figures with well-documented psychological struggles (e.g., Vincent van Gogh, Jay Gatsby, and Beth Harmon).

COCOA was compared against several baselines, including GPT-3.5-turbo, Llama-2-7B-chat, and Vicuna-7B. Evaluation was conducted using GPT-3.5 as an automated rater, scoring dialogues on a 0–6 scale across five clinical criteria: CBT Validity, CBT Appropriateness, CBT Accuracy, Emotional Support (ES) Appropriateness, and Stability.

Key Results

COCOA demonstrated superior performance across nearly all clinical metrics. It significantly outperformed general-purpose models in CBT Validity and CBT Accuracy, proving more adept at selecting the correct therapeutic technique for specific distortions.

Radar chart comparing CoCoA against ChatGPT across five clinical evaluation criteria, highlighting superior accuracy and validity.

Statistical analysis (T-tests) confirmed that COCOA's improvements were significant (p < 0.05). Notably, the model maintained high scores in Stability over long interactions, whereas baseline models tended to drift away from therapeutic goals. Importantly, COCOA achieved these clinical gains without sacrificing empathy, maintaining high scores in ES Appropriateness.

Discussion and Future Work

While COCOA represents a significant step toward clinically rigorous AI counseling, several limitations remain. The study's reliance on simulated personas may not fully capture the unpredictability of human patients in crisis. Additionally, the use of LLM-based self-evaluation warrants further validation through human expert clinicians. Future research will focus on developing more diverse client agents and integrating expert human feedback into the training loop to further refine the model's therapeutic efficacy.

Summary updated

BibTeX
@misc{lee2024cocoa,
  author = {Suyeon Lee and Jieun Kang and Harim Kim and Kyoung-Mee Chung and Dongha Lee and Jinyoung Yeo},
  title = {{COCOA: CBT-based Conversational Counseling Agent using Memory Specialized in Cognitive Distortions and Dynamic Prompt}},
  year = {2024},
  eprint = {2402.17546},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.17546},
}
Figure