Psychotherapy is often described as a conversation between two people, but researchers have traditionally measured that conversation through tools that flatten it into separate scores. A client may complete a questionnaire about the therapeutic alliance, while a therapist’s effectiveness is assessed through ratings made after a session. Such measures can be valuable, yet they cannot fully reveal how one person’s words shape the other person’s next response, or how those exchanges change from the first appointment to the last. A new methodological framework developed by researchers at the Autonomous University of Madrid offers a way to study therapy as a living, moment-by-moment interaction. Rather than treating the therapist and client as independent sources of data, the approach follows the sequence of their behaviors, quantifies how often particular exchanges occur, and tracks how those patterns evolve across treatment. The work, published in Behavior Research Methods, is designed not only for psychotherapy but also for classrooms, workplaces, families, romantic relationships, caregiving and animal behavior.
The central idea is that a dyadic interaction is more than the sum of two individuals’ actions. Each participant’s behavior can alter the conditions under which the other responds, creating a continuously changing feedback system. In a therapy session, for example, a therapist’s empathic statement may be followed by agreement, elaboration or withdrawal from the client. A task assigned with a clear explanation may produce full agreement, whereas the same task delivered without explanation may be followed by hesitation or disagreement. These sequences may carry more psychological meaning than the overall number of times any single behavior appears. The researchers describe a framework for converting such interactions into analyzable event streams. Each row of the dataset records a behavior, the session in which it occurred and the agent who produced it. Preserving that order allows researchers to examine individual actions as well as molecular sequences made up of two or more consecutive events.
To demonstrate the system, the team analyzed 154 psychotherapy sessions involving 32 patient–therapist dyads. The sessions were drawn longitudinally from different stages of cognitive–behavioral therapy, including assessment, treatment planning and the beginning, middle and end of intervention. Every verbal behavior was coded using the Therapeutic Relationship Coding System, an observational scheme designed to capture alliance-related actions as they happen. The resulting dataset contained 108,192 coded behaviors. Two experienced observers—licensed psychotherapists undertaking doctoral research and each with more than five years of coding experience—classified the sessions. In a randomly selected 10 percent of sessions, agreement between coders ranged from good to excellent, with Cohen’s kappa values of 0.66 to 0.83 and observer accuracy between 82 and 92 percent. The sessions were recorded and coded using computer-assisted software, but the framework is compatible with data exported from other platforms, including open-source tools.
The researchers paired the behavioral records with clients’ scores on the Working Alliance Inventory, a questionnaire assessing the perceived quality of the therapeutic relationship. Alliance scores were collected at several points during therapy, and the ten dyads with the highest average scores were designated the “Good” alliance group, while the ten with the lowest averages formed the “Poor” group. This grouping did not represent an independent test of the observational data: the questionnaire and behavioral coding measure related but different aspects of the therapeutic relationship. Instead, the comparison asked whether clients’ global judgments of alliance corresponded to recognizable patterns in the interaction itself. That distinction matters because a questionnaire typically captures a retrospective, overall impression, whereas observational coding can identify precisely which therapist behavior preceded which client response. The two perspectives may converge without being interchangeable.
The framework is organized around three practical questions. First, which behaviors or sequences are most frequent? Second, how do their frequencies change across therapy phases? Third, do those trajectories differ between groups of dyads? To answer the first question, the researchers created a heatmap function that displays absolute or relative frequencies of selected behaviors across treatment stages. Relative frequencies are important because sessions differ in length and in the total number of coded events. A behavior appearing 50 times in a highly talkative session may not be more prominent than one appearing 20 times in a shorter session. The tool can therefore divide the number of target behaviors by the total number of behaviors recorded, producing a measure of prominence rather than a raw count. It also allows researchers to combine related codes without altering the original data, preserving flexibility for different theoretical questions and cultural contexts.
The heatmap analysis revealed that client sequences involving partial agreement and disagreement were particularly common during treatment planning and the beginning of intervention, when therapist and client were negotiating goals and tasks. Such exchanges were less frequent during assessment, when clients mainly described their problems, and later in treatment, when they may have become more accustomed to the intervention. Therapist empathy showed a different pattern, ranking below disagreement-related behavior in overall frequency but peaking during assessment and at the end of therapy. That distribution fits the changing purposes of treatment: early sessions require emotional understanding and alliance building, while final sessions often involve reflection on progress and change. Task-related sequences were most common during intervention, when therapists actively assign techniques and exercises. A sequence in which a therapist introduced a task without explanation and the client fully agreed occurred more often than the same kind of task followed by partial agreement or disagreement.
Frequency alone, however, can obscure behaviors that are rare but consequential. A hostile response to a client’s account might occur only once, yet appear at a critical moment and disrupt collaboration. Likewise, empathy may be less common than routine questioning but still influence whether a client feels understood. To address this problem, the researchers developed a trajectory function that normalizes each behavior against its own total occurrence across all phases of therapy. If a dyad produces 100 instances of a behavior over the course of treatment, the number occurring in each phase is expressed as a proportion of that total. This differs from session-level normalization, which compares a behavior with every other behavior in the same session. The trajectory measure instead asks when a particular behavior tends to occur, making it easier to compare the timing of common and uncommon behaviors. The function plots individual dyads, group averages and model-based trajectories, while accounting statistically for stable differences between dyads through random-intercept mixed-effects models.
The exploratory models tested linear, quadratic and cubic patterns using regularized Bayesian linear mixed-effects models. Model selection was based primarily on the Akaike information criterion, with the Bayesian information criterion also reported. Where phase-level distributions were approximately normal, the software calculated 95 percent confidence intervals using the t distribution, a cautious choice for small samples. Bootstrap percentile intervals were available when normality was questionable. These analyses are not intended to provide a definitive causal model of therapy. With only a handful of observation points per dyad, more elaborate approaches—including hidden Markov models, stochastic differential equations and network models—would generally require more repeated measurements than the illustrative dataset provides. The authors present their trajectory tools as a disciplined way to explore patterns, generate hypotheses and identify the treatment phases most worth investigating in future studies.
The trajectories nevertheless produced clinically recognizable patterns. Therapist-delivered tasks accompanied by explanations increased from assessment into the early and middle intervention phases, then declined toward the end of treatment. This pattern reflects the structure of cognitive–behavioral therapy: early appointments focus on understanding the client and negotiating goals, intervention sessions emphasize skill practice and generalization beyond the clinic, and final sessions return attention to consolidation and review. A combined behavior consisting of presenting success and making a positive relationship self-disclosure increased through the early phases and then stabilized during the middle and final stages. The most striking group difference concerned active listening followed by total client agreement. Both alliance groups showed the highest relative frequency of this sequence during assessment. In the Poor alliance group, however, it declined steadily as treatment progressed. In the Good alliance group, it fell initially but rose again at the end, a pattern consistent with renewed emphasis on accurate summaries and reflection as therapy concluded.
The researchers have made the preprocessing procedures, R functions, coding materials and associated data publicly available through an accompanying website, lowering a barrier that has kept systematic observation less widely used than questionnaires. Observational research is laborious because trained coders must preserve the timing, order and meaning of events, often across hours of recorded interaction. Recent advances in speech transcription and large language models could make that work faster, but automated systems still struggle with context, nuanced emotion, hallucinated content and reliable distinctions between subtly different interpersonal behaviors. The new framework is therefore positioned as infrastructure for both human- and AI-assisted observation: it specifies how event data should be organized, normalized and visualized before stronger inferences are attempted. Its broader promise is methodological rather than therapeutic. By making interaction sequences easier to quantify, the approach could help researchers study how teachers respond to students, how couples escalate or resolve conflict, how caregivers communicate with infants, or how workplace conversations shape cooperation. The key shift is simple but consequential: to understand relationships, researchers may need to measure not just what each person does, but what happens next.
Cite Scienmag News
SCIENMAG. (August 28, 2026). New framework quantifies moment-by-moment interactions between people through observation. https://scienmag.com/new-framework-quantifies-moment-by-moment-interactions-between-people-through-observation/
SCIENMAG. "New framework quantifies moment-by-moment interactions between people through observation." Scienmag, 28 August 2026, https://scienmag.com/new-framework-quantifies-moment-by-moment-interactions-between-people-through-observation/. Accessed 28 August 2026.
SCIENMAG. "New framework quantifies moment-by-moment interactions between people through observation." Scienmag. August 28, 2026. https://scienmag.com/new-framework-quantifies-moment-by-moment-interactions-between-people-through-observation/








