Skip to content

Original Research

Frontiers in Neural Circuits ·

Volume 20 - 2026 | https://doi.org/10.3389/fncir.2026.1812938

Fleeing is believing: adaptive behavior under social threat as an inference process

  • Hridai S. Khurana1,2
  • Valeria Mussetto1
  • Leiron Ferrarese1
  • Cornelius T. Gross1
  • Rory J. Bufacchi1*corresponding author
  1. 1Epigenetics and Neurobiology Unit, EMBL Rome, European Molecular Biology Laboratory, Monterotondo, RM, Italy
  2. 2Department of Biotechnology, Indian Institute of Technology Madras, Chennai, India
Article metrics0 viewsView details

Abstract

Adverse social experiences profoundly alter animal behavior, yet the processes underlying context-appropriate behavior selection based on prior social interactions remain poorly understood. Existing models capture statistical patterns but are not framed in mechanistic frameworks that explain individual variability and predict behavioral outcomes. We address this gap by modeling social defeat in mice as a partially observable Markov decision process (POMDP), implementing a heterarchical agent architecture—a structured network of interacting modules balancing exploration and exploitation. Our model successfully reconstructs observed behavioral motifs (e.g., investigation, hesitation, and flights), fits different mouse phenotypes (e.g., susceptible vs. resilient), and mechanistically captures the impact of social defeat as a parameter shift in the animal’s internal generative model. Notably, characteristic behavioral motifs including investigation bouts, hesitation, and flight trajectories emerge from the model’s inference dynamics, without any trajectory-level fitting. The model additionally reproduces effects of interventions like optogenetic stimulation, and generates testable predictions for future experiments. The model’s modular architecture enables natural extension to other behavioral domains including foraging and multi-agent interactions, representing a foundational step toward interpretable models of mouse behavior. By capturing how adverse social experiences reshape decision-making at the computational level, this work offers potential clinical relevance for trauma and anxiety disorders in humans.

Keywords

1. Introduction

Defensive behavior in animals emerges from a continuous decision-making process that balances the imperative to gather information against the risk of physical harm (Dall et al., 2005; Lima and Dill, 1990; Kacelnik and Bateson, 1996; O’Connell et al., 2018). While modern ethological methods excel at cataloging behavioral structure, they often stop short of formally explaining the computational logic driving an animal’s choices. To understand how adverse experiences reshape behavior and make quantitative predictions, we need normative models that map hidden internal beliefs to observed actions.

Current computational approaches face challenges bridging algorithmic theory and biological implementation. Descriptive methods including high-resolution tracking [e.g., DeepLabCut (Mathis et al., 2018), MoSeq (Wiltschko et al., 2015; Wiltschko et al., 2020), SimBA (Goodwin et al., 2024), DeepOF (Bordes et al., 2023)], statistical descriptions (e.g., Lévy walks), and neural dynamical systems models (Rahy et al., 2022; Alfieri et al., 2022) characterize what the system does but not why specific policies emerge. While reinforcement learning models (Zorowitz et al., 2020; Mkrtchian et al., 2017; Spiegler et al., 2020) do extract some interpretable parameters in the form of expected values, they are blind to the neural correlates of sensory inference and uncertainty. Other normative frameworks [e.g., Bayes-Adaptive Markov Decision Process (Shen and Dayan, 2025)] have formalized exploration as risk-sensitive trade-offs, incorporating interpretable prior and risk-sensitivity parameters. Yet such models abstract behavior to predefined discrete states that must be fitted from observed transitions, and consequently neither model how experience reorganizes an agent’s internal generative model, nor generate testable predictions about the dynamics of actual behavior. Can we then build a model for ecological defensive behavior that does not have these drawbacks, has parameters and internal variables which are directly-interpretable cognitive quantities, and nonetheless generates recognizable behavioral patterns from first principles?

The social defeat paradigm (Golden et al., 2011) in rodents offers a tractable testbed. In this protocol (Figure 1), defeat by an aggressive conspecific drives robust, quantifiable behavioral adjustments in subsequent social interactions, often shifting behavior from social exploration toward social avoidance (Silva et al., 2013; Krzywkowski et al., 2020). Such responses can be adaptive, promoting coping strategies that reduce risk during future encounters. Yet they may also hold clinical significance, as overly rigid coping patterns following social stress are implicated in disorders such as major depression and social anxiety (Ike et al., 2020; Slavich, 2020; Iñiguez et al., 2014). This variability in response to social defeat presents a specific challenge: explaining how closely matched experiences can yield divergent behavioral outcomes.

We developed a heterarchical agent architecture implemented via Active Inference (Pezzulo et al., 2024). Our model comprises three distinct, interacting modules: Spatio-Motor (executing navigation), Threat Identification (resolving stimulus identity), and Danger Context (encoding safety context) (Figure 2A) - that collectively drive behavior by predicting sensory inputs, then adjusting actions based on prediction errors. This modular structure parallels the anatomical organization of defensive circuits as distinct computational subsystems. The question becomes whether such a model can fit real behavioral dynamics while offering a way to generate experimentally testable hypotheses about the neural computational mechanisms.

By fitting the model to observed behavioral profiles from mice before and after social defeat, we find that phenotypic shifts can be captured by parameter updates within specific modules. The model produces continuous spatial trajectories and behavioral sequences (hesitation, flight, exploration) that emerge from belief updating rather than explicit programming. As a proof of concept for circuit-level prediction, we show that simulating optogenetic activation of the Danger Context module reproduces experimentally observed state-dependent escape responses elicited by optogenetic stimulation of the ventrolateral ventromedial hypothalamus (VMHvl) (Krzywkowski et al., 2020).

Our approach offers a starting point for linking behavioral dynamics to underlying computational processes. The modular architecture provides interpretability and potential extensibility to other behavioral domains, suggesting a path toward more general normative models of animal decision-making.

2. Materials and methods

Active inference framework

Each of the modules in the model is in itself an agent using Active Inference, a normative framework which posits that agents act to minimize the expected free energy of their future observations (Smith et al., 2022; Parr et al., 2022; Friston et al., 2023). Formally, the agent operates within a Partially Observable Markov Decision Process (POMDP) governed by an internal generative model. This model is parameterized by a likelihood matrix A, which maps hidden states to sensory observations P(o|s), a transition matrix B, which defines the probabilistic evolution of states P(s t + 1 |s t, π) given a policy π, and a preference distribution C, which encodes the agent’s prior beliefs about preferred outcomes P(o).

The behavioral loop proceeds in two distinct phases: perception and planning. In the perception phase, the agent infers the current hidden state of the environment s t ​ from sensory observations o t. This is achieved by minimizing the Variational Free Energy F.

This minimization approximates the posterior belief Q(s|o) that best explains the sensory data, effectively converting raw sensation into a probabilistic understanding of the current context.

In the planning phase, the agent propagates this belief into the future to select a policy π (a sequence of actions). Using the transition matrix B, the agent predicts future states and evaluates them against its preferences C. It does this by selecting the policy that minimizes the Expected Free Energy G(π t) evaluated over future time steps t ∈ [1, N], where N denotes the planning horizon - the number of time points over which the agent can anticipate future states. This decomposes into two distinct components:

The first term, Epistemic Value, computes the expected information gain (Bayesian surprise) between the prior and posterior, representing the entropy of the predicted observations, driving the agent toward states that resolve uncertainty (e.g., exploration). The second term, Pragmatic Value, represents the expected log probability of observing the preferred observation under the selected policy, intuitively computing how likely it is that this policy will drive the agent toward goal-directed behavior (e.g., safety or reward). By minimizing this dual objective, maximizing the KL divergence (Epistemic) and likelihood of preferred observations (Pragmatic), the agent naturally alternates between exploratory and defensive behaviors depending on its current uncertainty and environmental context.

Discrete implementation

We used the PyMDP Python library to implement this framework (Heins et al., 2022). PyMDP uses the discrete (in space and time) implementation of active inference, where the equations above resolve to tractable matrix operations.

Specifically, for a module with hidden states s ∈ {1, …, |S|}, observations o ∈ {1, …, |O|}, likelihood matrix A ∈ ℝ |O| × |S| where A [o,s] = P(o|s), prior D ∈ ℝ |S|, and current belief q (s t) ∈ ℝ |S|, the discretized variational free energy is:

Where q(s t-1) is q(s t) from the previous timestep, and q(s 0) is D.

Perception

Minimizing F with respect to q(s) yields the posterior belief update:

Where A[o t,:] is the row of A corresponding to observation o t, and ⊙ denotes elementwise multiplication, followed by L1 normalization. This is the operation executed at every timestep for all three modules during the perception phase.

Action

For a candidate policy π corresponding to action u, the discretized expected free energy over a planning horizon of N steps is bounded by:

Where the first term is the Epistemic Value, and the second the Pragmatic Value. H[·] denotes entropy, while C ∈ ℝ |O| encodes the log-preference distribution over observations, which drives the agent toward preferred outcomes.

q(o t) are the predicted observations, and are computed as:

At each future timestep t, the belief is propagated forward, using the state-transition matrix B ∈ ℝ |S| × |S| × |u| where B[s t,s t,u t + 1 ] = P(s t + 1 |s t,u t):

The policy with the lowest G is selected (softmax over −G), determining the action executed by each module at each decision step.

A worked numerical example illustrating a single timestep for the Threat Identification module is provided in Supplementary Section 1.6.

Model environment

The environment was modeled as a 2-dimensional discrete grid world (Figure 1B) comprising 57 distinct spatial states. The arena dimensions were made to match the geometry of the physical experimental arena used in the behavioral assay. The arena contained two distinct features:

Shelter zone, comprising three grid states on the end of the corridor.

Conspecific cage, comprising four grid states on one corner of the chamber.

The environment generated sensory observations based on the agent’s spatial proximity to these features, which can be interpreted as simulating a mix of multiple sensory modalities:

Conspecific Signal: The conspecific source (cage) emitted a position-dependent signal. The intensity of this signal was determined by the Manhattan distance (since the agent moves only in the cardinal directions) between the agent and the cage location.

Shelter Signal: Similarly, the shelter emitted a location signal, providing a “homing” gradient, enabling the agent to navigate toward safety.

Agent Location: The agent received feedback regarding its current grid coordinate, which was used to update its internal belief about its position within the arena.

At each timestep, the environment calculated the agent’s new position based on its chosen motor action, enforced boundary constraints (if trying to enter walls or the cage, the agent does not change position), and updated the sensory signals accordingly. The environment was deterministic in its physical dynamics.

Generative model

The agent’s internal model is defined by a Partially Observable Markov Decision Process (POMDP) structured into tuples of matrices (A, B, C, D, E). We distribute these matrices across three distinct, interacting modules: Spatio-Motor (M), Threat Identification (T), and Danger Context (D).

1 Spatio-Motor Module (M) This module handles low-level navigation and spatial inference.

State Space (S M): Each state is one of the 57 spatial locations in the discretized arena.

Observations (O M): The agent receives three sensory channels: Self-location, Conspecific Sensory Signal (scalar 0–9), and Shelter Sensory Signal (scalar 0–12).

Actions (U M): 5 possible moves { Stay }.

Likelihood (A M): Maps hidden states (spatial locations) to observations. Proprioception is deterministic, while Conspecific/Shelter signals are probabilistic, with precision decaying over distance.

Transitions (​ B M): Encodes physical movement physics. Maps the effect of actions ∈ { Stay } to transition the agent to adjacent cells. Actions are restricted to cardinal directions to limit computational cost and avoid diagonal trajectories that yield non-physical speed advantages.

Preferences (C M ​): Defines the agent’s immediate goals over observations, which are to stay near shelter (positive utility) and avoid threats (negative utility). Crucially, this matrix is dynamic; it is modulated by higher-level modules to switch the agent’s drive between exploring (investigating the threat) and fleeing (seeking shelter).

Priors (D M): Prior belief on state, initialized as a uniform probability over the state space, to simulate the agent not immediately knowing the locations of itself, shelter, or threat.

Habits (E M): Encodes priors over actions. Here, the Stay action receives a bias, to simulate energy cost or immobility observed.

2 Threat Identification Module (T) This module acts as the identification system, inferring the identity of ambiguous social targets.

State Space (S T ​): Two hidden state factors: Conspecific Identity { Not Threat, Threat } and Proximity [ 0, 9 ], where distances beyond 9 are considered equal.

Observations (O T): Receives the sensory input for Conspecific Sensory Signal (scalar 0–9).

Action (U T): The module selects between { Null, Approach } actions. If the Approach action is selected, the T module inverts the Motor module’s preferences to assign a negative utility to the shelter and positive to threat observations, facilitating investigation.

Likelihood (A T): Maps hidden Identity and Proximity states to observations. The precision of this mapping is distance-dependent, governed by a fitted parameter sensory_slope (see Methods Section 4.6.2); signals are noisy at a distance and precise up close.

Transitions (B T ​): Identity is stable (a threat does not spontaneously become safe). Proximity states update based on the Motor module’s movement.

Preferences (C T ​): No utility to observations, agent does not prefer a specific Conspecific Sensory Signal.

Priors (D T): Prior belief on state, initialized as a uniform probability over identity and distance factors, to simulate the agent not immediately knowing the current state.

Habits (E T): No bias on any action.

3 Danger Context Module (D) This module encodes whether the agent is in danger or not.

State Space (S D): Two context hidden states: { Safe, Danger }

Observations (O D): A joint signal derived from the T module’s identity belief { Not Threat, Threat }, and distance from the conspecific [ 0, 9 ] derived from the M module.

Action (U D): Chooses between { Null, Avoid }. When the Avoid action is chosen, this module strengthens the Motor module’s default preferences (C M) with a high negative utility for the Conspecific proximity observation and a high positive utility for the shelter, resulting in a flight response.

Likelihood (A D): Maps context state to observations. Observations where the identity belief is of Threat and distance is close enough (modulated by a distance threshold parameter) are mapped to Danger state context, others are Safe.

Transitions (B D ​): Avoid action switches context to Safe.

Preferences (C D): Negative utility to observations that map to Danger context.

Priors (D D): Initialized as a uniform probability over context state.

Habits (E D): No bias on any action.

Implementation characteristics of each of the matrices in the specified generative model are documented in Table 1 below.

Simulation protocol

The simulation is structured as an active inference process across the three levels, shown in Algorithm 1. At each time step t, each module in the agent performs state estimation (inference, minimizing variational free energy). The M module performs action selection (minimizing expected free energy) at each time step, while higher levels (T and D) perform action selection every tick s T or tick s D time steps, or with event-based triggers, upon reaching specific belief thresholds to modulate the agent’s goal preferences (represented by the C vector).

To simulate long-term pre-existing beliefs, we implement a forgetting mechanism where state beliefs (posteriors) decay toward their generative prior at rates η M, η T, η D after each step. As a result, high-precision beliefs are maintained only through ongoing interaction with the environment, rather than defaulting to generalized assumptions about longer-term state.

Pseudocode describing implementation of the simulation of mouse behavior as an active inference process. Flowchart-style pseudocode detailing an agent-based algorithm, showing initialization, iterative inference and action selection for agents M, T, and D, observation processing, belief updating, action execution, and decay mechanisms, using free energy and policies per timestep.

Social defeat experiments

Animals

All experimental procedures involving the use of animals were carried out in accordance with EU Directive 2010/63/EU and under the approval of the EMBL Animal Use Committee and the Italian Ministry of Health License 183/2024-PR to Cornelius Gross. C57BL/6 J wild-type mice were obtained from local EMBL colonies. Adults (>8 weeks old) were used in all experimental procedures. The experiments were performed in male mice, since the social defeat procedure relies on interactions with aggressive males. Aggressor mice were single-housed CD1 adult retired male breeders purchased from Charles River Laboratories. CD1 mice were pre-screened for aggressiveness (Franklin et al., 2017). CD1 mice were considered aggressive if they defeated different C57BL/6 J males across three consecutive resident–intruder sessions performed in the C57BL/6 J home cage. A defeat was scored when the CD1 delivered 6–10 attack bouts that elicited defensive responses in the C57BL/6 J mouse (escape, freezing, upright postures). All animals were maintained in a temperature and humidity-controlled environment with 12 h light and 12 h dark cycle, and food and water were provided ad libitum.

Behavioral testing

The social defeat procedure was adapted from Sureka et al. (2025). The apparatus consisted of a plexiglas chamber (25 × 25 × 25 cm) connected via a 12-cm-wide doorway with a sliding door to a plexiglas corridor (34 × 12 × 25 cm). A rectangular shelter with a narrow entrance (8 × 12 × 7 cm; red Plexiglas) was placed at the distal end of the corridor, and a wire-mesh cage was positioned in the corner opposite the corridor opening inside the larger chamber. Experimental C57BL/6 J mice were single-housed for a week before testing. They were then habituated to the empty apparatus for 5 min on two consecutive days. Subsequently, mice underwent three sessions of habituation to the aggressor (habituation days 1–3) consisting of four phases: (i) exploration of the empty apparatus for 5 min; (ii) investigation, during which an aggressive CD1 mouse was placed inside the wire-mesh cage in the chamber while the experimental mouse freely explored the apparatus for 5 min; (iii) restriction, during which the experimental mouse was confined to the chamber for 5 min by closing the sliding door while the CD1 remained confined within the wire-mesh cage; and (iv) post-restriction exploration of the entire apparatus for 5 min after reopening the sliding door. Next, on defeat days 1 and 2, the same sequence was performed for the Control group. For the Defeat group, during the restriction phase the CD1 mouse was released from the wire-mesh cage into the chamber to permit a social defeat encounter, which was terminated after 6- attacks or 10 min (whichever occurred first). Immediately thereafter, the CD1 mouse was returned to the wire-mesh cage and the experimental mouse completed the post-restriction phase (5 min free exploration of the full apparatus). On the final day (post-defeat test day), all mice underwent the same procedure until the investigation phase only. To prevent familiarity effects, each experimental mouse was exposed to a different CD1 aggressor on each day, and each CD1 mouse was used for no more than one defeat session per day. The apparatus was cleaned between animals by wiping sequentially with ethanol and water.

All behavioral sessions were video-recorded using a Basler camera positioned above the apparatus (top-down view) at 25 frames per second. Pose was estimated using DeepLabCut (Mathis et al., 2018) with a ResNet-50 backbone. A network was trained on manually labeled frames sampled from a subset of videos spanning sessions and subsequently applied to all videos to extract x–y coordinates for eight body landmarks. Outliers in the tracked data were subsequently identified and corrected using SimBA software (Goodwin et al., 2024).

Biological validation and parameter optimization

To ensure the model captures realistic ethological dynamics, we fit the agent’s parameters to biological data derived from the social defeat experiment.

Experimental dataset

We utilized a dataset of mouse trajectories extracted via DeepLabCut (Mathis et al., 2018) from experimental videos, consisting of 13 mice split into Control (n = 7) and Defeat (n = 6) groups. These continuous trajectories were mapped into the 57-state grid matching the aspect ratio of the arena, and subsampled to 2,000 time steps, corresponding to approximately 5 min of real-time investigation phase of the behavioral experiment. This discretization preserves the key spatial topology - shelter, corridor, and threat cage, allowing for direct comparison between biological and simulated agents. The investigation phase just before the first defeat was taken as the pre-defeat behavior, and investigation after the final defeat day was taken as post-defeat behavior for both Control and Defeat groups. Further, we used a validation dataset consisting of 6 mice (3 defeat, 3 control), using the same methods for analysis.

Optimization framework

We employed Optuna (Akiba et al., 2019), a Bayesian optimization framework, to tune the agent’s free parameters. Specifically, we used the Tree-Structured Parzen Estimator (TPE) (Watanabe, 2025) sampler to explore the high-dimensional parameter space efficiently. The optimization targeted five key internal parameters that govern the agent’s cognitive and motor dynamics:

id_threshold: The confidence level required by the Threat Identification (T) module to classify a signal as a threat.

sensory_slope: The rate at which sensory precision decays with distance, determining the agent’s sensory acuity or uncertainty about distal objects.

k_shelter: The magnitude of the preference (utility) for the shelter.

k_threat: The magnitude of the preference (utility) for avoidance of the threat, calibrating the agent’s risk/reward sensitivity.

bias_stay: The transition probability bias (habit) assigned to the “Stay” action in the Motor module, serving as a proxy for motor lethargy or decision latency.

Ethological metrics and loss function

The optimization objective was to minimize a composite loss function representing the divergence between the simulated agent’s behavior and the “Average Mouse” profile (derived from the control group). We defined a set of eight ethological metrics to capture distinct facets of defensive behavior:

Time in Shelter: The fraction of total time steps the agent occupies the designated shelter cells.

Social Investigation Time: The fraction of time spent in the interaction zone (cells within distance ≤2 of the threat), conditioned on temporal continuity (occupying the zone for at least 3 consecutive frames) to filter out transient crossings.

Zone Transitions: The frequency of border crossings between the three functional zones (Shelter ➔ Corridor, Corridor ➔ Shelter, Corridor ➔ Chamber, and Chamber ➔ Corridor), capturing the dynamism of the agent’s behavior.

Spatial Exploration Entropy: The Shannon entropy of the occupancy distribution over the 57 states, quantifying the diversity of exploration.

Immobility: The proportion of time steps where the agent’s location remains unchanged (locatio n t = locatio n t − 1), measuring general motor inactivity.

The global loss L was calculated as a weighted sum of the squared z-scores for each metric k, normalizing the simulation output s k against the biological mean μ k and standard deviation σ k of the target cohort:

where w k ​ represents the importance weight of each metric. We prioritized the primary ethological readouts - Time in Shelter and Investigation Time, with higher weights (w = 2.0), while all other metrics like transitions and entropy were weighted lower (w = 0.5), for a total weight of 7.5. This hierarchical weighting ensures the optimizer prioritizes ethological validity (where the mouse spends its time) while still constraining the agent to realistic motor patterns (how it moves).

Parameter estimation via representative profile matching

To model individual variability without the computational cost of independent optimization for every subject, we employed a profile-matching strategy. We first conducted optimization runs across a manifold of representative parameter configurations to generate a library of behavioral profiles. Each experimental subject was then uniquely mapped to the parameter set from this library that minimized its specific loss function.

We assessed the quality of these matches by converting the fitting loss into standard deviations relative to the experimental data variance (σ = L / ∑ k w k ​).

This metric confirms that the discrete parameter library provided sufficient resolution to capture individual differences with high fidelity.

The matching process yielded sub-sigma accuracy for the majority of the cohort. The median subject was matched with a precision of 0.56 σ, and even the outlier cases remained close to 1.0 σ. This indicates that the simulated agents are statistically indistinguishable from the experimental subjects, as the model deviation falls well within the natural behavioral variance of the biological population.

In-silico optogenetic stimulation

To simulate optogenetic activation of the ventromedial hypothalamus (VMH), we introduced an exogenous bias to the Danger Context module agent’s belief state at the moment of conspecific encounter.

Stimulation was modeled as an additive boost to the posterior belief in the Danger state, applied immediately after sensory inference but prior to action selection. When the agent crossed the distance threshold, the belief state was modulated according to:

Where Q (s Danger) represents the belief of the Danger Context module derived from sensory evidence and β opto is the stimulation intensity.

3. Results

Task overview

We used a three-day social defeat protocol adapted from Sureka et al. (2025) (Figure 1A). Each day, experimental mice were allowed to explore a two-compartment arena (Figure 1B) consisting of a main chamber connected to a corridor terminating in a shelter, with an aggressive male mouse positioned in a wire-mesh cage in the chamber. During this period, the time spent investigating the aggressor as well as the time spent in the shelter were recorded. Next, the aggressor was released for a period sufficient to elicit social defeat (6–10 biting attacks) of the subject mouse. Control animals were run through the identical sequence, except that the aggressor remained confined behind the mesh barrier throughout (Figure 1A). On the last post-defeat test day, defeated mice displayed a robust avoidance phenotype, spending significantly less time near the caged aggressor and correspondingly more time in the shelter than control animals (Figures 1C, D).

Model design

We developed a generative model that simulates defensive decision-making as a continuous active inference process. We first describe the model architecture and its generative dynamics independently of experimental condition. Differences between pre- and post-defeat behavior are introduced later in the Results (Section 2.5). The agent comprises three interacting modules (Figure 2A): Spatio-Motor (Figure 2B), Threat Identification (Figure 2C), and Danger Context (Figure 2D); each with distinct action timescales. Here, timescale refers to the typical length of time for which a module accumulates evidence before updating its policy. The agent receives sensory olfactory1 inputs of shelter (Figure 2E) and threat (Figure 2F) from the environment.

Accordingly, the Spatio-Motor operates on a fast timescale to handle spatial navigation. The Threat Identification module operates on a slower cycle to resolve discrete uncertainty (e.g., “Threat” vs. “Friendly” conspecific), while the Danger Context module operates on the slowest timescale to encode persistent environmental states (“Safety” vs. “Danger”). However, these timescales are not rigid constraints, they can be triggered to update immediately when presented with unambiguous, high-precision evidence, allowing the system to react instantly to sudden threats.

These modules interact by exchanging inferred and preferred states. The system’s foundational survival drives are anchored in the Spatio-Motor module, which maintains a base preference for the shelter location and a strong aversion to observations of threat. The Danger Context module reinforces this by maintaining a persistent preference for “Safety” over “Danger” states.

In contrast, the Threat Identification module possesses no intrinsic preference for specific outcomes. Instead, it is driven purely by epistemic value—the imperative to resolve uncertainty. To minimize belief entropy regarding the intruder’s identity, this module adjusts the Spatio-Motor Module to temporarily invert its preferences. This interaction generates a curiosity-driven approach behavior that directly competes with the pragmatic drive for safety.

The model’s core dynamics emerge from the resolution of this conflict. To illustrate, we consider a typical behavioral episode (Figure 3):

Investigation: The agent begins sheltered with high uncertainty (Figure 3A; time course up to the blue circle). The Threat Identification module, prioritizing epistemic value of the conspecific (Figures 3B,C), overrides the Spatio-Motor’s safety preferences, driving the agent to approach the caged mouse closer than it would under the Spatio-Motor module’s default shelter-seeking policy, to learn specifically about the caged mouse more effectively (Figure 3A; blue trajectory).

Identification: As the agent navigates closer, the precision of sensory observations increases (Figure 3A; blue trajectory to red circle). Once the Threat Identification module resolves the target’s identity with a confidence exceeding the classification threshold (Figure 3B), this belief is propagated to the Danger Context module.

Flight: Upon updating its belief to a “Danger” context, the Contextual module releases the epistemic override and amplifies the Spatio-Motor’s base preference for the shelter. With uncertainty resolved beyond the threshold, and safety prioritized, the agent executes a ballistic flight back to the shelter (Figure 3A; time from red circle to end). As the agent retreats and distance increases, sensory precision fades, causing the Threat Identification belief to rapidly decay back to baseline uncertainty (Figure 3B).

Crucially, the Danger Context module bridges this sensory gap by maintaining the “Danger” state, sustaining the ballistic flight even after the immediate evidence of threat has been lost (Figure 3C).

Note that while threshold-crossing triggers action from the Danger Context module, it can also transition to a danger state through its own temporal dynamics. Its slower timescale allows threat beliefs to accumulate even under ambiguous sensory evidence, enabling the model to simulate anxiety-like states that persist, and escapes that occur, without a clear relation to acute triggers.

Model captures the latent structure of empirical mouse behavior

We validated the model architecture by fitting model parameters to aggregate trajectories from experimental cohorts Methods Section 4.6) tracked via DeepLabCut (Mathis et al., 2018). Using Bayesian optimization (with the Optuna toolbox (Akiba et al., 2019), which uses Tree-Structured Parzen Estimator (Watanabe, 2025)], we minimized a composite loss function comparing simulated versus observed behavior across aggregate metrics: shelter occupancy, social investigation duration, spatial transitions, exploratory diversity (spatial entropy), and immobility proportion. Due to time and computational limitations, a representative library of agents was generated and uniquely matched to empirical data of individual mice.

As a baseline for performance, we compared the fitted model against a stochastic null model (random walk) (Figures 4A,B). While the random walk failed to replicate the structured occupancy and transition patterns characteristic of the experimental subjects, the fitted model’s output closely recapitulated empirical distributions across all analyzed metrics. Even with the limitations of the matching process, the fitting yielded sub-sigma accuracy for the majority of the cohort, with a median of 0.56 σ, indicating that the simulated agents are statistically indistinguishable from the experimental subjects. Importantly, this fitting operated exclusively on aggregate behavioral metrics. The path-level motifs shown in Figure 5 emerge as independent, unfitted consequences of the model’s generative dynamics.

To further contextualize model performance, we compared the fitted model against ablated variants and alternative model classes (Figure 4D; see Supplementary Section 1.2 for details). Removing modules systematically increased fit error, indicating that multiple interacting modules are required to capture the observed behavioral structure. While a Lévy walk baseline achieved comparable performance with slightly lower error for one phenotype, it lacks an interpretable decomposition of behavior. In contrast, hidden Markov models exhibited consistently poorer fits.

Behavioral regimes emerge from the heterarchical model

The heterarchical model captures a broad spectrum of mouse individual variability by generating distinct behavioral regimes. These regimes are not pre-programmed but emergent, allowing the model to fit individual differences across a population.

Behavioral phenotypes

We demonstrate the model’s flexibility by fitting it to exemplary behavioral phenotypes from mice at two extremes of the behavioral spectrum, with other individuals falling between these poles:

The “Curious” Phenotype: Exhibits wide-ranging exploration and full-arena coverage

The “Anxious” Phenotype: Displays high shelter-dependency, with investigations rarely extending beyond the corridor

The model’s fit to example episodes of such mice at the extremes of the behavioral spectrum is shown in Figure 4C.

Behavioral motifs (sequential actions)

Within these overarching regimes, the model spontaneously generates recognizable, species-typical behavioral sequences as emergent consequences of belief-updating dynamics, for example:

Hesitation: Approaching the chamber followed by a localized retreat

Flight: Rapid, ballistic trajectories from the stimulus area directly back to the shelter

The model’s qualitative correspondence to these empirical examples (Figure 5) reflects the generative validity of the model, demonstrating that both stable individual traits and reactive defensive sequences can emerge from the proposed framework, without requiring path-level optimization or hand-coded rules.

Social defeat induces a parametric shift within the model

To quantify the computational impact of social defeat, we optimized the model parameters separately to fit the observed behavior of individual mice before and after their social encounters. By projecting these fits into a reduced parameter space (Figure 6A), we can visualize how the underlying decision-making variables change for each animal.

Defeat vs. control groups

In the defeat group, the model reveals a consistent, directional shift in parameter space following the aggressive encounter. While the starting points vary due to individual baseline differences, the net shift vectors for most defeated mice start in the same region of the parameter space and move in a similar direction, suggesting a common response to the experience is captured by the model.

In contrast, the control group exhibits a different pattern of movement within the parameter space. While these mice also show shifts between sessions, the net direction of these changes quantified by their “Trauma Vectors” are distinct from those observed in the defeat group (cosθ = −0.96, permutation test, p = 0.069, Mahalanobis d = 1.49) (Figure 6B). Given the small sample size (n = 7 and 6 for control and defeat groups respectively), the substantial Mahalanobis distance suggests a biologically relevant divergence in behavioral trajectories that may be underpowered at the standard alpha level (0.05). These shifts reflect differences between parameters fitted independently to pre- and post-defeat behavior, rather than online parameter updates within the agent. Importantly, these results likely capture meaningful behavioral patterns, given the robust parameter-identifiability we observed in a parameter-recovery analysis (Wilson and Collins, 2019) (see Supplementary Results 1.1, Supplementary Figure S1, Supplementary Methods 2.1). The behavioral consequences of social defeat can therefore be summarized as systematic changes in a low-dimensional set of inferred model parameters.

We further tested generalization across individuals using an independent dataset (N = 6, see Supplementary Methods 2.4 for an explanation of collected data). Without re-simulating, for each new subject, we selected the best-matching parameter set from the existing library under the same loss function. This library-based approach achieved a median error of 0.53σ, comparable to the original cohort (0.56σ), suggesting that a low-dimensional parameter manifold derived from a small set of individuals is sufficient to explain behavioral variability in unseen animals.

Inter-individual differences

Finally, we leveraged this independent dataset to examine individual differences in defeat response. In the original defeat cohort (n = 6), we noticed that defeated animals segregated into susceptible and resilient subgroups based purely on behavioral change scores (Δt_shelter − Δt_investigating). In model parameter space, this separation is visible along a small number of dimensions, most prominently threat aversion (k_threat; Cohen’s d = 8.16), with no overlap between groups (susceptible: 1.20–1.38; resilient: 0.41–0.57). The separation was conserved in the independent dataset: a simple threshold classifier on k_threat (threshold = 0.883), derived from the original cohort, classifies all individuals in the independent dataset correctly. To further characterize this distinction, we recomputed Trauma Vectors on the combined dataset (original + independent cohorts). Susceptible and resilient mice exhibit near-parallel displacement vectors in parameter space (cosine = 0.932), both strongly opposed to control trajectories (cosine ≈ − 0.98). This geometry indicates that susceptibility does not reflect a qualitatively different computational response to defeat, but rather a quantitative difference in its magnitude.

Together, these analyses show that the behavioral consequences of social defeat can be summarized as systematic, low-dimensional shifts in identifiable model parameters that are generalisable across individuals, and predictive of meaningful phenotypic differences.

Simulated optogenetics on model can recreate findings on dynamic encoding of social threat in VMHvl

Next, we simulated the effects of optogenetic VMHvl stimulation. This analysis serves three purposes. First, it tests the model’s ability to capture the neural circuit-level adaptations observed after social defeat as changes in latent belief. Second, it illustrates how the model’s predictions can constrain the space of candidate hypotheses. Third, it shows how the model can inform the design of future experiments that discriminate between these candidates.

Previous experiments (Krzywkowski et al., 2020) demonstrate that this stimulation triggers robust escape in defeated mice but not in naive controls, indicating a state-dependent gating mechanism. We hypothesize the Danger Context module parallels the VMH in function, and modeled optogenetic intervention as an exogenous bias on this module toward a Danger state. In contrast to social defeat, which is represented here as an offline difference in fitted parameters, optogenetic stimulation is modeled as an explicit online perturbation to the model.

While multiple hypotheses could plausibly account for defeat-induced sensitization, we focus here on a small set to illustrate both the predictive utility and the falsifiability of the model. We tested three hypotheses:

Sensitization to danger (“Model S”): Defeat sensitizes the Danger module to input from the Threat module. It increases the spatial range over which social stimuli are treated as potentially dangerous, effectively lowering the distance threshold at which “ Danger ” evidence is accumulated.

Biased Identity Priors (“Model T”): Defeat increases the prior probability that the social target is a threat (hypervigilance in Threat Identification).

Biased Context Priors (“Model D”): Defeat increases the prior probability that the environment itself is unsafe (persistent risk in Danger Context).

Under baseline pre-defeat parameters, in silico optogenetic stimulation failed to elicit flight in any model, mirroring biological controls (Figure 7A). After applying parameter shifts optimized to fit the statistical distribution of empirical post-defeat behavior, both Model T and Model D reproduced the elevated flight rates observed in defeated mice under optogenetic stimulation (Figure 7B).

Model S, by contrast, did not alter the model’s optogenetic response under the conditions tested, in both pre- and post-defeat states (Figures 7A,B). Although expanded threat generalization is a behaviorally plausible consequence of defeat, in the experimental configuration used here the relevant social interactions occur at distances where this manipulation does not change the inferred state. As a result, increasing the spatial range of danger sensitivity alone produces no effect on the efficacy of VMHvl stimulation.

These results demonstrate a form of constrained computational degeneracy: multiple hypotheses can account for the defeat state-dependent impact of VMHvl stimulation, but of those tested, only modified social identity or environmental danger priors (models T and D) are expressed in these conditions. In the Discussion Section 3.3, we discuss how to experimentally differentiate between these two hypotheses.

4. Discussion

A computational account of social defeat

Social defeat is associated with divergent behavioral outcomes following similar aggressive encounters, ranging from social avoidance to preserved social engagement. Our model reproduces these behaviors (Figure 5) and represents individual differences as variation within its parameter space (Figure 6A), while remaining interpretable by mapping behavior onto cognitive parameters like inferred danger, current assessment of threat, and preferences for sensory stimuli.

Specifically, the model indicates that, relative to controls, defeated animals show a lower threshold for committing to threat-related inferences of social cues consistent with increased anxiety (Henriques-Alves and Queiroz, 2016; Kinsey et al., 2007), and a stronger bias toward shelter-seeking behavior (Magara et al., 2015) (Figure 6). The difference in directionality between inferred parameters of defeated and control mice, and substantial Mahalanobis distance (d = 1.49) support biological relevance, though larger cohorts are needed for robustness. Parameter recovery analyses demonstrate that these parameters are reliably identified and hence can be interpreted (details in Supplementary Section 1.1, Supplementary Figure S1). The emergence of species-typical behavioral sequences (flights, hesitations, investigation bouts) without any trajectory-level fitting further supports the claim that the model captures the computational logic of defensive decision-making, rather than merely achieving a high-fidelity fit to observed statistics. Systematic comparison against reduced model variants and alternative baselines corroborates this interpretation: ablating individual modules produces specific, architecturally predictable failures that cannot be remedied by parameter tuning, while statistical models matching or exceeding the active inference model in parsimony fail to reproduce extreme behavioral phenotypes or offer any mechanistic explanation. The model’s advantage thus lies not in fitting flexibility per se, but in the mechanistic constraints its architecture imposes on behavior.

Extending this analysis, comparisons between defeated, susceptible, and resilient individuals indicate that these groups do not diverge along distinct computational axes. Instead, their Trauma Vectors are closely aligned, with both opposing control vectors, implying a shared underlying response to defeat. Susceptibility therefore appears to reflect the magnitude, rather than the direction, of this shift, with susceptible animals exhibiting larger displacements along a common axis in parameter space. This suggests that individual variability arises from graded differences in the intensity of a conserved computational adaptation, rather than qualitatively distinct strategies.

This degree of interpretable variability distinguishes the approach from existing models, which either characterize what the system does without explaining why specific policies emerge (Mathis et al., 2018; Wiltschko et al., 2015; Wiltschko et al., 2020; Goodwin et al., 2024; Bordes et al., 2023; Rahy et al., 2022; Alfieri et al., 2022), or explain the policies without characterizing inter-individual variability and low-level behavioral dynamics (e.g., movement) (Shen and Dayan, 2025).

Pose-estimation and clustering pipelines [e.g., DeepLabCut (Mathis et al., 2018), MoSeq (Wiltschko et al., 2015; Wiltschko et al., 2020), DeepOF (Bordes et al., 2023), SimBA (Goodwin et al., 2024)] have improved phenotyping resolution considerably, but register behavioral differences without assigning them to separable computational sources. Detecting that defeated animals spend more time near shelter says nothing about which component of the decision process changed, or what would happen if that component were experimentally perturbed.

Neural circuit models (e.g., Alfieri et al., 2022; Rahy et al., 2022) offer a complementary level of description to our model, constraining synaptic weights to reproduce population-level response profiles. Our model operates at a higher level of abstraction and the two approaches could in principle be linked. The key distinctions for present purposes are that the circuit models considered here do not generate spatial trajectories, and do not represent individual variation as structure in a low-dimensional cognitive-variable space.

RL approach-avoidance models are normative, and have been used to extract interpretable parameters from discrete-choice or simple operant tasks (Zorowitz et al., 2020; Mkrtchian et al., 2017; Spiegler et al., 2020). Nonetheless, because standard RL operates over expected values without explicitly representing beliefs or perceptual uncertainty, its parameters are aggregate input–output mappings rather than decompositions into separable processing stages. A shift in punishment learning rate is formally consistent with altered sensory discrimination, altered threat encoding, or altered motor policy.

The closest normative antecedent to our model is the BAMDP (Shen and Dayan, 2025), which captures individual differences in risk-sensitive exploration via interpretable hazard-prior and risk-sensitivity parameters. Our model differs in three respects relevant here: the BAMDP requires behavioral states to be pre-specified and hand-coded before fitting; it does not generate spatial trajectories; and so, it does not allow generation of testable predictions of behavior and their neural correlates in parallel.

Neural implementation

The modular architecture suggests putative circuit correspondences (Gross and Canteras, 2012). The output of the Spatio-Motor module could align with evolutionarily conserved structures in the brainstem, such as the periacqueductal gray (PAG), required for the execution of instinctive defensive motor patterns (Gross and Canteras, 2012; Masferrer et al., 2020; Reis et al., 2023). The Danger Context module may parallel hypothalamic, in particular VMH, involvement in encoding threat imminence and internal defensive state (Silva et al., 2013; Masferrer et al., 2020; Wang et al., 2015), consistent with defeat-induced potentiation of VMH responses and gating of escape behavior (Krzywkowski et al., 2020). The Threat Identification module could correspond to the medial amygdala (MeA), given its role in processing socially relevant chemosensory cues and differentiating threat-related from neutral stimuli (Li et al., 2017; Bergan et al., 2014).

If this mapping is approximately correct, the model predicts that selectively disrupting Medial or Posterior Amygdala (MeA/PA) projections to VMH would cause impaired social threat identification (Wei et al., 2023), while leaving defensive response execution intact. In this scenario, defensive motor programs would remain intact but would be less reliably or appropriately engaged due to degraded upstream threat signaling, rather than a failure of downstream motor execution. This interpretation remains tentative, as both the proposed circuit correspondences and the division of labor between identification, contextual modulation, and execution within these regions are incompletely resolved. Further work is required to determine which defensive responses would be preserved, the conditions under which they would be triggered, and how such manipulations would affect responses to non-olfactory cues and non-social threats, or whether parallel amygdalo–hypothalamic or cortical pathways could compensate for loss of MeA input. Addressing these issues will be essential for determining the specificity and limits of the proposed mapping.

Experimental predictions for neurostimulation

To illustrate the model’s capability of capturing the neural plasticity observed in social defeat, we first narrowed a broader hypothesis space to mechanisms that reproduce the observed state-dependent effects of optogenetic VMH stimulation. In doing so, we excluded the hypothesis that the danger-assessing module is sensitized to input from the threat-assessment module after social defeat.

We were left with two defeat-induced modification hypotheses: biased identity priors (“Model T”) and biased contextual priors (“Model D”). We then examined how these distinct defeat-induced modifications account for the experimental results observed in defeated animals (Krzywkowski et al., 2020). Both hypotheses reproduce the defensive behaviors observed experimentally in the presence of subordinate conspecifics.

Therefore, our model demonstrates that the two hypotheses are currently computationally degenerate under the conditions tested. As an illustration of the model’s predictive utility, we propose a test to distinguish between them: VMH stimulation in defeated mice in the absence of a conspecific altogether. Model D predicts escape behavior, driven by activation of a generalized danger state, whereas Model T predicts little or no response, as no ambiguous social stimulus is available for classification.

The outcome of this experiment would help reveal whether defeat reorganizes defensive behavior at the level of social inference or through a global shift in threat state. Although alternative explanations may exist, here we deliberately focus on these two mechanistically distinct hypotheses as a minimal and illustrative test case.

Limitations and future directions

The model omits several ethologically important phenomena of defensive behavior: thigmotaxis (Simon et al., 1994), social buffering (Kiyokawa et al., 2004; Langford et al., 2006), context-dependent fear responses (Klemenhagen et al., 2006), habituation (Thompson and Spencer, 1966), and broader defensive repertoires including stretch-attend postures (Blanchard, 2018; Yang et al., 2004); to name a few. Behavior is modeled through centroid trajectories only, omitting postural and kinematic features. Many such features could be incorporated through model extensions like additional state factors and expanded observations.

While the present model offers a viable explanation for defensive behavior, alternative hypotheses can currently not be ruled out for several reasons. First, we evaluate limited model variants. Broader exploration of alternative architectures, learning rules, and parameter ranges is needed for model identifiability in future work. Second, the framework has so far been applied to a single paradigm, without incorporating concurrent neural recordings, limiting validation of the proposed circuit mappings. Even within the social defeat paradigm, the modest sample size (n = 13 in the main dataset) and marginal group significance (p = 0.069) underscore the need for larger cohorts to confirm computational signatures of defeat. Finally, although the current parameter optimization fits the empirical data, it admits multiple behaviorally equivalent solutions, which precludes circuit-level inference. In principle, more rigorous, module-specific parameter updates could instead generate testable hypotheses about the neural circuits involved in defeat-induced plasticity.

Future work should also incorporate neural recordings to validate belief state mappings, expand to richer behavioral measures, and test the framework across multiple paradigms and species. For example, the modeling principles could apply to individual differences in trauma response, underlying vulnerability and resilience to post-traumatic psychopathology (Pitman et al., 2012). By representing defeat-induced changes as shifts in interpretable computational parameters, this framework may offer a formal language for describing such differences. While highly speculative, this raises the possibility that analogous parameters could eventually be estimated from human behavior.

Broader applicability

The modular architecture allows extension to other behavioral domains (e.g., foraging (Clemente and Penacchio, 2025); social interaction via theory-of-mind–like inference) with relatively limited modification, and could serve as a foundation for a general model of mouse behavior. Such a model would enable systematic generation of testable hypotheses, support principled comparison across experimental paradigms, and reduce the need for exhaustive empirical exploration by narrowing the space of plausible behavioral mechanisms.

Normative and active inference–based generative models using the principles demonstrated here have also been applied to other naturalistic behaviors in rodents and other systems like ant colonies, illustrating the broader utility of this class of models (Van de Maele et al., 2024; Mannella et al., 2021; Friedman et al., 2021). The modular architecture demonstrated in this work could help such models generalize further to describe more kinds of ecological behaviors, while still maintaining interpretability.

Conclusion

This work demonstrates that normative models can capture naturalistic defensive behavior while maintaining interpretability. By framing effects of social defeat as a parameter shift to an animal’s internal generative model, we unify behavioral dynamics, individual variability, and circuit-level hypotheses. The modular architecture shows how shared principles can generate diverse defensive behaviors. It provides a foundation for studying how adverse experience reshapes the computations underlying social decision-making, and for future extensions generalizing the framework across tasks.

Statements

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Funding

The author(s) declared that financial support was received for this work and/or its publication. This work was supported by the European Molecular Biology Laboratory (EMBL) and by the European Union under the Horizon Europe programme throug h a Marie Skłodowska-Curie Actions Postdoctoral Fellowship SOCIALPLAST (grant agreement No. 101151030, awarded to V.M.) and a European Research Council (ERC) Advanced Grant TERRITORY (grant agreement No. 101097411, awarded to C.T.G.)

Data availability

The raw data supporting the conclusions of this article is available at https://zenodo.org/records/20493653. All custom code used for modeling and analysis is available on GitHub at: https://github.com/hridaik/social-defeat.

Ethics approval

The animal study was approved by the European Molecular Biology Laboratory Animal Use Committee and the Italian Ministry of Health (Approval number: 183/2024-PR). The study was conducted in accordance with the local legislation and institutional requirements.

Author contributions

HK: Project administration, Validation, Formal analysis, Data curation, Methodology, Visualization, Conceptualization, Software, Investigation, Writing – original draft, Writing – review & editing. VM: Data curation, Methodology, Investigation, Writing – review & editing. LF: Data curation, Methodology, Investigation, Writing – review & editing. CG: Methodology, Project administration, Supervision, Writing – review & editing, Funding acquisition, Resources. RB: Project administration, Funding acquisition, Resources, Supervision, Formal analysis, Writing – review & editing, Conceptualization, Methodology, Writing – original draft.

Acknowledgements

We thank Flàvia Ferrús Marimón, Akira Kawano, and Sofija Perovic for their helpful comments and suggestions on earlier drafts of this manuscript.

References

  1. Akiba T., Sano S., Yanase T., Ohta T., Koyama M. (2019). Optuna: a next-generation hyperparameter optimization framework. arXiv. doi: doi:10.48550/arXiv.1907.10902
  2. Alfieri V., Mattera A., Baldassarre G. (2022). Neural circuits underlying social fear in rodents: an integrative computational model. Front. Syst. Neurosci. 16: 841085. doi:, doi:10.3389/fnsys.2022.841085
  3. Bergan J. F., Ben-Shaul Y., Dulac C. (2014). Sex-specific processing of social cues in the medial amygdala. eLife 3: e02743. doi:, doi:10.7554/eLife.02743
  4. Blanchard D. C. (2018). Risk assessment: at the interface of cognition and emotion. Curr. Opin. Behav. Sci. 24, 69 – 74. doi:, doi:10.1016/j.cobeha.2018.03.006
  5. Bordes J., Miranda L., Reinhardt M., Narayan S., Hartmann J., Newman E. L.. (2023). Automatically annotated motion tracking identifies a distinct social behavioral profile following chronic social defeat stress. Nat. Commun. 14: 4319. doi:, doi:10.1038/s41467-023-40040-3
  6. Clemente A., Penacchio O. (2025). Hedonic foraging: from reward to action. bioRxiv. doi: doi:10.1101/2025.05.04.652128
  7. Dall S. R. X., Giraldeau L. A., Olsson O., McNamara J. M., Stephens D. W. (2005). Information and its use by animals in evolutionary ecology. Trends Ecol. Evol. 20, 187 – 193. doi:, doi:10.1016/j.tree.2005.01.010
  8. Franklin T. B., Silva B. A., Perova Z., Marrone L., Masferrer M. E., Zhan Y.. (2017). Prefrontal cortical control of a brainstem social behavior circuit. Nat. Neurosci. 20, 260 – 270. doi:, doi:10.1038/nn.4470
  9. Friedman D. A., Tschantz A., Ramstead M. J. D., Friston K., Constant A. (2021). Active Inferants: an active inference framework for ant Colony behavior. Front. Behav. Neurosci. 15: 647732. doi:, doi:10.3389/fnbeh.2021.647732
  10. Friston K., Da Costa L., Sajid N., Heins C., Ueltzhöffer K., Pavliotis G. A.. (2023). The free energy principle made simpler but not too simple. Phys. Rep. 1024: 10241. doi: doi:10.1016/j.physrep.2023.07.001
  11. Golden S. A., Covington H. E., Berton O., Russo S. J. (2011). A standardized protocol for repeated social defeat stress in mice. Nat. Protoc. 6, 1183 – 1191. doi:, doi:10.1038/nprot.2011.361
  12. Goodwin N. L., Choong J. J., Hwang S., Pitts K., Bloom L., Islam A.. (2024). Simple behavioral analysis (SimBA) as a platform for explainable machine learning in behavioral neuroscience. Nat. Neurosci. 27, 1411 – 1424. doi:, doi:10.1038/s41593-024-01649-9
  13. Gross C. T., Canteras N. S. (2012). The many paths to fear. Nat. Rev. Neurosci. 13, 651 – 658. doi:, doi:10.1038/nrn3301
  14. Heins C., Millidge B., Demekas D., Klein B., Friston K., Couzin I.. (2022). Pymdp: a Python library for active inference in discrete state spaces. JOSS 7: 4098. doi: doi:10.21105/joss.04098
  15. Henriques-Alves A. M., Queiroz C. M. (2016). Ethological evaluation of the effects of social defeat stress in mice: beyond the social interaction ratio. Front. Behav. Neurosci. 9: 364. doi:, doi:10.3389/fnbeh.2015.00364
  16. Ike K. G. O., de Boer S. F., Buwalda B., Kas M. J. H. (2020). Social withdrawal: an initially adaptive behavior that becomes maladaptive when expressed excessively. Neurosci. Biobehav. Rev. 116, 251 – 267. doi:, doi:10.1016/j.neubiorev.2020.06.030
  17. Iñiguez S. D., Riggs L. M., Nieto S. J., Dayrit G., Zamora N. N., Shawhan K. L.. (2014). Social defeat stress induces a depression-like phenotype in adolescent male c57BL/6 mice. Stress 17, 247 – 255. doi:, doi:10.3109/10253890.2014.910650
  18. Kacelnik A., Bateson M. (1996). Risky theories—the effects of variance on foraging decisions. Am. Zool. 36, 402 – 434. doi: doi:10.1093/icb/36.4.402
  19. Kinsey S. G., Bailey M. T., Sheridan J. F., Padgett D. A., Avitsur R. (2007). Repeated social defeat causes increased anxiety-like behavior and alters splenocyte function in C57BL/6 and CD-1 mice. Brain Behav. Immun. 21, 458 – 466. doi:, doi:10.1016/j.bbi.2006.11.001
  20. Kiyokawa Y., Kikusui T., Takeuchi Y., Mori Y. (2004). Partner’s stress status influences social buffering effects in rats. Behav. Neurosci. 118, 798 – 804. doi:, doi:10.1037/0735-7044.118.4.798
  21. Klemenhagen K. C., Gordon J. A., David D. J., Hen R., Gross C. T. (2006). Increased fear response to contextual cues in mice lacking the 5-HT1A receptor. Neuropsychopharmacology 31, 101 – 111. doi:, doi:10.1038/sj.npp.1300774
  22. Krzywkowski P., Penna B., Gross C. T. (2020). Dynamic encoding of social threat and spatial context in the hypothalamus. eLife 9: e57148. doi:, doi:10.7554/eLife.57148
  23. Langford D. J., Crager S. E., Shehzad Z., Smith S. B., Sotocinal S. G., Levenstadt J. S.. (2006). Social modulation of pain as evidence for empathy in mice. Science 312, 1967 – 1970. doi:, doi:10.1126/science.1128322
  24. Li Y., Mathis A., Grewe B. F., Osterhout J. A., Ahanonu B., Schnitzer M. J.. (2017). Neuronal representation of social information in the medial amygdala of awake behaving mice. Cell 171, 1176 – 1190.e17. doi:, doi:10.1016/j.cell.2017.10.015
  25. Lima S. L., Dill L. M. (1990). Behavioral decisions made under the risk of predation: a review and prospectus. Can. J. Zool. 68, 619 – 640. doi: doi:10.1139/z90-092
  26. Magara S., Holst S., Lundberg S., Roman E., Lindskog M. (2015). Altered explorative strategies and reactive coping style in the FSL rat model of depression. Front. Behav. Neurosci. 9: 89. doi:, doi:10.3389/fnbeh.2015.00089
  27. Mannella F., Maggiore F., Baltieri M., Pezzulo G. (2021). Active inference through whiskers. Neural Netw. 144, 428 – 437. doi:, doi:10.1016/j.neunet.2021.08.037
  28. Masferrer M. E., Silva B. A., Nomoto K., Lima S. Q., Gross C. T. (2020). Differential encoding of predator fear in the ventromedial hypothalamus and periaqueductal Grey. J. Neurosci. 40, 9283 – 9292. doi:, doi:10.1523/JNEUROSCI.0761-18.2020
  29. Mathis A., Mamidanna P., Cury K. M., Abe T., Murthy V. N., Mathis M. W.. (2018). DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nat. Neurosci. 21, 1281 – 1289. doi:, doi:10.1038/s41593-018-0209-y
  30. Mkrtchian A., Aylward J., Dayan P., Roiser J. P., Robinson O. J. (2017). Modeling avoidance in mood and anxiety disorders using reinforcement learning. Biol. Psychiatry 82, 532 – 539. doi:, doi:10.1016/j.biopsych.2017.01.017
  31. O’Connell R. G., Shadlen M. N., Wong-Lin K., Kelly S. P. (2018). Bridging neural and computational viewpoints on perceptual decision-making. Trends Neurosci. 41, 838 – 852. doi:, doi:10.1016/j.tins.2018.06.005
  32. Parr T., Pezzulo G., Friston K. J. (2022). Active Inference: The Free Energy Principle in Mind, Brain, and Behavior. Cambridge: The MIT Press.
  33. Pezzulo G., Parr T., Friston K. (2024). Active inference as a theory of sentient behavior. Biol. Psychol. 186: 108741. doi:, doi:10.1016/j.biopsycho.2023.108741
  34. Pitman R. K., Rasmusson A. M., Koenen K. C., Shin L. M., Orr S. P., Gilbertson M. W.. (2012). Biological studies of post-traumatic stress disorder. Nat. Rev. Neurosci. 13, 769 – 787. doi:, doi:10.1038/nrn3339
  35. Rahy R., Asari H., Gross C. T. (2022). Sensory-thresholded switch of neural firing states in a computational model of the ventromedial hypothalamus. Front. Comput. Neurosci. 16: 964634. doi:, doi:10.3389/fncom.2022.964634
  36. Reis F. M. C. V., Mobbs D., Canteras N. S., Adhikari A. (2023). Orchestration of innate and conditioned defensive actions by the periaqueductal gray. Neuropharmacology 228: 109458. doi:, doi:10.1016/j.neuropharm.2023.109458
  37. Shen T., Dayan P. (2025). Individual differences in tail risk sensitive exploration using Bayes-adaptive Markov decision processes. eLife 13: RP100366. doi:, doi:10.7554/eLife.100366
  38. Silva B. A., Mattucci C., Krzywkowski P., Murana E., Illarionova A., Grinevich V.. (2013). Independent hypothalamic circuits for social and predator fear. Nat. Neurosci. 16, 1731 – 1733. doi:, doi:10.1038/nn.3573
  39. Simon P., Dupuis R., Costentin J. (1994). Thigmotaxis as an index of anxiety in mice. Influence of dopaminergic transmissions. Behav. Brain Res. 61, 59 – 64. doi:, doi:10.1016/0166-4328(94)90008-6
  40. Slavich G. M. (2020). Social safety theory: a biologically based evolutionary perspective on life stress, health, and behavior. Annu. Rev. Clin. Psychol. 16, 265 – 295. doi:, doi:10.1146/annurev-clinpsy-032816-045159
  41. Smith R., Friston K. J., Whyte C. J. (2022). A step-by-step tutorial on active inference and its application to empirical data. J. Math. Psychol. 107: 102632. doi:, doi:10.1016/j.jmp.2021.102632
  42. Spiegler K. M., Palmieri J., Pang K. C. H., Myers C. E. (2020). A reinforcement-learning model of active avoidance behavior: differences between Sprague Dawley and Wistar-Kyoto rats. Behav. Brain Res. 393: 112784. doi:, doi:10.1016/j.bbr.2020.112784
  43. Sureka R., Natale S., Deb S., Avincola D., Gross C. T. (2025). Immediate early genes act in the medial hypothalamus to promote adaptation to social defeat. bioRxiv. doi: doi:10.1101/2025.09.09.675209
  44. Thompson R. F., Spencer W. A. (1966). Habituation: a model phenomenon for the study of neuronal substrates of behavior. Psychol. Rev. 73, 16 – 43. doi:, doi:10.1037/h0022681
  45. Van de Maele T., Dhoedt B., Verbelen T., Pezzulo G. (2024). A hierarchical active inference model of spatial alternation tasks and the hippocampal-prefrontal circuit. Nat. Commun. 15: 9892. doi:, doi:10.1038/s41467-024-54257-3
  46. Wang L., Chen I. Z., Lin D. (2015). Collateral pathways from the ventromedial hypothalamus mediate defensive behaviors. Neuron 85, 1344 – 1358. doi:, doi:10.1016/j.neuron.2014.12.025
  47. Watanabe S. (2025). Tree-structured parzen estimator: understanding its algorithm components and their roles for better empirical performance. arXiv. doi: doi:10.48550/arXiv.2304.11127
  48. Wei J., Han Q., Luo Z., Liu L., Cui J., Tan J.. (2023). Amygdala neural ensemble mediates mouse social investigation behaviors. Natl. Sci. Rev. 10: nwac179. doi:, doi:10.1093/nsr/nwac179
  49. Wilson R. C., Collins A. G. (2019). Ten simple rules for the computational modeling of behavioral data. eLife 8: e49547. doi:, doi:10.7554/eLife.49547
  50. Wiltschko A. B., Johnson M. J., Iurilli G., Peterson R. E., Katon J. M., Pashkovski S. L.. (2015). Mapping sub-second structure in mouse behavior. Neuron 88, 1121 – 1135. doi:, doi:10.1016/j.neuron.2015.11.031
  51. Wiltschko A. B., Tsukahara T., Zeine A., Anyoha R., Gillis W. F., Markowitz J. E.. (2020). Revealing the structure of pharmacobehavioral space through motion sequencing. Nat. Neurosci. 23, 1433 – 1443. doi:, doi:10.1038/s41593-020-00706-3
  52. Yang M., Augustsson H., Markham C. M., Hubbard D. T., Webster D., Wall P. M.. (2004). The rat exposure test: a model of mouse defensive behaviors. Physiol. Behav. 81, 465 – 473. doi:, doi:10.1016/j.physbeh.2004.02.010
  53. Zorowitz S., Momennejad I., Daw N. D. (2020). Anxiety, avoidance, and sequential evaluation. Comput Psychiatr. 4. doi:, doi:10.1162/cpsy_a_00026

Citation

Khurana, H. S., et al. (2026). Fleeing is believing: adaptive behavior under social threat as an inference process. Frontiers in Neural Circuits, Volume 20. https://doi.org/
Received
Accepted
Published
Volume
20 - 2026

Copyright

Copyright © 2026 Khurana, Mussetto, Ferrarese, Gross and Bufacchi.

License: https://creativecommons.org/licenses/by/4.0/

*Correspondence: Rory J. Bufacchi

Article metrics

Views
0
Downloads
0
Citations
0
Shares
0