## Abstract

Ecological memory refers to the influence of past events on the response of an ecosystem to exogenous or endogenous changes. Memory has been widely recognized as a key contributor to the dynamics of ecosystems and other complex systems, yet quantitative community models often ignore memory and its implications.

Recent studies have shown how interactions between community members can lead to the emergence of resilience and multistability under environmental perturbations. We demonstrate how memory can complement such models. We use the framework of fractional calculus to study how the outcomes of a well-characterized interaction model are affected by gradual increases in ecological memory under varying initial conditions, perturbations, and stochasticity.

Our results highlight the implications of memory on several key aspects of community dynamics. In general, memory slows down the overall dynamics and recovery times after perturbation, thus reducing the system’s resilience. However, it simultaneously mitigates hysteresis and enhances the system’s capacity to resist state shifts. Memory promotes long transient dynamics, such as long-standing oscillations and delayed regime shifts, and contributes to the emergence and persistence of alternative stable states.

Collectively, these results highlight the fundamental role of memory on ecological communities and provide new quantitative tools to analyse its impact under varying conditions.

**Author summary** An ecosystem is said to exhibit *ecological memory* when its future states do not only depend on its current state but also on its initial state and trajectory. Memory may arise through various mechanisms as organisms learn from experience, modify their living environment, collect resources, and develop innovative strategies for competition and cooperation. Despite its commonness in nature, ecological memory and its potential influence on ecosystem dynamics have been so far overlooked in many applied contexts. Here, we combine theory and simulations to investigate how memory can influence community dynamics, stability, and composition. We incorporate in particular memory effects in a multi-species model recently introduced to investigate alternative stable states in microbial communities, and assess the impact of memory on key aspects of model behavior. The approach we propose for modeling memory has the potential to be more broadly applied in microbiome research, thus improving our understanding of microbial community dynamics and ultimately our ability to predict, manipulate and experimentally design microbial ecosystems.

## Introduction

The temporal variations observed in ecosystems arise from the interplay of complex deterministic and stochastic processes, the identification and characterization of which requires quantitative models. The empirical study of microbial communities provides an ideal source of data to inform the development of dynamical community models, since this active research area generates rich ecological time series under highly controlled experimental conditions and perturbations [1]. Nevertheless, despite the recent advances in metagenomic sequencing and other high-throughput profiling technologies that are now transforming the analysis of microbial communities [2], there has only been limited success in accurately modeling and predicting the complex dynamics in microbial communities. This highlights the need for re-evaluating and extending the available models to better account for the various mechanisms that underlie community dynamics [1, 3–7]. One central shortcoming of the currently popular dynamical models is that they ignore the role of memory, that is, they are based on the assumption that the community’s future behavior solely depends on its current state, perturbations, and stochasticity.

Ecological memory is present when the community’s past states and trajectories influence its dynamics over extended periods. It is a fundamental aspect of natural communities, and its influence on community dynamics has been widely recognized across ecological systems [8–11]. Memory can emerge through a number of mechanisms, including the accumulation of abiotic and biotic material characterizing past legacies of the system [12, 13]. Thus, developing and investigating new means to incorporate memory in dynamical models of ecological communities has the potential to yield more accurate mechanistic understanding and predictions.

Diverse approaches have been proposed to explore ecological memory, including time delays [10, 14, 15], historical effects [16], exogenous memory [11], and buffering of disturbances [17]. A stochastic framework was used to evaluate the length, patterns, and strength of memory in ecological case studies [10]. However, the impact of memory has not been systematically addressed, and specific methods have been missing for incorporating memory into standard deterministic models of microbial community dynamics.

Potential community assembly mechanisms have been recently investigated based on extensions of the generalized Lotka-Volterra framework, which provides a standard model for species interactions [18–20]. The standard model has been extended by incorporating external perturbations [21], sequencing noise [22] and variance components [23], and to satisfy specific modeling constraints [24] such as compositionality [25]. Generalized Lotka-Volterra models have also been combined with Bayesian Networks for improved longitudinal predictions [26]. One goal of these modeling efforts is to understand how the alternative community types reported in the human microbiome may arise, possibly in combination with external factors [27–31]. Despite the recent popularity of generalized Lotka-Volterra models in microbial ecology, the impact of memory in these models has been largely ignored.

We address the above shortcomings by explicitly incorporating a class of memory effects into community interaction models using fractional calculus, which provides well-established tools for modeling memory [32, 33]. We incorporate memory into a multi-species model that was recently used to illustrate the emergence of alternative states in microbial communities [18], and we then use this extended model to demonstrate how memory can influence critical aspects of community dynamics. This contributes to the growing body of quantitative techniques for studying community resistance, resilience, prolonged instability, transient dynamics, and abrupt regime shifts [34–38].

### Model

The generalized Lotka-Volterra and its extensions are ordinary differential equation (ODE) systems. This class of models has been commonly used to model community dynamics, but their standard formulations ignore memory effects. Here, we show how ecological memory can be included in these models based on *fractional calculus*. This mathematical tool provides a principled framework for incorporating memory effects into ODE systems (see *e*.*g*. [32, 33, 39, 40]), thus allowing a systematic analysis and quantification of memory effects in commonly used dynamical models of ecological communities.

Let us first consider a simple community with three species that tend to inhibit each other’s growth (Fig 1a). We will later extend this model community to a larger number of species. To model this system, we employ a non-linear extension of the generalized Lotka-Volterra model that was recently used to demonstrate possible mechanisms underlying the emergence of alternative states in a multi-species community [18]. This non-linear model describes the dynamics of a species *i* as a function of its growth rate, death rate, and an interaction term determined by the interaction matrix between all species pairs, as described in Fig 1a. Under certain conditions, this model gives rise to a tristable community, where each stable state corresponds to the dominance of a different species. The community can shift from one stable state to another following an external or internal perturbation (Fig 1b).

To introduce memory, we extend this model by incorporating fractional derivatives. In this extended formulation, the classical derivative operator *d/dt* is replaced by the fractional derivative operator , where *µ*_{i} ∈]0, 1] is the non-integer derivative order for species *i* (Fig 1c). The fractional derivative is defined by a convolution integral with a power-law memory kernel (see Appendix S1). The *µ*_{i} can then be used as a tuning parameter for memory, with lower values of *µ*_{i} indicating higher levels of memory for species *i* [32]. The *strength of memory* for species *i* is measured as 1 − *µ*_{i}. The three special cases of this model include (i) *no memory* (*µ*_{i} = *µ* = 1 for all species *i*), which corresponds to the original community model in [18]; (ii) *commensurate memory*, where all species have equal memory (*µ*_{i} = *µ* ≤ 1); and (iii) *incommensurate memory*, where *µ*_{i} may be unique for each *i*, and hence the degree of memory may differ between species. We numerically solve the fractional-order model with varying values of the parameter *µ*_{i}, thus inducing varying levels of memory, and use it to analyse the effect of memory on various aspects of community dynamics, in particular its response to perturbations (Fig 1d).

## Results

We have shown above how ecological memory can be incorporated in dynamical community models based on the framework of fractional calculus. Next, we use numerical simulations and analyses of this model to highlight the impact of memory on key dynamical properties of multi-species communities.

In general, memory adds a certain inertia in community dynamics as the influence of past states gradually fades out. Commensurate memory thus slows down the overall dynamics, which may lead to qualitative changes in the dynamics as well as community composition under certain conditions. In particular, memory-induced inertia tends to damp down fluctuations and can therefore mitigate or prevent more extreme and sudden changes in the system. Overall, our results show that ecological memory affects the community dynamics in two important ways: by enforcing more moderate levels of fluctuations, and by inducing quantitative and qualitative changes in how the system responds to perturbations or varying initial conditions. In the first section below, we report the consequences of these changes on community resistance and resilience.

The emergence of alternative community states has been debated in the microbiome research literature. For instance, [18] demonstrated how pulse perturbations can bring the 3-species system to a boundary of the tristability region, which then triggers a transition to an alternative stable state. In that model, such a transition can be for instance controlled by changes in the species’ growth rates. In the second section below, we report how memory can exert additional influence on the resulting dynamics and alter the community’s stability landscape.

### Resistance and resilience

*Resistance* refers to a system’s capacity to withstand a perturbation without changing its state, while *resilience* refers to its capacity to recover to its original state after a perturbation [41]. To examine the impact of ecological memory on community resistance and resilience in response to perturbations, we perturbed the system by changing the species growth rates over time. Specifically, we investigated the three-species community under *pulse* (Figs 2), *periodic* (Fig 3), and *stochastic* (Figs 4) perturbations, and analysed the impact of these three types of perturbations on community dynamics in the presence of memory, which is commensurate in this subsection.

Our results show that memory tends to increase resistance to perturbations by allowing the competing species’ coexistence for a longer time. In the presence of memory, switches between alternative community states take place more slowly following a pulse perturbation (Fig 2a), or in some cases may be prevented entirely (Fig 2b). Fig S1 provides a further example of the increased resistance provided by memory in a larger, unstructured community, where memory helps preserve the stable state after a pulse perturbation compared to the corresponding memoryless system.

After the perturbation has ceased, memory initially hastens the return to the original state, but then slows it down in the later stages of the recovery (Fig 2a). Thus, the impact of memory on resilience is multi-faceted: depending on the time scale considered, memory may either slow down or hasten the recovery from perturbations, thus reducing or increasing resilience. Furthermore, in multistable systems, memory may enhance resilience by promoting the persistence of the original stable state (Fig 2b).

Considering two successive pulse perturbations in opposite directions highlights another way memory can affect resilience in multistable systems (Fig 3a). After a state shift triggered by a first perturbation, memory may hasten recovery to the initial state following a second, opposite perturbation, hence increasing long-term resilience. Memory can thus mitigate the hysteresis that is typical of many ecological systems. In the presence of regularly alternating opposite pulse perturbations, akin to those experienced by marine plankton or the gut microbiome, the community may not be able to recover its initial state if the perturbations follow each other too rapidly. In such circumstances, memoryless communities reach a new stable state faster than the communities with memory, as the latter resist the perturbations for a longer time due to the reduced hysteresis (Fig 3b). This may lead to community dynamics being trapped in long-lasting transient oscillations.

Finally, we analyse the role of stochastic perturbations, which are an essential component of variation in real systems. Under stochastic perturbation (Fig 4a), ecological memory can dampen the fluctuations and significantly delay the shift towards an alternative stable state (Fig 4b). This demonstrates in a more realistic perturbation setting how memory can promote community resistance.

Memory can nevertheless have unexpected effects on community dynamics when its strength is tuned to bring the system in the vicinity of the tristable region, where the outcome of the dynamics is highly sensitive to initial conditions (Fig 4c). Under such conditions, minute changes in memory can push the system over a tipping point towards another attractor, radically changing the outcome. This illustrates that, beyond slowing down the dynamics and damping perturbations, memory can have non-trivial effects on the system’s stability landscape, which we investigate in the next section.

### Impact on stability landscape

Let us now consider a more complex community of 15 species structured into three groups through their interaction matrix. Each of these groups represents a set of weakly competing species—*e*.*g*., due to cross-feeding interactions that mitigate competition, while species belonging to different groups compete more strongly with each other (Fig 5a). We show that adding incommensurate memory in such a system can change the final stable state of the community even in the absence of perturbation. In particular, increasing the strength of memory in the group that is dominant in the stable state of the memoryless system can lead to its exclusion from the new stable state (Fig 5b-c). Around the threshold value, long transients can be observed (Fig 5d): even without changing any of the model parameters or imposing noise, an abrupt regime shift is triggered by the accumulated effect of memory after a long period of subtle, gradual changes.

Remarkably, adding memory in a given species may lead to either a reduction or an increase in its abundance depending on the conditions. While Fig 5b-c illustrates the exclusion of a group of species with higher memory from the stable state in the absence of perturbation, memory may conversely increase the persistence or abundance of a species in the presence of stochastic perturbation (Fig S2b). In fact, in the presence of perturbation, the dominance of any of the species may be achieved by tuning memory in a single species. This result holds both in the case of pulse (Fig S2a) and stochastic (Fig S2b) perturbation.

Bifurcation diagrams further show that, in addition to modifying the boundary between stable states in the space of initial conditions, memory can also broaden the region of the model’s parameter space that exhibits multistability (Fig S3). We illustrate for instance in Figure 6 that incommensurate memory can induce multistability in a 3-species community that would otherwise converge to a single stable state in the absence of memory. Ecological memory thus provides an alternative and largely overlooked mechanism for the emergence of multistability.

Finally, we show that simply setting similar levels of ecological memory within groups of species in an otherwise unstructured community may lead to the formation of coherent species assemblages with shared dynamics (Fig S4). This provides an additional mechanism for the emergence of distinct community types, each associated with the dominance of one such assemblage. Hence, our results show that memory can by itself lead to the emergence of alternative community types, between which the community may switch following a change in either initial conditions (Fig 6) or memory strength (Fig S4).

## Discussion

Our understanding of ecological community dynamics heavily relies on mathematical modeling. Dynamical community modeling is a particularly active research area in microbial ecology, where recent studies have proposed numerous mechanistic models of microbial community dynamics exploring the role of interactions, stochasticity, and external factors [1, 18, 42–44]. These studies have, however, largely neglected the role of ecological memory despite its potentially remarkable impact on community variation.

We have shown how ecological memory can be incorporated into models of microbial community dynamics, and used this modeling tool to demonstrate the role of memory as a potential key determinant of community dynamics. This has allowed us to expand our understanding of the impact of memory on community response to perturbation, long transient dynamics, delayed regime shifts, and the emergence of alternative community states.

Ecological communities are constantly subject to perturbations arising from external factors, as well as from internal processes and interactions between community members. Environmental fluctuations through time have a fundamental influence on ecological communities: they may promote species coexistence, increase community diversity [45, 46], contribute to the properties of stable states [37, 47], and in some cases, facilitate abrupt regime shifts [47]. Our analysis of memory in perturbed communities is closely linked to recent studies analysing the response of experimental microbial communities to antibiotic pulse perturbation [48, 49], or the impact of periodic perturbations on the evolution of antimicrobial resistance [34].

Our approach is based on fractional calculus [32], a well-known mathematical framework with a broad range of applications [50, 51]. In this framework, ecological memory is represented by fractional derivatives and their associated kernel, which determines how quickly the influence of past states fades out (see Appendix S1). Commensurate fractional derivatives have previously been shown to cause intrinsic damping in a system [52–54], which may delay transitions or shift critical thresholds [33]. Incommensurate models, on the other hand, yield complicated ODE systems that are mathematically more challenging to analyse and therefore remain less well understood. We have shown here that the type of memory introduced by fractional derivatives can influence resistance and resilience in ecological communities. Quantifying this influence using recently proposed resilience measures, such as exit time [55], would provide a promising line of research for future work. While this framework allows introducing only a specific type of memory, our qualitative results on the influence of memory on community dynamics are likely to hold more generally.

In addition to damping, memory can also induce other dynamical properties, such as long periods of instability [36], or long transients [38], which have been reported in ecological systems [56] and chemostat experiments [57]. Long transients have previously been shown to be favored by stochasticity, multiple time scales, and high dimensionality [38], and our results indicate that memory should be added to this list; [38] also argue that regime shifts may occur during such long transient dynamics, without requiring parameter changes. Our results support this view, since we have shown that changes in incommensurate memory can trigger abrupt regime shifts even in the absence of perturbations.

Modeling real systems using models that incorporate memory would benefit from the ability to gather empirical evidence for the presence, strength, and quality of memory in the system. Recent literature suggests that it might indeed be possible to empirically detect the presence of memory based on the broad properties of a time series. It has been shown that longitudinal time series of microbial communities may carry detectable signatures of underlying ecological processes [4, 58]; and recently, Bayesian hierarchical models [10, 14], Random Forests [11], neural networks [59], and unsupervised Hebbian learning [60] have been proposed to detect signatures of memory in other contexts.

Several extensions of our model could be considered in future studies to enhance its flexibility and model memory more generally, such as varying initial times [33] or applying fractional differential equations with time-varying derivative orders [61]. Alternative approaches have also been considered to model ecological memory. These include the incorporation of autocorrelation or fixed time-lags into the model structure [15]. One could also model ecological memory by distributed delay differential equations (DDE) [62], fractional delay differential equations [63], or an integer memory-dependent derivative [64] with arbitrary kernel functions to shape different patterns of memory weights.

Ecological memory is a systemic property that can arise through various mechanisms. For instance, communities can alter their environment and thus modify environmental parameters in ways that reflect past events, or organisms may exhibit context-specific growth patterns that reflect adaptations [60, 65, 66]. Delay effects could also arise without memory and through other mechanisms, such as intracellular inertia. Species may indeed have different and often variable lag phases, due to complex intracellular processes that may be effectively memoryless. In such cases, the dampening effects could be simply modeled by introducing a “*break* “ that would slow down or create a lag in community dynamics without inducing actual memory effects. Specifically designed longitudinal experiments could help evaluate the types and relative strengths of memory in real communities, such as in synthethic microbial communities that can be used to collect long and dense time series with highly controlled perturbations and replicated experiments.

Improving our understanding of the key mechanisms underlying community dynamics is a necessity to generate more accurate predictions, and ultimately to develop new techniques for the manipulation of complex ecological communities. We have combined theoretical analysis with computational simulations to explore the various facets of the influence of ecological memory and highlighted its often overlooked role as a key determinant of complex community dynamics.

## Supporting information

### Appendix S1

In the following, we detail the mathematical aspects of incorporating ecological memory into a non-linear extension of the generalized Lotka-Volterra model.

### Memoryless model

We used as a starting point the following memoryless model, introduced by [18]:
This model describes the dynamics of each microbial species abundance *X*_{i} according to its growth rate *b*_{i}, its death rate *k*_{i} and an inhibition term *f*_{i}, which is defined by interaction constants *K*_{ij} and the Hill coefficient *n* as parameters. *K*_{ij} represents the inhibition of species *i* by species *j*: the lower it is, the stronger the inhibition.

The interaction matrix **K** = {*K*_{ij}} was generated based on two alternative approaches. The first approach allocates the predefined species in three groups (see below and Fig 5 as in [18]), thereby setting different values of inter-group versus intra-group interactions. The second approach does not impose a predefined structure for the interaction matrix **K** (Fig S4).

### Three-group model

In the three-group approach, we define three sets of species indices by B (blue), R (red), and G (green). Each species *i* belongs to exactly one of these three groups. We define the growth rate of each group by the growth vector **b** = [*b*_{B}, *b*_{R}, *b*_{G}], where *b*_{B} = {*b*_{i} | *i* ∈ *B*}, *b*_{R} = {*b*_{i} | *i* ∈ *R*}, and *b*_{G} = {*b*_{i} | *i* ∈ *G*}. We also define the interaction matrix **K** = {*K*_{ij} | *i, j* ∈ *B or R or G*} such that *K*_{ij} only depends on the group memberships of species *i* and *j*, up to a slight noise (see Fig 5a and Appendix S2). We first considered a community of three species (*i*.*e*., only one species per group), and then a community of 15 species forming three groups with strong inter-group inhibition and weak intra-group inhibition.

If the inhibition strength is large enough (small *K*_{ij}), this model can have three coexisting stable states (tristability). This tristable community is dominated by either one of its three groups depending on initial species abundances, interaction matrix **K**, and growth vector **b**.

### Incorporating memory by fractional calculus

Fractional order derivatives have been successfully used to account for memory effects in many disciplines [32, 33, 67]. This approach requires defining a temporal kernel in dynamical models [32, 33]. The stable regions of fractional differential equations differ from the corresponding classical one [35, 68, 69] and thus induce significant differences in the stability landscape of a community model. Interestingly, *chaos* has been observed in a fractional population model [70], which exhibits a structure entirely different from typical dynamical attractors such as the Rössler or Lorenz attractors.

To introduce memory in ODE models, we replace the ordinary time derivative in system (1) by the fractional derivative . This leads to the appearance of a time correlation function (a memory kernel) which imposes a dependency between the current system state and its past trajectory. The past states of the system influence the current dynamics, giving rise to memory effects.

Let us now rewrite the initial model in (1) by employing fractional derivatives and the simplifying notation, as*F*_{i} = *F* (*t,X*_{i}) := *X*_{i}(*b*_{i}*f*_{i}({*X*_{k}}) − *k*_{i}*X*_{i}),as:
There are different definitions of fractional time derivatives for different purposes [71]. We use here the Caputo fractional time derivative [72],, as a control parameter of memory effects because of its intuitive interpretation. This derivative is defined by the following integral equation for a given function *g*(*t*):
in which is the fractional integral of order 1 − *µ* that is defined by
where Γ denotes the gamma function. Throughout this article, we quantify memory as 1 − *µ*.

### Model interpretation

To provide an intuitive interpretation of the new system equation (2), let us apply a fractional Caputo derivative of order 1 − *µ*_{i} on both sides of (2):
Because the Caputo fractional derivatives of order *µ* and −*µ* are inverse operators [73, 74], this simplifies as:
Equation (6) shows that for *µ*_{i} = 1 we retrieve the standard integer derivative model (1) as a special case of the fractional derivative model (2), since the fractional operator becomes the unity operator for a fractional order of 1. Furthermore, the right-hand side of equation (6) can be expressed as the fractional integral of order (*µ*_{i} − 1) on the interval [*t*_{0}, *t*], that is:
The system described by equation (7) is a transformation of the original system (1) with an additional memory contributions *µ*. When 0 *< µ <* 1, the time-dependent memory kernel guarantees the existence of temporal scaling behaviors which are common in nature. The memory kernel’s decay rate depends on *µ*_{i}: the lower the value of *µ*_{i}, the slower it will decay. This shows how imposing memory on the system equation (1) slows down community dynamics.

The derivative order *µ*_{i} can be used to control the strength of the memory so that when *µ*_{i} goes toward the integer value 1, the influence of memory decreases, and the system tends toward a Markov process. In the context of microbial communities, memory may thus counteract the effects of species interactions. In the memoryless case (*µ*_{i} = 1), the kernel becomes a Dirac delta function, *δ*(*t* − *τ*), which results in the integer-order integrodifferential equation of model (1).

In summary, the Caputo fractional derivative provide a means to incorporate ecological memory in a dynamical system based on a convolution integral with a power-law memory kernel. Besides, it could be modified by a time-delay reflecting the duration of memory effects and the kernel function shaping the memory weight [64].

### Numerical simulations

Adams methods provide commonly used numerical solutions for ODEs, involving implicit (Adams-Moulton) and explicit (Adams-Bashforth) linear multi-step schemes. We exploited in this paper the predictor-corrector method based on Adams formulae (see [75, 76]) and implemented it in MATLAB. The corresponding code is available on Zenodo [77].

Given the system equation (2), let us write **X** the set of all species abundances, ** µ** the corresponding vector of derivative orders

*µ*

_{i}, and

**F**the corresponding matrix function of all

*X*

_{i}(

*b*

_{i}

*f*

_{i}({

*X*

_{k}}) −

*k*

_{i}

*X*

_{i}). We can then rewrite the fractional order model (2) in the following matrix form: The initial value problem (8) is equivalent to the Volterra integral equation [73, 75]: We solved Eq. (9) using a product integration technique, in which we replaced the function

**F**(

*τ*,

**X**(

*τ*)) with piece-wise interpolating polynomials. For the grid nodes

*t*

_{j}(

*j*= 0, …,

*m*) with constant step size

*h*(

*t*

_{j}=

*t*

_{0}+

*jh*), we write

**F**

_{j}=

**F**(

*t*

_{j},

**X**

_{j}) where

**X**

_{j}is the numerical approximation to

**X**(

*t*

_{j}). The product rectangle rule [75] gives an explicit estimation of Eq. (9) as a predictor: and the product trapezoidal rule [75] provides an implicit estimation of Eq. (9) as a corrector: The last term of the sum in the corrector equation (11),

**F**(

*t*

_{m},

**X**

_{m}), is obtained by an approximation of

**X**

_{m}in the predictor equation (10). This method is called FracPECE: Fractional Predict-Evaluate-Correct-Ev [75]. Because its standard implementation was not sufficient considering the stiffness of the equation, we improved its accuracy via an advanced convolution quadrature [76], and via multiple applications of the corrector step [78] when required. Specifically, we used several corrector iterations when the difference between two consecutive iterations was larger than the desired tolerance of 10

^{−6}. We considered a time step size of

*h*= 0.01 or 0.005 for all simulations.

Note that since the model with fractional order derivatives (2) includes the standard model (1) as a particular case (namely, for integer derivative order), the numerical approximations (10) and (11) are also solutions to equation (1). The explicit solution (10)–or an assessment of the implicit solution (11)–shows how memory influences the fundamental system dynamics through the dependence on *µ*.

### Appendix S2

We provide in the Table below the detailed conditions and parameter values used in each of the numerical experiments presented in the main text. Additional methodological clarifications for figures 5c and S1 are given in the text below the table.

**Fig 5c**. Ternary plots allow representing the state of a 3-species or 3-group system by a single dot and therefore are a convenient way to display the outcome of many simulations at a time. In Fig 5c, each ternary plot shows the stable state distribution of the group relative abundances obtained for 50 different simulations, each represented by a dot of the color of the dominant group. We detail below how we computed the position of each dot in the triangle. Let us write *B, G* and *R* the average stable state relative abundances of the species in the blue, green and red groups, that is (and similarly for *B* and *G*), where *Z*_{i}(*end*) denotes the abundance of species *i* in group *Z* at the end of the simulation. Let us consider an equilateral triangle in which each vertex corresponds to the complete dominance of one group of species, as shown in the Figure above. Thus, a point (dot) close to the middle of the triangle indicates a state of the system characterized by relatively even species abundances. If *B* = 1 (100%) is placed at (*x, y*) = (0, 0) and *R* = 1 (100%) at (1, 0), then *G* = 1 (100%) is at , and any triplet (*B, R, G*) will be at . These Cartesian coordinates provide a way to map any triplet of group relative abundances to a unique location on the triangle.

Fig S1. Here, we randomly generated an interaction matrix **K** without predefined structure between *N* = 15 species. Specifically, we set *n* = 4 and *K*_{ij} = 1 − *e*^{−5z}, where *z* is a randomly generated number from a uniform distribution between 0 and 1. We generated 10 communities, each with a random vector of growth rates generated as *b*_{i} ∼ 𝒩 (1, 0.0025), ∀*i*. We used the same interaction matrix for all 10 communities, and death rates *k*_{i} = 2, ∀*i*. For each community, we set the initial values for species abundances *X*_{i} at one of the equilibrium points of the system (randomly chosen). To compute the dissimilarity of the community between times *t*_{r} and *t*_{p}, we used the Bray-Curtis distance, computed as