Frederik Bredgaard, Martin Lund Trinhammer, Elisa Bassignana
9 min
This paper introduces the first automated method to classify patients' attachment styles from psychotherapy session transcripts using natural language processing (NLP). Attachment styles—secure, preoccupied, and avoidant—are key psychological patterns formed in childhood that shape adult relationships and therapy success. Traditionally assessed via the manual Patient Attachment Coding System (PACS), which is time-consuming and expert-dependent, the authors use NLP models like RoBERTa-large and MentalRoBERTa to achieve ~60% accuracy. This could scale personalized therapy, helping therapists adapt their style to strengthen the therapeutic alliance and improve outcomes.
Attachment theory, rooted in Bowlby's work, explains how early caregiver-child bonds create enduring relational patterns. In therapy, these manifest in speech: secure patients show balanced proximity-seeking, preoccupied ones ramble longer turns seeking reassurance, and avoidant ones keep distance with shorter, detached speech. PACS manually codes 59 discursive markers across patient sentences into categories like proximity-seeking, then derives styles. With only 78 labeled transcripts from Brief Relational Therapy and CBT, it's a small but precious dataset. The paper's innovation: automate this for scalability.
The authors fine-tune RoBERTa models with domain-adaptive pre-training (DAPT) on unlabeled mental health data from AnnoMI, DAIC-WoZ, and HOPE datasets. This adapts general language models to psychotherapy's unique linguistic nuances. They classify at the speech turn level, experimenting with minimum input lengths and concatenating turns—longer inputs boost performance, as attachment signals emerge over context. MentalRoBERTa, pre-trained on mental health corpora, edges out general RoBERTa, hitting nearly 60% accuracy in stratified splits.
Secure patients have short turns; preoccupied, longer ones—mirroring relational dynamics. Misclassifying preoccupied as avoidant could harm therapy more than other errors, as it mismatches relational needs. This work opens NLP for psychotherapy: from admin automation to inferring patient traits for personalization. Unlike black-box therapy mechanisms, automated attachment detection provides measurable targets. Future: longer contexts, multimodal data, real-time clinical tools.
Psychotherapy works, but why? NLP cracks the black box by quantifying dynamics like attachment, enabling targeted interventions. Scalable assessment democratizes attachment-informed care, potentially revolutionizing mental health.
The delivery of mental healthcare through psychotherapy stands to benefit immensely from developments within Natural Language Processing (NLP), in particular through the automatic identification of patient specific qualities, such as attachment style. Currently, the assessment of attachment style is performed manually using the Patient Attachment Coding System (PACS; Talia et al., 2017), which is complex, resource-consuming and requires extensive training. To enable wide and scalable adoption of attachment informed treatment and research, we propose the first exploratory analysis into automatically assessing patient attachment style from psychotherapy transcripts using NLP classification models. We further analyze the results and discuss the implications of using automated tools for this purpose -- e.g., confusing `preoccupied' patients with `avoidant' likely has a more negative impact on therapy outcomes with respect to other mislabeling. Our work opens an avenue of research enabling more personalized psychotherapy and more targeted research into the mechanisms of psychotherapy through advancements in NLP.
Sam: They focused only on what patients say, pulling out individual speaking segments—called speech turns—from 78 session transcripts. This gave about 7,000 turns total, labeled by the patient's overall style. Secure patients spoke in shorter bursts while preoccupied ones used longer ones. To avoid the model memorizing specific people, they split at the full session level.
Alex: Shorter turns for secure patients... that tracks with keeping distance. So the models had to learn general speech habits, not memorize voices. But with varying lengths, some turns must have been too brief to judge?
Sam: Yes—very short ones like "okay" or "I don't know" lack enough words to show patterns. They tested feeding the model longer chunks by linking turns until reaching at least 150 words, like piecing puzzle bits into a full picture instead of staring at fragments. This context-aware approach helped the model spot clues better, such as words signaling closeness or avoidance.
Alex: Huh, so bundling turns gives the full emotional flavor. Did they tweak the models themselves for therapy talk?
Sam: They started with strong language readers like RoBERTa-large, then did extra practice on unlabeled therapy chats from other datasets. This domain-adaptive pre-training works by masking words in sentences and having the model guess them, tuning it to therapy lingo without needing labels. It built better feel for the domain before fine-tuning on the labeled turns.
Alex: Extra practice on similar talks first—smart way to adapt without more labeled data. And that group decision you mentioned... how'd that push accuracy to 67%?
Sam: They trained five versions of the best model on different data splits, then took the majority vote—like a panel agreeing on a close call. Single models hit 59%, but the ensemble reached 67% majority-vote accuracy, a meaningful gain showing robustness. The paper suggests this scales PACS insights without experts coding every session.
Alex: That's a solid step for making therapy more tailored. Without the 90-minute grind per hour. So bundling those short turns into fuller chunks seems key. Did longer inputs always help, or were there catches?
Sam: Longer inputs generally improved accuracy—for instance, RoBERTa-large went from about 49% on single turns to 56% at a 150-word minimum. That happens because more words capture fuller patterns, like proximity-seeking phrases spread across sentences. But it also raised variability—a sign of less stable predictions with fewer total examples after bundling.
Alex: Huh, so gains in spotting patterns, but riskier swings because you're working with bigger, scarcer chunks. On the final holdout data, how'd the best setup hold up?
Sam: The five RoBERTa-large models at 150 words averaged 60% accuracy on that test set. Taking a majority vote among them lifted it to 67%, as each model caught different angles from varied training splits.
Alex: Okay, so the group vote steadies things by balancing quirks. Looking closer, were some styles tougher to nail—like did it mix up certain types more?
Sam: Yes, the models overpredicted preoccupied patients, likely from that style dominating the training mix at 48% after bundling. Avoidant was hardest, with low recall around 14%—most got labeled preoccupied instead. In therapy terms, that risks mismatched strategies: treating avoidant patients like preoccupied ones could weaken alliances, as the paper notes, since those groups need opposite relational approaches.
Alex: That's a real caution—misreading insecure types might stall progress more than other errors. They also tried a larger generative model, Llama, which scored just 29%—far below discriminative ones like RoBERTa?
Sam: Exactly, the paper highlights confusing insecure styles as riskiest, potentially counterproductive for outcomes. It underscores sticking to classifiers tuned for this pattern-spotting task.
Alex: Overall, this automation's a measured advance, errors and all. Does the paper lay out how that might actually change sessions or research?
Sam: It does. Automating this lets therapists get an early read on a patient's style, so they can tweak their own style—like being more reassuring for avoidant types or giving space for preoccupied ones. That builds stronger bonds faster, cutting risks of breakdowns in trust, and the paper points to studies showing it leads to better results overall. For research, it speeds up trials by skipping manual work, letting scientists test more ideas with bigger groups.
Alex: Right, so not just faster coding, but deeper insights into what makes therapy click for different people. With the small dataset and those swings in predictions, what's holding it back most?
Sam: The main limit is the dataset size—just 78 sessions, so about 7,000 turns total, which causes unstable results across splits. Privacy rules and the hassle of expert labeling make bigger sets rare, and they note computational limits kept them from bigger models. Plus, low recall on avoidant cases means missing key types, and biases could skew toward majority groups.
Alex: Huh, so scalability hinges on more transcripts, maybe from better speech-to-text tools. And ethics—like checking for cultural fits across groups?
Sam: Yes, they stress watching for biases in representation or decisions, though attachment patterns hold up across cultures so far. Future steps include longer inputs, maybe adding therapist talk, and digging into what words the models key on for transparency. Overall, this preliminary work shows NLP can handle attachment spotting meaningfully, but larger data is essential for real use.
Alex: That's a grounded take—promising for personalizing therapy without the grind, yet clear on the work ahead. Thanks, Sam, for breaking it down so clearly.
Sam: My pleasure, Alex. This points to careful progress in opening therapy's black box. Thanks for listening to ResearchPod.