Good therapists echo their clients. They reflect feelings, restate beliefs and name the specific events a client disclosed: "so since the divorce, you've felt you ruin everything." When a language model is trained on therapy transcripts to imitate that style, the text it learns to produce is full of the client's private disclosures. Those disclosures also recur, because a client revisits the same core belief across many sessions. This proposal asks whether that combination quietly defeats one of the more reassuring results in privacy-aware training of language models.
The reassuring result comes from federated learning (many sites train one shared model without pooling their raw data) combined with low-rank adaptation, or LoRA (the large pretrained model is frozen, and only a small pair of thin matrices whose product forms the weight update is trained and exchanged). Mitigating Unintended Memorization with LoRA in Federated Learning for LLMs found that this combination cuts verbatim leakage of planted secrets by up to an order of magnitude compared with full fine-tuning. We claim that this protection was measured under conditions that therapy dialogue violates. We also propose a simple fix and test it. The fix is to stop training the model to produce, from its weights, words that it could have copied from the conversation in front of it.
Core Claim
The memorization study planted "canaries," secret sequences that sit outside the normal data distribution, into clinical notes and QA data, and measured whether they could be extracted. Therapy disclosures are different in two ways. They sit inside the distribution, since trauma narratives are exactly what counseling data looks like. And the training target itself repeats them, because therapist turns reflect client content, and multi-session corpora such as DiaCBT revisit the same beliefs across sessions. This is a natural form of the duplication that drove full fine-tuning above 60% exact-match leakage in the memorization study.
Our first hypothesis is that under reflective, multi-session targets, low rank alone gives much weaker protection than on out-of-distribution canaries. Our second hypothesis is that most of the leakage flows through a small, identifiable set of target tokens, which we call echo tokens. These are spans of the therapist turn that restate content the client disclosed, either in the current context or in an earlier session. We propose echo-masked federated adaptation, which removes echo tokens from the training loss. For tokens echoing the current context, the pretrained model can already copy them at inference. For tokens echoing earlier sessions, the correct behavior is to read them from a session summary placed in the prompt, not to recall them from weights. If both hypotheses hold, clinics could federate higher-rank adapters that carry more clinical skill without paying the leakage cost that the memorization study attributes to high rank.
Research Program
The work has three parts.
Part 1: build the audit. We create fictitious patient profiles, each containing concrete sensitive details: a named relative, a specific traumatic event, a medication, a workplace. We thread these profiles through multi-session cases derived from DiaCBT and CRISP. DiaCBT has 108 cases and 540 sessions. CRISP has 22,063 dialogues averaging 36.48 turns. In the threaded cases, clients disclose the details and therapist turns reflect them at controlled rates. We then distribute the data across simulated clinics, with a non-overlapping patient set at each clinic.
Leakage is measured two ways. The first is verbatim: exact match when the model is prompted with a patient's session opening that omits the detail. The second is semantic: whether an attacker-model can infer the planted attribute from the model's generations. We add the semantic measure because paraphrased leakage matters clinically even when exact match is zero.
Part 2: map the rank trade-off. We sweep rank from 4 to 256 under federated averaging, for both supervised fine-tuning and federated preference optimization. The preference method is DPO, direct preference optimization, which trains the model to raise the likelihood of a preferred response over a rejected one. For each setting we record clinical skill and leakage on the same axes. This directly tests the tension the research file flags between the privacy of low rank and the difficulty of CBT reasoning.
Part 3: echo masking. For each target token, the training weight is
$$w_t = 0 \text{ if token } t \text{ lies in an } n\text{-gram } (n \ge 3) \text{ shared with the same client's current or earlier turns, else } w_t = 1.$$
The loss becomes $\sum_t w_t \log p(y_t \mid \text{context})$. For DPO, the same mask is applied to the log-likelihood sums of both the chosen and the rejected response, so the preference signal comes only from therapeutic structure. We add a fuzzy variant that uses embedding similarity to catch paraphrased echoes. Earlier-session content is supplied at training and at inference as a short session summary in the prompt, so the model learns to read client history rather than store it.
Baselines
Do-nothing baseline. The base instruction model (Qwen2.5-7B-Instruct) with a CBT system prompt and no adaptation. This sets the utility floor and the leakage zero-point. For reference, DiaCBT reports base Qwen at a 44.28% success rate.
Strongest utility reference. Centralized LoRA training on the pooled threaded corpus, which is the setup DiaCBT used. DiaCBT reports a 77.14% session success rate for its LoRA-tuned Qwen2.5-7B. On the preference side, PsychoCounsel-Llama3-8B from Preference Learning Unlocks LLMs' Psycho-Counseling Skills reports an 87% win rate against GPT-4o without length constraints and 77% with them. We rerun both recipes on our data, with our model, compute and tuning budget, rather than quoting them as comparable numbers. Centralized training is the leakage ceiling. It is also the utility level a federated system must approach.
Strongest privacy-motivated competitor. Plain federated LoRA at rank 4, which the memorization study found gives "near-total protection" against verbatim extraction of out-of-distribution canaries. We also include the privacy-oriented federated aggregation of FedSVD, which re-orthogonalizes LoRA updates to support private federated training. We further include federated LoRA with DP-SGD, meaning per-example gradient clipping plus added noise for formal differential privacy. We found no reported result on Lacuna for DP-trained counseling models, so this arm will produce the first such numbers.
Key ablation. Random masking that removes the same fraction of target tokens as echo masking. Without it, any gain could simply come from training on fewer tokens.
All arms share one base model, one set of client splits, the same number of communication rounds and local steps, and the same hyperparameter search budget per arm.
Echo masking wins if it meets two conditions together at some rank of 32 or above. First, it matches or beats rank-4 federated LoRA on leakage. Second, it stays within a few points of the centralized reference on success rate and on CBT-Bench generation scores.
Why not just…?
Why not just use rank 4, which the memorization paper already showed is nearly leak-proof? This is the main threat. If low rank alone suppresses leakage of in-distribution, reflected, repeated disclosures, then echo masking is unnecessary and the paper becomes a confirmation result. That would still be useful for clinics. The rank sweep settles the question directly. The only evidence available so far was collected on out-of-distribution canaries, whose extraction behavior may differ from content the model sees rephrased many times.
Why not just scrub personal information before training? Standard scrubbing removes names and identifiers. The most harmful therapy disclosures are events and beliefs, such as an assault or an affair, which are not named entities. Our semantic-inference metric will show how much scrubbed-but-reflected content still leaks. We will run scrubbing as an additional baseline to measure this.
Why not just train centrally on synthetic dialogues and skip real data? Synthetic corpora such as CRISP and PsychoCounsel-Preference clearly teach counseling skill. Still, CBT-Bench shows that models trained on frontier-model outputs remain weak at fine-grained core-belief classification, with weighted F1 between 44% and 58%, and that GPT-4o falls into the "corrective trap," scoring -0.31 to -0.32 on beginner and intermediate response generation. Real clinic data is where the missing competence plausibly lives. We concede that this proposal cannot demonstrate that gain without real transcripts. What it can do is make training on them safer. We will report how much a synthetic-only centralized model already achieves on our benchmarks, so readers can judge the remaining headroom.
Why not just use DP-SGD for formal guarantees? Differential privacy is the principled answer, and echo masking composes with it rather than replacing it. The question is utility at small per-clinic dataset sizes. If DP alone matches echo masking on both axes, we will report that result plainly.
Proposed Experiments
We use 8 to 16 simulated clinic clients. Utility is measured with DiaCBT success rate and turns per session, CBT-Bench Levels II and III, PsychoCounsel win rate judged against GPT-4o, and the therapist-behavior exact-match rate of LLM4CBT, which reports 43.38% for its prompted system against 16.21% for a naive model. Leakage is measured by verbatim extraction and attribute inference on the planted profiles.
The first decisive check is the rank-by-leakage curve on reflected, repeated disclosures versus out-of-distribution canaries planted in the same corpus. If the two curves coincide, hypothesis one fails.
The second decisive check concerns reflective skill. Echo masking might damage the model's ability to reflect, so we separately score the LLM4CBT "reflecting emotions" behavior category and ask clinicians to rate responses on the Cognitive Therapy Scale for Chatbots from Therapying Outside the Box. That paper reports only moderate rater agreement (Fleiss' kappa 0.47), so we will use multiple raters. If reflection quality drops sharply, the claim that the pretrained model's copying ability suffices is wrong.
The third check tests cross-session content. We compare echo-masked models with and without the session summaries in the prompt. This tests whether the model reads earlier-session material from context, and whether leakage of earlier-session content disappears only when both the mask and the summaries are present.
References
- Mitigating Unintended Memorization with LoRA in Federated Learning for LLMs
- DiaCBT: A Long-Periodic Dialogue Corpus Guided by Cognitive Conceptualization Diagram for CBT-based Psychological Counseling
- Crisp: Cognitive Restructuring of Negative Thoughts through Multi-turn Supportive Dialogues
- Preference Learning Unlocks LLMs' Psycho-Counseling Skills
- FedSVD: Adaptive Orthogonalization for Private Federated Learning with LoRA
- CBT-Bench: Evaluating Large Language Models on Assisting Cognitive Behavior Therapy
- Aligning large language models for cognitive behavioral therapy: a proof-of-concept study
- Therapying Outside the Box: Innovating the Implementation and Evaulation of CBT in Therapeutic Artificial Agents