Abstract
Antibiotic treatment is widely used for gastrointestinal diseases, often leading to drug resistance. However, the underlying mechanisms of drug resistance remain unclear. Mathematical modeling provides a powerful tool to explore the dynamics of antibiotic resistance, yet few models have considered the effect of biological noise, which originates from microscopic interactions between bacteria. In this study, we constructed a stochastic model based on the chemical master equations to investigate how stochastic noise influences the development of antibiotic resistance. Our simulations demonstrated that antibiotic resistance developed stepwise: while effective antibiotic treatments maintained the host’s total pathogen numbers at healthy levels, the compositional balance shifted significantly through progressive increases in resistant pathogen proportions. Stochastic noise further amplified this shift and accelerated resistance by exacerbating post-treatment changes in the sensitive-to-resistant pathogen ratio. Finally, we found that the presence of coupling between different microbial communities can delay the onset of resistance and might even prevent its development. These results highlight noise’s critical role in resistance development and suggest enhancing microbial interactions as a potential mitigation strategy.
Similar content being viewed by others
Introduction
The intestinal flora, comprising various microorganisms such as bacteria, fungi, and viruses, represents a major source of human genetic and metabolic diversity1. Approximately 100 trillion microorganisms inhabit the human intestine, roughly ten times the number of human cells2. The intestinal flora and the host engage in intimate interactions, encompassing nutrient metabolism, immune regulation, neural transmission, etc.3. Disruption of the stable intestinal flora may lead to diseases such as necrotizing enterocolitis in preterm infants, inflammatory bowel disease, autoimmune diseases, type 2 diabetes, and obesity4. Antibiotics, as the standard drugs for treating various diseases, have been widely used in clinical practice due to their convenience and rapid effectiveness. Standard antibiotic treatment aims to maximize treatment efficacy and minimize side effects, but often overlooks long-term consequences such as the emergence of antibiotic resistance5,6,7,8,9. For example, since the 1980s, with the widespread use of broad-spectrum cephalosporins, clinical isolates of Escherichia coli have shown resistance to β-lactams and fluoroquinolones10. Infections caused by antibiotic-resistant organisms due to excessive antibiotic use have become one of the most pressing health challenges of the 21st century11.
Stochastic noise is an intrinsic feature of microbial community systems, arising from various sources such as nutrient competition12, spatial competition13, the effects of antimicrobial substances14,15, and antibiotic stress16. Experimental evidence revealed that, beyond deterministic processes (e.g., interspecies interactions and environmental conditions), stochastic phenomena like birth, death, colonization, extinction, and speciation significantly influenced microbial community composition16,17,18,19,20,21,22.
Mathematical modeling offers a powerful framework for deciphering microbiota dynamics, and the critical role of stochastic noise in shaping microbial structures has received increasing attention23,24,25. For instance, E. Brigatti et al. introduced a neutral model incorporating demographic noise, which accurately captured the log-growth rate distributions in gut microbiota, emphasizing the value of stochastic modeling for understanding microbial dynamics23. Similarly, Lana et al. demonstrated that integrating stochastic noise into a generalized Lotka-Volterra model successfully replicates the properties observed in experimental microbial time series24. Additionally, Román Zapién-Campos constructed a mathematical model featuring stochastic colonization of hosts to illustrate the effects of ecological drift and limited host lifespan25.
Despite these advances, the role of stochastic noise in the development of antibiotic resistance remains inadequately explored. While prior models have addressed pivotal questions, such as the emergence of antibiotic resistance26, the impact of microbial fitness27, antibiotic tolerance28, and optimization of treatment protocols29, these largely focused on species-specific ecological interactions within the host. Meanwhile, numerous theoretical studies indicated that stochastic noise can introduce distinct dynamics absent in deterministic models. These included population extinction30, varied distributions of microbial abundances31, stochastic transient states capable of persisting over extended periods19, and stability transitions32. Therefore, we aim to explore the role of stochastic noise on the development of antibiotic resistance.
Xiaxia Kang and colleagues built a three-variable ODE model (1) to provide an ingenious explanation for the development of drug-resistance33.
In their model, intestinal microbiota were divided into three categories (Fig. 1): sensitive pathogens (PS), resistant pathogens (PT) and probiotics(B). In the model, a logistic equation was introduced to describe the growth patterns of each type of bacteria under limited resources, and each type of bacteria underwent natural death. Interspecies inhibition between pathogens and probiotics was depicted using a monotonically increasing Hill function. In addition, ηi (i = 1, 2, 3) represented the effect of antibiotics on the bacteria, where η2 > η1 indicated a higher killing rate for sensitive pathogens. This deterministic model showed that each antibiotic treatment altered the proportion of sensitive pathogens and resistant pathogens in the gut, and the accumulation of these changes triggered drug-resistance. Critically, the model assumed identical reaction rates for sensitive and resistant pathogens, an assumption central to its resistance mechanism but biologically unrealistic, as strain-specific parameter differences inevitably exist despite phenotypic similarities.
All bacteria exhibit logistic growth. Probiotics and pathogens mutually inhibit each other. The figure is adapted from33. ηi (i = 1, 2, 3) represents the effect of antibiotics on the bacteria. η2 > η1, indicating that antibiotics are more effective against sensitive pathogens.
The chemical master equation (CME) can describe changes in the number of particles in stochastic processes. It has been applied in many dynamic models, including population growth models34, infectious disease models35, and gene regulatory network models36,37. The CME provides a detailed probabilistic framework that captures the inherent stochasticity in population changes, making it particularly useful for systems where random fluctuations play a significant role38. The abundance of some gut microbiota is relatively low39, yet their presence and fluctuations can have a significant impact on the overall balance of the gut microbiota and host health40,41. In such cases, it is more appropriate to use the chemical master equation to model these dynamics.
In this paper, we converted the above ODE model (1) into a stochastic version using the methods of chemical master equations. This stochastic model not only incorporated real noise into the system but also addressed the issue of identical reaction rates for sensitive and resistant bacteria present in the deterministic version. Additionally, we utilized the model to explore the impact of noise on the development of antibiotic resistance, focusing on (1) the dynamic progression of resistance within the stochastic framework, (2) key mechanistic differences between stochastic and ODE-based resistance emergence, (3) the relationship between noise intensity and resistance development rates.
Results
We applied the concept of the Chemical Master Equation (CME) to convert model (1) into a set of fundamental reactions, which described changes in the microbiota population (see “Methods” for details).
Elevated noise increases relapse risk at fixed treatment threshold
First, we used the CME model to describe the processes by which the host became infected and how antibiotic treatment restored the bacterial population to normal levels. Our simulations encompassed three system sizes (Ω = 2000, 5000, and 10,000; Fig. 2a–c), with critical thresholds determined from the reference ODE model33. The illness threshold (0.38Ω) was established as the pathogen level at which host symptoms manifest, triggering antibiotic initiation, while the treatment threshold (0.33 Ω) marked the point for therapy discontinuation. These quantitative thresholds were derived by mapping the ODE model’s temporal dynamics: 0.38 Ω corresponds to the pathogen abundance at symptom onset (3 days post-infection), and 0.33 Ω reflects the pathogen load after a standard 3-day treatment course. We also employed a bifurcation diagram to demonstrate that when the system reached the illness threshold (0.38 Ω), pathogen abundance would undergo further proliferation without timely therapeutic intervention (Supplementary Fig. 1a–c). Conversely, when antibiotic treatment reduced the pathogen load to the treatment threshold (0.33 Ω), the system could ultimately maintain the pathogen population at low levels (Supplementary Fig. 1d–f).
a–c Depicted the time evolution of pathogen numbers, normalized to Ω, during this process for Ω = 2000 (a), Ω = 5000 (b), and Ω = 10,000 (c), each showing 20 time-courses. The gray curve represented the pathogen number over time in the ODE model, while the red, cyan, and blue curves illustrated the infection, antibiotic-treatment, and recovery phases in the stochastic model, respectively. The inset figures showed the distribution of treatment durations across 10,000 simulations. d Demonstrated the probability of disease relapse following a single treatment at a fixed treatment threshold, based on the results of 10,000 simulations for each noise intensity level.
In Fig. 2a–c, the period from −7 to 0 days represents the healthy phase, during which the total pathogens in the body’s microbiota system remained at relatively low levels. The parameter rP represents the maximum growth rate of pathogens under normal conditions. To simulate active infection dynamics, we increased this parameter by 54% (from baseline rP to 1.54 rP), reflecting the enhancement of pathogen proliferation during host infection. Throughout the disease progression, this elevated growth rate drove significant pathogen expansion, ultimately leading to population levels exceeding the illness threshold. Then our simulation protocol initiated antibiotic treatment to mimic clinical intervention. The proliferation rate of pathogens (rP) returned to the normal level, and there was a rapid decrease in their total amount because of antibiotic effect ηi (i = 1, 2, 3). Once the number of pathogens fell to the treatment threshold, the medication was stopped. As the treatment ended, the system entered a self-recovery phase in which the number of pathogens further decreased due to interactions among three bacteria strains. In most cases, the number of pathogens eventually returned to a low level, which corresponded to the healthy state. However, if the random interactions between bacterial populations were more pronounced (Ω = 2000, Fig. 2a), the pathogens may rise again after a few days in some cases. Conversely, when Ω was large, the situation was more stable, and the host could almost always recover to a normal pathogen population, aligning closely with the results observed in the ODE model (Fig. 2c). Figure 2d quantified the noise-dependent relapse probability following single antibiotic therapy, revealing a direct correlation between stochasticity and relapse probability at fixed treatment threshold. This relationship was further contextualized by the time-to-threshold distributions (insets, Fig. 2a−c), which showed that elevated noise intensity delayed pathogen clearance to the treatment threshold (0.33 Ω), necessitating prolonged antibiotic exposure to achieve normal level.
The results demonstrated that elevated noise intensity (lower Ω) significantly increased the probability of post-treatment relapse, as pathogen populations were more likely to rebound beyond illness threshold. This necessitated extended antibiotic regimens to prevent resurgence.
Antibiotic-resistance emerges following iterative “infection-treatment-recovery” cycles
Antibiotic resistance is the phenomenon where bacteria evolves to become resistant to antibiotics after several treatments, rendering these medications less effective over time. The previous deterministic system (1) revealed a continuous line of steady states (correspond to health state with fixed total pathogens but varying resistance ratios). This line-shaped steady states ensured total pathogen recovery after antibiotic-treatment, but with altered population composition. Accumulated infection-treatment-recovery cycles drove progressive selection for resistant strains until their dominance, culminating in resistance. However, this resistance mechanism assumed identical reaction rates for sensitive and resistant pathogens, biologically similar yet never fully equivalent. The CME model naturally incorporates stochasticity, allowing for differential reaction rates between strains. We therefore investigated whether antibiotic resistance could emerge and analyzed its underlying dynamical mechanism in CME model.
We established iterative “infection-treatment-recovery” cycles with three defined phases: (1) infection progression until pathogen loads reached the illness threshold (0.38 Ω), (2) antibiotic treatment until pathogen reduction to the treatment threshold (0.33 Ω), followed by (3) a 120-day recovery period. After successful recovery (pathogens sustained below 0.38 Ω), the system automatically initiated a new cycle following this 120-day interval, simulating clinical re-exposure scenarios. During recovery, pathogen resurgence above 0.38 Ω triggered immediate supplementary retreatment. We exhibited the temporal population dynamics of pathogens across successive infection-treatment-recovery cycles, with representative results shown for systems with Ω values of 2000 and 10,000 (Fig. 3a, b). The examples in Fig. 3a (Ω = 2000) and 3b (Ω = 10,000) demonstrated the characteristic progression of treatment outcomes across cycles. In the initial cycles (Fig. 3a), antibiotic intervention successfully reduced pathogen loads to illness threshold levels, enabling host recovery. However, by the 10th treatment cycle, pathogens could no longer be effectively suppressed, marking the emergence of drug resistance in this particular simulation. A similar progression was observed in the Ω = 10,000 case (Fig. 3b), with resistance developing by the 13th cycle in this example. This progression from effective treatment to resistance was a consistent feature across simulations, though the exact timing varied. The full statistical distribution of resistance emergence across 200 independent simulations was presented in the following section (Fig. 4), confirming the generality of these observations.
All the pathogen and probiotic numbers in the figure were normalized to Ω. a, b The time evolution of pathogen numbers during repeated infection-treatment-recovery cycles for Ω = 2000 (a) and Ω = 10,000 (b). The antibiotic failed in the 10th treatment and 13th treatment, respectively. The red, cyan, and blue curves represented the infection, antibiotic-treatment, and recovery courses, respectively. c, d The variations in the number of sensitive and resistant pathogens were observed through repeated infection-treatment-recovery cycles for Ω = 2000 (c) and Ω = 10,000 (d). The orange dot and black dots marked the initial state of the system and the pre-infection healthy states before each cycle. The green dashed line denoted the healthy state (steady state in ODE model). The arrows indicated the direction of the changes for sensitive and resistant pathogens with iterative “infection-treatment-recovery” cycles. e, f Stable distribution of sensitive pathogens, resistant pathogens and probiotics in the 3-dimensional space when Ω = 2000 (e) and Ω = 10,000 (f) at t = 1000 (days).
a–c Distribution of the number of effective antibiotic treatments at varying levels of noise intensity (Ω = 2000, 5000, and 10,000). The bars represented the distribution of effective treatment numbers in stochastic simulations. We used a green bar to indicate cases where resistance does not emerge even after 25 infections. The red dashed line represented the average number of infections leading to resistance in stochastic simulations (excluding cases where resistance does not emerge after 25 infections). The orange dashed line represented the number of effective treatment cycles in the deterministic model. d The time course of pathogens illustrating the development of drug resistance during the 5th treatment. Panel (e) presented the amount of sensitive and resistant pathogens prior to each infection cycle, corresponding to the scenario shown in Panel (d). f The diagram provided an example of a scenario where no drug resistance develops. The upper and lower panels demonstrated the changes in the number of sensitive and resistant pathogens with repeated treatments, respectively. The red, cyan, and blue curves represented the infection, antibiotic-treatment, and recovery courses, respectively. All microbial populations shown in the figure were normalized to Ω.
We further investigated the variation in pathogen composition across sequential infection-treatment-recovery cycles (Fig. 3c, d). The phase diagrams marked the pre-infection healthy states within the sensitive-resistant pathogen coordinate system (black dots), with arrows indicating the sequential progression of “infection-treatment-recovery” cycles. Notably, after each complete cycle, the system reached a different healthy state, yet these states aligned linearly (marked by the green dashed line, the steady states in the deterministic model). This pattern demonstrated that while the total pathogen load consistently rebounded to pre-treatment levels, the underlying population composition, specifically the relative abundances of sensitive and resistant strains, underwent irreversible changes. The linear arrangement of post-recovery states along the green dashed line visually reinforced this fundamental divergence between quantitative recovery and qualitative population restructuring. The embedded insets also exhibited pathogen subpopulation dynamics. The upper inset showed the progressive decline of sensitive pathogens with each treatment, while the lower inset documented the stepwise accumulation of resistant strains. Crucially, once resistant pathogens surpassed a critical threshold, they dominated the population to such an extent that even sustained treatment can no longer reduce the total pathogens representing the establishment of drug resistance.
We next investigated the dynamical mechanisms by which the CME system maintains constant total pathogen levels while altering the relative proportions of sensitive and resistant strains. To examine this, we selected 1000 initial conditions to simulate the CME system’s evolution without antibiotic treatment, revealing its steady-state distribution. The three-dimensional initial conditions were uniformly sampled from [0,1]×Ω space at 0.1 intervals. As shown in Fig. 3e, f, prolonged system evolution (t = 1000 days) drove the variables (resistant pathogens, sensitive pathogens, and probiotics) to converge into two distinct horizontally linear distributions in phase space, representing the system’s long-term stable probability distributions. The phase space diagrams in Fig. 3e, f showed two distinct states: a healthy upper distribution where probiotics dominate and pathogens remain suppressed, and a diseased lower distribution where pathogens thrive while probiotics diminish. Therefore, the system’s recovery behavior was shaped by the spatial structure of this healthy basin. Following treatment, the system didn’t return to a precise pre-illness state but rather converged to the broader healthy distribution. This explained how quantitative recovery of total pathogen loads can coexist with qualitative changes in population composition across treatment cycles. As shown by the directional arrows in Fig. 3c, d, each infection-treatment-recovery cycle progressively increases the proportion of resistant pathogens within the healthy region, eventually leading to drug resistance despite the system remaining in the “healthy” state space.
We further explored the dynamical origins of these two distinct attraction distributions. In the deterministic model, where the reaction rates for sensitive and resistant pathogens were set to be identical, the steady states formed two horizontal lines in the 3-dimensional space described by k1PS + k2PT = 0.185 and k1PS + k2PT = 0.913. To compare with the stochastic system, we projected the horizontally linear distributions from the CME model onto the sensitive-resistant pathogen plane and performed linear least-squares fitting (Supplementary Fig. 2). The corresponding fitted functions closely matched those derived from the deterministic model. This agreement occurred because, although the introduction of noise means the reaction rates for sensitive and resistant pathogens are no longer perfectly identical, the differences between them remain relatively small. Consequently, near the steady states of the deterministic model, the reaction rates of both sensitive and resistant pathogens were close to zero, forming two attraction distributions in the shape of horizontal lines. If the noise was reduced, the stable region becomes narrower (Fig. 3f).
In this section, our analysis revealed that the CME system accurately recapitulated antibiotic resistance development through its line-shaped steady-state distribution. Within this distribution, while total pathogen numbers remained constant, the relative abundances of sensitive versus resistant strains exhibited marked divergence. This dynamical structure explained how post-treatment recovery restored baseline pathogen loads while progressively increasing resistance ratios.
Strong noise intensity may lead to the early emergence of drug resistance
In this section, our primary goal was to investigate the impact of noise intensity on the timing of drug-resistance emergence. To achieve this, we performed 200 independent simulations for each system size (Ω = 2000, 5000, and 10,000), examining the emergence of drug resistance after multiple cycles of infection-treatment-recovery (Fig. 4a–c). We used the term “effective treatment cycles” to denote the maximum number of complete “infection-treatment-recovery” cycles during which treatment can successfully reduce total pathogens to health state. The yellow dashed vertical line indicated the effective treatment cycles before drug-resistance in the absence of noise (the deterministic model). When Ω = 2000, the average number of effective treatment cycles was approximately 7 (the orange dashed vertical line). 37% of simulations showed resistance emerging within just 5 infection-treatment-recovery cycles. Therefore, the number of effective treatment cycles before the emergence of drug resistance was significantly lower than that predicted by the deterministic model, which means drug resistance emerged much earlier. Clinically, this indicated a substantial narrowing of the therapeutic window for antibiotics. For Ω = 5000 (Fig. 4b), 75% of simulations still showed fewer effective treatment cycles than that in the deterministic model, with an average of approximately 11 cycles. As the noise intensity was further decreased (Ω = 10,000, Fig. 4c), the average number of effective treatment cycles before resistance was close to that of the deterministic model, approximately 14 cycles. These results implied that the noise may cause drug-resistance to appear earlier.
The early emergence of drug resistance was partly caused by noise allowing pathogens to regrow after treatment (Fig. 2). Because of this regrowth, longer antibiotic therapy was needed to control the infection. Figure 4d illustrated this scenario through a specific case study when Ω = 2000. During the second infection-treatment-recovery cycle (the gray shaded area), the pathogen population exhibited two distinct resurgence events in the recovery phase, each reaching the illness threshold (0.38 Ω). Consequently, two supplemental antibiotic interventions were required to successively reduce the pathogen load to the treatment threshold (0.33 Ω), thereby preventing further population increase. Figure 4e showed the quantified populations of sensitive and resistant pathogens at each pre-cycle health state, allowing comparison across successive treatment cycles. After the second cycle with supplemental antibiotics during recovery, the data revealed a sharper decline in sensitive pathogens and a faster rise in resistant populations. Both shifts significantly exceeded the corresponding changes observed in cycles without supplemental antibiotic treatment. This demonstrated that additional antibiotics during recovery accelerate resistance by altering microbial composition for subsequent infections.
We also noted that drug-resistance may not occur in some cases (the green bar in Fig. 4a–c). Figure 4f showed a representative example (Ω = 2000) where resistant pathogens went extinct while sensitive strains persisted, preventing resistance development. We attributed this to the initially small resistant populations (0.203 Ω sensitive pathogens, 0.15 Ω resistant pathogens, and 0.647 Ω probiotics). Combined with the stochastic nature of the Gillespie algorithm, it may lead to the extinction of resistant pathogens. Further simulations in Supplementary Fig. 3 confirmed that the probability of resistant pathogen extinction decreases as their initial fraction increases, with the effect being less pronounced at larger system sizes (Ω). This phenomenon mirrored the observations from SDE-based stochastic models, where strong noise may lead to population extinction30.
In this section, extensive simulations revealed that elevated noise accelerated the emergence of antibiotic resistance. A key mechanistic insight was that stronger stochastic fluctuations may necessitate additional antibiotic treatments, thereby progressively enriching resistant populations and shortening the time to resistance onset.
Noise mediates pathogen composition shifts during recovery
We further investigated how stochastic noise influences the magnitude of pathogen composition shifts during recovery phases. Specifically, we examined whether higher noise levels (lower Ω values) amplified the divergence between sensitive and resistant pathogen populations compared to the deterministic version.
We recorded the numbers of sensitive pathogens, resistant pathogens and probiotics after each treatment (before recovery) in the original deterministic model. There were 14 effective treatment cycles before the drug-resistance. So, we began with these 14 sets of initial values to observe how the CME system evolved. Using these 14 initial conditions as starting points, we performed 1000 CME simulations per set, analyzing post-recovery (120-day) health states. The sensitive-to-resistant pathogen ratio served as a key metric, with smaller ratios correlating with earlier resistance development. For Ω = 2000, CME simulations consistently yielded health states with significantly lower ratios than deterministic predictions (Fig. 5a), indicating stochastic acceleration of resistance. While this trend persisted at Ω = 10,000, the distribution of outcomes became more balanced between resistance-accelerating (lower ratio) and resistance-delaying (higher ratio) trajectories (Fig. 5b), reflecting reduced noise effects at larger system sizes.
a, b Compared the sensitive-to-resistant pathogen ratios between stochastic and deterministic models when Ω = 2000 (a) and Ω = 10,000 (b). The red bars represented cases where the ratio was smaller than that of the deterministic model, while the blue bars represented cases where the ratio was larger. c, d Illustrated the mean values of sensitive pathogens (c) and resistant pathogens (d) from 1000 simulations under each of the 14 initial value. All microbial populations shown in the figure were normalized to Ω. The blue snowflake symbol represented Ω = 2000, while the yellow triangles represented Ω = 10,000.
Furthermore, mean values (calculated across all 1000 simulations per initial condition) were quantified the average post-recovery health state attained from each starting configuration (Fig. 5c, d). It showed that health states at Ω = 10,000 consistently maintained higher average numbers of sensitive pathogens and lower average numbers of resistant pathogens compared to Ω = 2000 cases. Notably, as treatment cycles increased, the Ω = 2000 system showed significantly greater growth in resistant pathogen numbers (Fig. 5d). This implied that noise intensity may primarily accelerate resistance emergence through its effect on resistant pathogens.
In summary, the results presented herein demonstrated that stochastic effects systematically shifted post-treatment microbial compositions toward resistance-favoring states, with the magnitude of this shift dependent on system size. These observations were associated with noise-induced preferential enhancement of resistant pathogen proliferation relative to sensitive ones.
Potential link between stationary-state geometry and resistance emergence time
Our CME results revealed that stochastic noise transformed the original linear manifolds into probabilistic distributions, with stronger noise leading to earlier resistance emergence. The stochastic nature of the CME model made it difficult to directly analyze how the properties of stationary distribution influenced resistance timing. To address this, we employed parameter perturbations, deterministically modifying the manifold equations, to systematically investigate the relationship between manifold geometry and resistance development. While this deterministic perturbation approach can’t capture the full stochastic behavior of the CME model, it offered complementary evidence that the geometric properties of the system’s stationary states may influence resistance timing.
We initially used single-parameter variations to assess how the spatial positioning of perturbed steady states influenced drug-resistance emergence timelines. We respectively increased kPB of sensitive pathogens by 0.1%, 0.5%, 1%, and 2% in the deterministic model. After perturbation, the original continuous line-shaped steady state was replaced by an isolated steady state (black dot in Fig. 6). Figure 6 illustrated how sensitive and resistant pathogen populations changed across multiple “infection-treatment-recovery” cycles. When kPB was increased by 0.1%, after each cycle, the number of sensitive and resistance pathogens basically returned to the original line-shaped steady state (Fig. 6a), which corresponded to k1PS + k2PT = 0.185. This line became a slow manifold in the perturbed deterministic system. After each subsequent treatment cycle, the total number of pathogens returned to the normal level (green dashed line), but the portion of sensitive pathogens decreased at the same time, finally leading to the failure of antibiotics in the 12th treatment. Similar result was observed when kPB was further increased by 0.5%, 1% and 2% (Fig. 6b–d). Nevertheless, the number of effective treatment cycles significantly decreased to 7, 5 and 4. In reverse, if kPB was decreased by 0.1%, the system had a steady state with high portion of sensitive pathogens (Fig. 6e), the drug-resistance was delayed to the 20th treatment. The inset panels specifically tracked the health state transitions after each complete “infection-treatment-recovery” cycle, which marked the shift in population composition across repeated cycles. Notably, the compositional shift per treatment cycle was amplified when steady state exhibited lower sensitive-to-resistant pathogen ratio. As demonstrated in Fig. 6f, systems sharing identical post-treatment states followed divergent recovery trajectories due to the different steady states. For systems with steady states characterized by a lower proportion of sensitive pathogens, the recovery phase exhibited a more pronounced reduction in the ratio of sensitive strains.
a kPB was increased by 0.1%. The green dashed line represented the slow manifold of the perturbed deterministic system. The black dot represented the steady state (healthy state) of the system, and the orange dot represented the initial point. b kPB was increased by 0.5%. c kPB was increased by 1%. d kPB was increased by 2%. e kPB was decreased by 0.1%. Here, the red, cyan, and blue curves represented the infection, antibiotic-treatment, and recovery courses, respectively. The inset panels marked the health state (red dots) transitions after each complete “infection-treatment-recovery” cycle. Panel (f) illustrated the divergent recovery trajectories of systems starting from identical post-treatment initial state, with (a–e) corresponding to the systems depicted in Panels (a–e), respectively.
Through systematic parameter perturbations at four levels (0.1%, 0.5%, 1%, and 2% of baseline values), we examined how perturbation magnitude influenced both steady-state configurations and resistance emergence timelines (Fig. 7a–d). Each perturbation level underwent 1000 simulations where all pathogen-related parameters were varied simultaneously within their respective ranges (e.g., ±0.1% for the 0.1% level). The results demonstrated a clear perturbation-dependent trend. Among the steady states obtained from the systems under 1000 parameter perturbations, only 43% were associated with accelerated resistance at the 0.1% perturbation level. This proportion increased progressively to 48%, 51%, and 58% at 0.5%, 1%, and 2% perturbations respectively. Moreover, as the perturbation amplitude increased, the proportions of sensitive pathogens dropped progressively further below baseline levels (black dotes in Fig. 7a–d). These findings established that both the magnitude of parameter perturbations and the resulting steady-state configurations collectively determine resistance development timelines.
a Represented a 0.1% parameter perturbation. b Showed a 0.5% parameter perturbation. c Illustrated a 1% parameter perturbation. d Depicted a 2% parameter perturbation. The black dots represented steady states that can accelerate the development of drug resistance, while the orange and blue dots represented steady states that can delay the development of drug resistance. Specifically, the blue dots indicated scenarios where antibiotic susceptibility preserved.
Therefore, our parameter perturbation study provided complementary evidence that geometric properties of stationary states influence resistance timing, mirroring the CME model’s findings where noise-induced acceleration correlates with characteristic changes in the stationary distribution. This consistency suggested that the advancement of resistance under stochastic conditions may arise fundamentally from systematic alterations to the system’s steady-state organization.
Increasing number of coupled communities delays antibiotic resistance
In the simulations above, we focused on the interactions within a microbial community. However, there are complex interactions between microbial communities in different regions in human’s gut. These interactions may include nutrient competition, exchange of metabolic products, and intercellular communication through signaling molecules. Therefore, in this section we considered the coupling between microbial community, evaluating the impact of coupling between microbial community on antibiotic resistance. We assumed the number of microbial communities is n, and the coupling terms included the inhibitory effects of probiotics on pathogens and vice versa. The coupled dynamics model of microbial community (2) was as follows:
Here, Xi, Yi, Zi represent the number of sensitive pathogens, resistant pathogens, and probiotics in the i-th community, respectively. \({P}_{i}={k}_{1}{X}_{i}+{k}_{2}{Y}_{i}\), which indicated the inhibition effect of pathogens on probiotics.\({c}_{{ij}}\) represented the elements of the connection matrix C. If there was coupling between community i and community j, then \({c}_{{ij}}\) = 1. otherwise, \({c}_{{ij}}\) = 0. The interaction strength J between community quantified the coupling strength, and Ω represented the number of bacteria in a single microbial community.
To assess the impact of community connectivity on the drug-resistance emergence, we performed 200 independent simulations for each coupled community size (n = 3, 5, 10) with J = 0.5 and analyzed the resulting distributions of effective treatment cycles. Our results showed that individual communities within larger coupled networks (increasing n) sustained more effective treatment cycles before resistance emergence (Fig. 8). This demonstrated that inter-community coupling can delay resistance development in individual communities, likely through enhanced ecological interactions.
We next examined whether the resistance-delaying effect of coupling persists when evaluating total pathogen loads across all connected communities, a scenario that better approximates real-world treatment conditions. To investigate this, we examined the total number of pathogens across all communities when n = 10. We found that the onset of antibiotic resistance was further delayed compared to the results in a single community (Fig. 9a). Notably, there were more instances where drug resistance does not occur, corresponding to the bar representing more than 25 effective cycles. To confirm that this delay was attributable to the coupling effect rather than isolated communities, we conducted 200 simulations for the scenario of 10 microbial communities with J = 0. In these simulations, when observing the total number of pathogens across all communities, drug resistance occurred much earlier, with the mean effective treatment lasting only 2 cycles (Fig. 9b). These control simulations confirmed that the observed delay in resistance emergence was indeed mediated by inter-community coupling, rather than being an artifact of isolated community dynamics.
a, b Distribution of effective antibiotic treatment cycles across 10 coupled microbial communities, for J = 0.5 (a), J = 0 (b). Here, and the orange dashed lines indicated the mean number of effective antibiotic treatments in the stochastic model. c showed a scenario where drug resistance failed to emerge after 25 complete infection-treatment-recovery cycles, depicting the quantity of resistant pathogens within each of the 10 colonies following each recovery phase. The amount of resistant pathogens were normalized to Ω. Each line represented the variation in the number of resistant pathogens within an individual community.
Our findings further revealed that coupling delayed drug resistance by generating a spatially heterogeneous population structure (Fig. 9c). After 25 effective treatment cycles, some microbiomes had eliminated resistant pathogens, while others continued to harbor high levels of resistant strains. As a result, drug resistance developed in certain communities, whereas sensitive pathogens remained predominant in others. Consequently, antibiotic treatment remained effective when considering the total pathogen count. The results demonstrated that inter-community coupling maintained system balance by offsetting resistant strain outbreaks in some areas with sensitive strain persistence in others, thus extending treatment efficacy.
Discussion
Stochastic noise is ubiquitous in biology, and the natural noise generated by the interactions among intestinal flora can significantly impact human physiological processes. This effect is particularly pronounced when microbial is small, where the interactions between individual microorganisms become more intense and the influence of stochastic variations is amplified. In this study, we enhanced the deterministic model developed by Xiaxia Kang et al. by converting it into 12 reactions and simulated the dynamic using Gillespie algorithm. Through extensive numerical simulations, we investigated the impact of internal noise within the microbiota on the host’s infection-treatment-recovery process, and the development time of antibiotic resistance. Additionally, we evaluated the role of coupling between microbial communities.
The CME model revealed that antibiotic resistance would emerge following repeated “infection-treatment-recovery” cycles. This phenomenon was attributed to the presence of two attractor regions in the stochastic model, which is due to the similar reaction rates between the sensitive pathogens and resistant pathogens. After each treatment, rather than returning to a stable state close to the pre-illness condition, the system converged toward the attractor region, leading to a gradual increase in the proportion of resistant pathogens. Furthermore, we observed that increased noise intensity can accelerate resistance onset. This acceleration appears to stem from the differences in growth dynamics between pathogen subtypes, where stronger fluctuations preferentially drive the system toward resistant-favoring configurations during recovery phases. Importantly, our results also suggested that coupling between microbial communities play a crucial role in mitigating the random fluctuations observed in individual communities. Moreover, this coupling acted as a compensatory mechanism, helping to maintain a balanced proportion of sensitive and resistant pathogens across the entire gut microbiota, thereby potentially delaying the onset of antibiotic resistance. The primary objective of this study was to investigate how internal stochastic noise within microbial flora influences the development of resistance following antibiotic treatment, and to determine whether coupling between microbial communities can enhance resistance outcomes post-treatment. It is crucial to acknowledge that this stochastic noise is a real factor that should not be overlooked in actual treatment regimens.
Our modeling results tentatively suggested that noise-accelerated resistance development, which is mediated by stochastic expansion of resistant strains, might potentially be mitigated through combined antibiotic therapy and gut microbiota modulation. Clinical observations including delayed resistance emergence after fecal microbiota transplantation (FMT) could partially support this hypothesis, as FMT may stabilize microbial community structure and reduce noise-driven fluctuations. Furthermore, our model indicated that increased coupling between microbial communities might delay resistance onset by facilitating spatial segregation of resistant and sensitive strains, consequently decreasing competitive exclusion of sensitive populations following antibiotic treatment. These theoretical insights offered valuable starting points, however, their clinical translation will demand rigorous experimental verification.
While this study provides meaningful insights into noise-driven resistance evolution, several important limitations should be acknowledged. First, the model’s exclusion of environmental pathogen influx represents a significant simplification, as such invasions could dramatically reshape steady-state dynamics in clinical settings. Second, while our numerical simulations revealed the noise-induced extinction of resistant pathogens observed in Figs. 4f and S3, which aligned with classical population extinction thresholds in SDE theory. The absence of analytical solutions limited our ability to derive general theoretical principles for these stochastic transitions. Most importantly, although both parameter perturbations and CME modeling independently suggested that resistance timing is governed by system stability properties (manifested through either stochastic sampling or equilibrium displacement), the precise mechanistic bridge between these frameworks remains uncharacterized. The consistent trends across methodologies nevertheless underscore the geometric influence on resistance evolution.
Further research efforts should simultaneously address several key challenges. The theoretical frameworks could be developed to reconcile our observed noise-induced extinction events with classical SDE population threshold theories. Concurrently, innovative hybrid analytical-numerical methods are needed to establish quantitative relationships between stationary distribution characteristics and resistance emergence timelines. Furthermore, the incorporation of environmental transmission pathways will be essential for enhancing the biological realism of these models. Moreover, our analysis revealed that the parameter kpb significantly modulated the rate of antibiotic resistance development through its impact on the system’s steady-state pathogen composition. Therefore, examining the key parameters governing resistance constitutes is an important and scientifically significant research direction. Collectively, these advancements promise to deepen our fundamental understanding of stochastic population dynamics while yielding clinically actionable insights into resistance prevention strategies.
Methods
In this paper, for the convenience of research, the model (1) is made dimensionless. Here, let \(x={P}_{S}/{K}_{P}\), \(y={P}_{T}/{K}_{P}\) and \(z=B/{K}_{B}\). \(x\), \(y\) and \(z\) represent the proportions of sensitive pathogens, resistant pathogens, and probiotics in the entire gut flora. At the same time, let \(a={a}^{{\prime} }/{K}_{B}\), \(b={b}^{{\prime} }/{K}_{P}\), and we got the dimensionless model (3):
To account for the effect of stochastic noise on antibiotic resistance in gut flora, we introduced Ω to represent the total population size of the microbial community. When the total population size is small (Ω is relatively low), stochastic noise becomes more pronounced. Conversely, when the total population size is large (Ω is sufficiently high), the impact of random fluctuations becomes relatively weaker compared to the overall system dynamics. By defining \(X=x\Omega \), \(Y=y\Omega \), and \(Z=z\Omega \) in model (3), where X, Y, and Z respectively denote the population sizes of sensitive pathogens, resistant pathogens, and probiotics. Then we got model (4):
which is
Then, we converted model (5) into a set of fundamental reactions that govern stochastic changes in the microbial populations (listed in Table 1). Each term in the ODE system corresponds to a fundamental reaction channel in the stochastic formulation. Specifically, for each population variable (sensitive pathogen X, resistant pathogen Y, and probiotic Z), all birth, death, inhibition, and treatment effects are described as individual reaction steps.
For each reaction, we derived the corresponding propensity function (wj, j = 1, 2, …, 12), reflecting the probability per unit time that the reaction occurs given the system state. Below, we detail the mapping for the sensitive pathogen (X).
Self-growth: The self-growth term is represented by a reaction in which a sensitive pathogen reproduces, denoted as →X. In this process, one unit of X is produced, increasing X by one, while Y and Z remain unchanged. The change vector for this reaction is (1,0,0), indicating an increase in X only. The corresponding propensity function \({w}_{1}={r}_{p}(1-({k}_{1}\frac{X}{\Omega }+{k}_{2}\frac{Y}{\Omega }))X\) describes the rate of self-replication as determined by the system parameters and current state.
Inhibition by probiotics: The inhibition term is represented by a reaction in which a probiotic mediates the removal of a sensitive pathogen, denoted as X → :Z. In this process, X decreases by one while Z participates in the inhibition, but is not consumed or reduced in number. The state change vector for this reaction is (−1,0,0), reflecting the decrease in X only. The corresponding propensity function \({w}_{2}={k}_{{PB}}\frac{{Z}^{2}}{{Z}^{2}+{a}^{2}{\Omega }^{2}}X\), reflects the cooperative effect of probiotics on pathogen inhibition.
Natural death: The natural death process of X is represented by a removal reaction, denoted as X → . In this process, one unit of X is eliminated, decreasing X by one while Y and Z remain unchanged. The change vector for this reaction is (−1,0,0), and the corresponding propensity function\(\,{w}_{3}={d}_{p}X\) reflects the rate of natural death.
Antibiotic-induced death: The death of X due to antibiotic treatment is similarly represented as a removal reaction, X → , in which X decreases by one and Y and Z remain unchanged. The associated change vector is also (−1,0,0), with the propensity function \({w}_{4}={\eta }_{1}X\) determined by the antibiotic effect.
These examples pertain to the sensitive pathogen X. Analogous reactions, propensity functions, and state change vectors are similarly defined for the resistant pathogen (Y) and probiotic (Z) populations, as detailed in Table 1.
The parameter values used in the stochastic model are identical to those in the deterministic ODEs, ensuring consistency between the two modeling approaches. At each simulation step, the next reaction to occur is randomly selected according to its propensity function, and the system state is updated based on the corresponding change vector. The time interval until the next reaction is also sampled randomly, which naturally accounts for the stochastic fluctuations in reaction timing and order. Due to these stochastic effects, the realized reaction rates of sensitive and resistant pathogens can differ from their mean-field (ODE) values, particularly when the population sizes are small.
We employed the classic Gillespie algorithm to mimic the change of the stochastic system. At each step of the algorithm, all propensity functions are calculated based on the current system state. The total propensity is used to determine both the time interval to the next reaction event (sampled from an exponential distribution) and to probabilistically select which reaction will occur. After each event, the system state is updated accordingly, and this process is repeated iteratively until the desired simulation time is reached. This algorithm enables an accurate representation of demographic noise and discrete events in the microbial population dynamics. The complete pseudocode implementation and associated source code files can be found in the Supplementary Materials.
Data availability
All code and the related datasets supporting the findings of this study are provided as Supplementary Materials with this manuscript.
References
Belkaid, Y. & Hand, T. W. Role of the microbiota in immunity and inflammation. Cell 157, 121–141 (2014).
Konturek, P. C. et al. Emerging role of fecal microbiota therapy in the treatment of gastrointestinal and extra-gastrointestinal diseases. J. Physiol. Pharmacol. 66, 483–491 (2015).
Hooper, L. V., Littman, D. R. & Macpherson, A. J. Interactions between the microbiota and the immune system. Science 336, 1268–1273 (2012).
Goulet, O. Potential role of the intestinal microbiota in programming health and disease. Nutr. Rev. 73, 32–40 (2015).
Ericsson, A. C. et al. Differential susceptibility to colorectal cancer due to naturally occurring gut microbiota. Oncotarget 6, 33689–33704 (2015).
Finegold, S. M. et al. Jeffrey A. Pyrosequencing study of fecal microflora of autistic and control children. Anaerobe 16, 444–453 (2010).
Lozupone, C. A., Stombaugh, J. I., Gordon, J. I., Jansson, J. K. & Knight, R. Diversity, stability and resilience of the human gut microbiota. Nature 489, 220–230 (2012).
Tumbarello, M. et al. Predictors of mortality in bloodstream infections caused by klebsiella pneumoniae carbapenemase-producing k. pneumoniae: importance of combination therapy. Clin. Infect. Dis. 55, 943–950 (2012).
Yong, D. et al. Characterization of a new metallo-beta-lactamase gene, bla(ndm-1), and a novel erythromycin esterase gene carried on a unique genetic structure in klebsiella pneumoniae sequence type 14 from India. Antimicrobial Agents Chemother. 53, 5046–5054 (2009).
Da Silva, G. J. & Mendonça, N. Association between antimicrobial resistance and virulence in escherichia coli. Virulence 3, 18–28 (2012).
O’Neill J. Tackling drug-resistant infections globally: Final report and recommendations. Rev. Antimicrob. Resist. (2016).
Momeni, B., Chen, C. C., Hillesland, K. L., Waite, A. & Shou, W. Using artificial systems to explore the ecology and evolution of symbioses. Cell. Mol. Life Sci. 68, 1353–1368 (2011).
Vandermeer, J. H. The competitive structure of communities: An experimental approach with protozoa. Ecology 50, 362–371 (1969).
Gillor, O., Etzion, A. & Riley, M. A. The dual role of bacteriocins as anti- and probiotics. Appl. Microbiol. Biotechnol. 81, 591–606 (2008).
Riley, M. A. & Wertz, J. E. Bacteriocins: Evolution, ecology, and application. Annu. Rev. Microbiol. 56, 117–137 (2002).
Balaban, N. Q., Merrin, J., Chait, R., Kowalik, L. & Leibler, S. Bacterial persistence as a phenotypic switch. Science 305, 1622–1625 (2004).
Fargione, J., Brown, C. S. & Tilman, D. Community assembly and invasion: An experimental test of neutral versus niche processes. Proc. Natl Acad. Sci. USA 100, 8916–8920 (2003).
Chave, J. Neutral theory and community ecology. Ecol. Lett. 7, 241–253 (2004).
Rosindell, J., Hubbell, S. P. & Etienne, R. S. The unified neutral theory of biodiversity and biogeography at age ten. Trends Ecol. Evolution 26, 340–348 (2011).
Chase, J. M. & Myers, J. A. Disentangling the importance of ecological niches from stochastic processes across scales. Philos. Trans. R. Soc. B: Biol. Sci. 366, 2351–2363 (2011).
Chase, J. M. Stochastic community assembly causes higher biodiversity in more productive environments. Science 328, 1388–1391 (2010).
Ofiteru, I. D. et al. Combined niche and neutral effects in a microbial wastewater treatment community. Proc. Natl Acad. Sci. USA 107, 15345–15350 (2010).
Brigatti, E. & Azaele, S. Growth-rate distributions of gut microbiota time series [J]. Sci. Rep. 15, 2789 (2025).
Descheemaeker, L. & de Buyl, S. Stochastic logistic models reproduce experimental time series of microbial communities. eLife 9, e55650 (2020).
Zapién-Campos, R., Sieber, M. & Traulsen, A. Stochastic colonization of hosts with a finite lifespan can drive individual host microbes out of equilibrium. PLoS Computat. Biol. 16, e1008392 (2020).
D’Agata, E. M. C. et al. The impact of different antibiotic regimens on the emergence of antimicrobial-resistant bacteria. PLoS One 3, e4036 (2008).
Levin, B. R., Perrot, V. & Walker, N. Compensatory mutations, antibiotic resistance and the population genetics of adaptive evolution in bacteria. Genetics 154, 985–997 (2000).
Levin, B. R. & Rozen, D. E. Non-inherited antibiotic resistance. Nat. Rev. Microbiol. 4, 556–562 (2006).
Bonhoeffer, S., Lipsitch, M. & Levin, B. R. Evaluating treatment protocols to prevent antibiotic resistance. Proc. Natl Acad. Sci. USA 94, 12106–12111 (1997).
Lande, R. Risks of population extinction from demographic and environmental stochasticity and random catastrophes. Am. Naturalist 142, 911–927 (1993).
Chesson, P. Mechanisms of maintenance of species diversity. Annu. Rev. Ecol., Evol., Syst. 31, 343–366 (2000).
Fukami, T. & Nakajima, M. Community assembly: Alternative stable states or alternative transient states?. Ecol. Lett. 14, 973–984 (2011).
Kang, X. X., Yan, J., Huang, F. & Yang, L. On the mechanism of antibiotic resistance and fecal microbiota transplantation. Math. Biosci. Eng. 16, 7057–7084 (2019).
Marrec, L., Bank, C. & Bertrand, T. Solving the stochastic dynamics of population growth [J]. Ecol. Evolution 13, 4457–4467 (2023).
Waites, W., Cavaliere, M., Manheim, D., Panovska-Griffiths, J. & Danos, V. Rule-based epidemic models. J. Theor. Biol. 530, 110846 (2021).
Pájaro, M., Alonso, A. A., Otero-Muras, I. & Vázquez, C. Stochastic modeling and numerical simulation of gene regulatory networks with protein bursting. J. Theor. Biol. 421, 51–70 (2017).
Hahrezaei, V. & Swain, P. S. The stochastic nature of biochemical networks. Curr. Opin. Biotechnol. 19, 369–374 (2008).
Black, A. J. & McKane, A. J. Stochastic formulation of ecological models and their applications. Trends Ecol. Evol. 27, 335–342 (2012).
Lloyd-Price, J. et al. Strains, functions and dynamics in the expanded Human Microbiome Project. Nature 550, 61–66 (2017).
Ouzounis, C. A. et al. Microbial co-occurrence relationships in the human microbiome. PLoS Computational Biol. 8, e1002527 (2012).
Schwab, C. & Ghosh, M. Comparative analysis of fecal microbiota and intestinal microbial metabolic activity in captive polar bears. Can. J. Microbiol. 57, 577–586 (2011).
Acknowledgements
We thank Xiaxia Kang for the previously established microbiome deterministic model. This work was supported by grants from the National Natural Science Foundation of China [12371498 to J.Y. and 12471467 to L.Y].
Author information
Authors and Affiliations
Contributions
A.H., L.Y., and J.Y. were involved in study design and development. A.H. established the model and performed the numerical simulations. A.H., J.Y., and L.Y. interpreted the results of the numerical simulations. A.H. drafted the manuscript. J.Y. and L.Y. edited and revised manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Hu, A., Yang, L. & Yan, J. The effect of stochastic noise on antibiotic resistance in intestinal flora. npj Syst Biol Appl 11, 77 (2025). https://doi.org/10.1038/s41540-025-00548-4
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41540-025-00548-4