{'fraction_non_alphanumeric': 0.024730059212817835, 'fraction_numerical': 0.0074693293084097685, 'mean_word_length': 4.843509724106739, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Synthetic associative learning in engineered multicellular consortia

Associative learning is one of the key mechanisms displayed by living organisms in order to adapt to their changing environments. It was early recognized to be a general trait of complex multicellular organisms but also found in"simpler"ones. It has also been explored within synthetic biology using molecular circuits that are directly inspired in neural network models of conditioning. These designs involve complex wiring diagrams to be implemented within one single cell and the presence of diverse molecular wires become a challenge that might be very difficult to overcome. Here we present three alternative circuit designs based on two-cell microbial consortia able to properly display associative learning responses to two classes of stimuli and displaying long and short-term memory (i. e. the association can be lost with time). These designs might be a helpful approach for engineering the human gut microbiome or even synthetic organoids, defining a new class of decision-making biological circuits capable of memory and adaptation to changing conditions. The potential implications and extensions are outlined.


I. INTRODUCTION
A specially important component of adaptation in nature is based on the capacity of some living beings to respond to external signals by a proper combination of repeated exposure to stimuli and the potential for storing memories. One classical example is provided by early experiments on conditioning, also known as associative learning (AL) and is one particularly important example of a general class of processes involving associative memory (Walters et al 1979;Hassoun 1993). In these experiments, a given animal is known to respond automatically to an unconditioned stimulus (US) such as air puff in the eye that leads to eyelid closure. Instead, another stimulus such as a weak noise is unlikely to elicit a response. This would be an example of a conditioned stimulus (CS). In a nutshell, associative learning occurs when both stimuli are simultaneously presented, in such a way that a repeated exposure to both stimuli creates a cognitive link. At some point the exposure to only CS leads to the response that was originally limited to US: the weak noise triggers eyelid closure.
Conditional learning is part of the enormous potential exhibited by organisms having neuronal systems and might have been a crucial innovation in the evolutionary history of multicellularity (Ginsburg and Jablonka 2010). Many forms of adaptation are grounded in neuronal circuits capable of creating correlations between different events, providing a plastic and reliable way of predicting future changes (Grossberg 1988;Gerstner and Kistler 2002). Most of these examples involve the presence of a neural circuitry, but the phenomenon seems to * Corresponding author be also at work in non-neural agents. For example, microorganisms are capable of dealing with environmental correlates and perform decision making tasks . This includes in particular molecular mechanisms responsible for information processing (Bray 1995;Buchler et al. 2003). A relevant question here is how could we synthetically enhance the cognitive complexity of microorganims and how this can gives insight into the origins and evolution of microbial inteligence (Solé 2016). The potential for designing living systems has been rapidly improved in the last decade. Among the most promising areas where such engineering of microbial intelligence can be crucial is the engineering of the human microbiome (Huttenhower et al 2012; Ackerman 2012; Ruder et al 2011). Treatments and recoveries from disturbance have been shown to be transitions among alternative states (Costello 2012, Pepper and Rosenfeld 2012). Mounting evidence reveals that this complex ecosystem is relevant in many pathological states and that engineered microbes could be designed to detect and cure microbiome-related disorder (Sonnenburg 2015). Since we are often dealing with complex diseases, such as inflammatory processes, these need to be smart bacteria, capable of delivering drugs under the required conditions but also shut off once the inflammation is eliminated. This is more obvious if we take into account the enormous cross-talk that has been identified between microbial and human cells (Blaser et al 2013) particularly in relation with the gut microbiome and the nervous and immune systems (Andrey Smith 2015). Engineering such microbial circuits is a major challenge that requires moving beyond the sense-and-deploy framework.
Building complex decision making circuits within a single cell is a challenging task but several candidates have been suggested (Amos 2004 . These studies propose different ways of approaching the problem of building synthetic systems capable of diverse forms of bacterial intelligence. One example is the associative learning circuit presented by Fernando and co-workers that could be implemented in E. coli as a model organism (Fernando et al 2009). It was inspired in previous theoretical studies that used model neural networks to explain the process under a minimal set of assumptions. In this case, the problem with the proposed design (as well as many others) is that it requires engineering several interactions, tuning the connectivity matrix of the molecular network, with all the problems derived from cross-talk (Kwok 2010).
In this paper we aim to provide a simple short cut to this problem, by using cellular consortia of cells that are used as basic modules, each one containing a small amount of engineering. This approximation has been successful in different contexts (Regot et  In the next section, we describe the logic of our system design in order to illustrate its simplicity. Next, a potential implementation using a computational model for E. coli will be described.

II. THE LOGIC OF MULTICELLULAR LEARNING
A synthetic circuit capable of associative learning requires some type of modulation of internal states through the learning process. Since the circuit responds to one signal (US) but not the other (CS) unless they have been previously presented together, this indicates that the internal states of the underlying molecular circuit must have changed. In figure 1a we show an example of a genetic implementation of AL introduced in (Sorek et al 2013). This work proposed a design inspired in neural networks. Here X can activate the response R whereas Y will do it (when X = 0) only if an intermediate module M (that needs to be previously activated by X + Y ) has the right expression level. This kind of design and others of similar inspiration (Fernando et al 2009) rely, if implemented inside one cell, a sophisticated wiring.
One of the most fundamental requirements for associative learning is memory, and designing synthetic circuits ). This module has been extensively studied and characterised and is one of the best known components in cellular engineering. Since a molecular switch is capable of storing two alternative states, we use it here as a key piece of our proposed multicellular circuit. This introduces a restriction within the design of the system in relation to previous models. In  order to illustrate how we perform our implementation, in figure 1b we represent a basic wiring diagram where two inputs are indicated as X and Y , corresponding to the unconditioned and conditioned signals, respectively. The diagram in figure 1b presents some similarities with the one in figure 1a. We will assume here that the switch has an internal, initial state, with B = 0 and A > 0. If X > 0 and Y = 0, a response will be observed since the response unit receives direct and positive stimulation from X. Instead, since A inhibits the potential activation from Y , a signal coming inly from Y will not trigger response. However, if both X and Y activate X, it can toggle the switch, inactivating (or under-expressing) A. Once this simultaneous activation occurs, the system is ready to react to Y only. This defines the basic logic of our implementation, but we have split the circuit in two parts (figure 1c) corresponding to a learning cell, C 1 , carrying the toggle switch and a producer cell C 2 , that is wired to C 1 through a molecular wire A. As can be seen, we maintain the same scheme, but use cells as modules that allow to reduce the complexity of the engineering. In the next section, we make an explicit case for a microbial consortium capable of AL.
Because of the large number of equations involved, little mathematical developments can be performed and the solutions will be numerical. However, it is possible to see how the model works (and predict the key outcomes) by using a simple Boolean circuit as the one indicated in figure 1c. Here we use a discrete dynamical system based on a threshold network where all states are either 0 or 1. A reporter signal (OU T ) with two possible states provides the result of the computation. In the middle of the circuit we have located a module involving cross-repression of two elements (A and B) one of which can also modulate (through an inhibitory interaction) the effect of Y on the output. We can actually represent these interactions in terms of a Boolean dynamical system, where the state of each element S i (t) ∈ {X, Y, A, B, O} at a given step t (assuming time is discretized) follows a discrete thresh- The logic of a two-cell associative learning circuit. In (a) an example of a "standard" implementation, following neural network principles, is shown (redrawn from Sorek et al 2013). In (b) we summarize the basis of the circuit presented here, that exploits the presence of a toggle switch (indicated in gray). Two inputs are present, X and Y indicating unconditioned and conditioned signals, respectively. The circuit can be split in two parts corresponding to two engineered cells (c) here indicated as C1 and C2. In (c-d) the proposed implementation of the synthetic consortium is shown. Here the two cells (d, producer, e, learning cell) communicate in one direction by means of a molecular signal (A). Each engineered cell type performs part of the processing required to implement the association mechanism. We have used specific genes, cell-cell communication signals and reporters, but the basic principle can be used in different contexts (see text).
old dynamics: Here the connections among different pairs are indicated as W ji and can be positive or negative, indicating activation or inhibition respectively (Grossberg 1988). In figure 1a we have included an example of possible weights for our system. The thresholds θ i provide a condition for the total input in order to trigger a response. This is defined by the threshold function Θ(x) which gives Θ(x) = 1 if x ≥ 0 and zero otherwise. This ideal function is a limit case of the standard cooperative functions used in models of genetic networks (see section III). For the circuit described in figure 1, our (discrete) equations are written as follows: It is possible to show, following the discrete steps of this Boolean model, that an associative learning dynamics is being satisfied. The sequence of states associate to the consortium displayed in fig 1c is shown in Table I, where the set of possible input pairs (X, Y ) and the (A, B) the states of the elements defining the memory switch (SM).

III. ASSOCIATIVE LEARNING IN A SYNTHETIC MICROBIAL CONSORTIUM
In order to avoid undesirable effects derived from complex constructs, cellular consortia, where different parts of the computation are split into different engineered cells, can be used as an alternative to single-cell designs. An example of such synthetic consortium is displayed in figure 2(d-e). It combines both constitutive and regulated gene expression and splits the circuit complexity in two separated cells. As summarised in figurers 1b-e, the required behaviour is split into two basic modules, each one using a different engineering. Although we will assume that the two cell types belong to the same species, this is not a necessary condition. Each cell in this consortia acts as a separated chassis for a subset of the required circuit. In our proposed implementation, we will use available information concerning well established constructs and parameters gathered from the available literature and take E. coli as our model organism. Several potential candidates could be used as inputs, such anhydrotetracycline (aTc) as our non-conditional stimulus (X) and Acyl homoserine lactone (AHL) (produced the gene luxI from the V. fischeri quorum sensing system) as a conditioned stimulus (Y ). In presence of this stimulus there is not response unless the system has established the association between X and Y . In a nutshell, whereas X alone always induces a system's response, Y does not. The computational model requires an explicit definition of the mathematical equations for each cell, as well as the consideration of the We have chosen a fluorescent protein as the candidate for the cell's output, although this could be some gene that triggers the delivery of a given therapeutic molecule. LuxR is a transcriptional activator from the V. fischeri quorum sensing system that binds to its cognate promoter Plux activating the expression of genes under its control. The wild type LuxR is inactive when produced. Acyl homoserine lactone (AHL), produced by another gene, luxI, is an autoinducer that binds LuxR and increases its activity.
The mathematical model associated to the cellular consortium displayed in figure 2 is decomposed in two sets of equations. Both cells have X and Y as inputs, but the nature of their responses is markedly different.

A. Producer cell equations
For the producer cell, we have five coupled differential equations, describing the basic interactions indicated in figure 1d. These equations are standard in the modelling of gene regulation networks (Ingalls 2103). Here we have a feed-forward set of interactions described by: which is a constitutive gene (here P c will indicate a constitutive promoter). The dynamical equations for the rest of components in our cellular circuit read: And the equation for the response dynamics, described by the concentration of our reporter, is defined by: The along with the Hill inhibition function: In particular, we can see that the reporter will be active if no repression from TetR is at work. Either by inactivation of TetR or by the presence of X, the response will be observed.

B. Learning cell equations
For the learning cell (figure 1e) we consider a different set of equations. Here two genes are expressed constitutively thus involving linear equations: which provide the gene products that will interact with X and Y within this cell under the nonlinear equtions We have also the well-known equations for the toggle switch defined by the pair: Which have two alternative states. Finally the linear equation for the production of the molecule A, used in our first model as the communication signal among the two cells:

C. Cell-cell communication wire
A final component needs also to be taken into account: the diffusion of the wiring molecule A responsible for the intercellular connection. The last equation above only considers the production within C 2 , but it is shared with cell C 1 by diffusion and is also present in the extracellular medium (A e ). Thus we need to write three equations that account for the dynamics of A in each compartment (see figure 2). The complete equations read: (20) corresponding to the two cells and the extracellular medium, respectively.

D. Associative learning dynamics
The previous equations start from an initial condition where the toggle switch is displaced towards cI. This defines the memory state of our system at time zero. Each input is introduced in the system in a pulse-like way. In figure 2 we show a typical example of the numerical experiment consistent with an associative learning process. The left diagram (figure 2a) provides a schematic representation of all the interactions and figure b shows the time series obtained from the model. We first start by introducing X but not Y . This leads to a response as shown by the pulse in GFP, which disappears as X is also removed from the system. The positive response is easy to understand, since the only pathway being affected leading to GFP is indicated in figure 2c, whereX blocks the inhibition of the reporter from T etR.
Afterwards, we do the same experiment with Y but in this case no active reporter is seen. The repressor of GFP 0 FIG. 3 Phase space of the associative learning two-cell design and their output time series. Depending on the production rate of LacI (γLacI ) and the production rate of LacI under CI regulation (γ λ ) there are four different response behaviours. (A.) Non learning situation; the system responds to the unconditioned stimuli (X) (blue region), the system is unable to respond to the conditioned signal (Y ) even after the conditioning stimuli process.(B.) Damped learning; the learning cell has a temporal association (turquoise), the producer cells only respond to the conditioned signal for a limited time after the conditioning. (C.) Associative learning region (yellow), the learning cell change the state of the toggle switch after the simultaneous stimulation with X and Y signals, then the system have learned. (D.) Learned system (orange); the system responds to the unconditioned (X) and conditioned (Y ) signals independently before the conditioning process pulses. The time series of the other variables can be seen at the supplementary figures 3-6. The parameters are the same than in previous figures; the phase space is performed with a 400x400 latice.
acts with no inhibition (figure 2d) and the paths affected by Y do not propagate. The crucial change occurs when the two inputs are simultaneously correlated. Here the reporter is again activated (top of diagram e) as it happened in the first X-only pulse. However, the effect of the simultaneous input on the toggle switch is that the state of the cI-LacI pair switches to the opposite state, where CI is now expressed and LacI repressed. This is the internal state that has changed as a consequence of the correlated stimulus and will remain in this state once we remove both inputs.
Once the previous pulse has been applied and both inputs removed again, we can see the effect of these correlated input when the conditioned, Y signal is introduced in the absence of the unconditioned one. Here the stored memory state in the toggle switch has a very different impact. In this case, this state is not changed, but allows the propagation of the effects of Y to the producer cell, where cI is produced, repressing TetR and thus allowing GFP to be expressed. The consortium has created an association (thanks to the toggle) that essentially modifies the system's response to the conditioned state.
The model presented above has been analysed using a given parameter combination. What is the effect of other parameter values on the dynamical response of the consortium to other parameter combinations. Two parameters in particular are relevant to our exploration of the response of the system. These are the production rates γ Lac and γ λ . By exploring the (γ Lac , γ λ ) parameter space (fig 3a) using a wide range of parameter values i. e. 10 −4 ≤ γ Lac , γ λ ≤ 10 0 . Four dynamical phases are found, which are associated to four different types of responses to the incoming stimuli.
As in previous sections, the synthetic consortium receives a sequence of inputs where the unconditioned stimulus X is used first, followed by the conditional one Y and then both together. Afterwards, pulses of Y are introduced and the type of output response is used to classify the circuit's behaviour. The right panel in figure 3 shows examples of the output response for each phase as the sequence of stimuli is introduced. The four classes are captured by the time series associated to each one (A-D) in figure 3 right. No learning occurs within one phase where there is only unconditional response. In a second phase (Damped learning, B, see figure 3 left) a small responses is observed suggesting association, but it is rapidly lost after one weak response to the conditional stimulus. A yellow domain points to the associative learning parameter space whereas the domain of learned systems is associated to responses by both stimuli, no matter how are they presented. The plot has been created on a log-log scale, and thus we can see that a broad range of parameters are consistent with this behavior.

E. Supresing associative learning
Once the association has been established in our circuit, as it occurs with conditioned learning in animals, the switch is locked in a given state that allows the association to be stable over time. However, if this is a circuit that has been designed to respond to unconditional stimuli once the inputs of both kinds are presented simul- taneously. It can be interesting to return to the initial state where the consortium has not yet The LacI protein have one well known inhibitor, the IPTG molecule, which where ξ = IP T G/β IP T G . A pulse of IPTG makes inhibition of the LacI function. Then, the CI promoter is active again leading to an inversion of the toggle switch LacI-CI. After this process the conditioning have been lost.

IV. DISCUSSION
One of the challenges synthetic biology is to make possible the reprogramming of cellular behaviour by means of a predictable, engineered manipulation of the available molecular toolkit. The potential of such engineered molecular networks is great, and cover a wide range of areas, from standard biosensors to complex decision making circuits able to gather a range of external stimuli from the environment and respond according to a predefined set of rules. An important goal is to provide these engineered systems with the appropriate adaptation potential, which necessarily requires the use of learning and memory. In this context, the potential for recapitulating the evolutionary innovations by building synthetic circuits provides a unique opportunity for the study of major transitions (Solé 2016).
The proposed synthetic systems presented here show that the use of a cell consortia can help designing complex decision-making biological circuits capable to cope with external signals and their changes. The human microbiome provides an ideal testbed for these kind of synthetic designs. If the metaphor of this as a "second brain" becomes valid, then what we are suggesting is to introduce pieces of computational complexity to play an active role within the network of microbial interactions. Our example also combines the internal machinery that responds to external signals (which could be drugs) with a flexible design capable of exploiting the history of previous events. This basic scheme can be generalised to more complex designs. Future work should test the experimental feasibility of our approach as well its scalability.
The circuits proposed above assume that the two-cell consortium is obtained by engineering the same class of model organism, but this is not required for our purposes. Mixed consortia involving both microbial and human cells could be constructed, and other possibilities are also available, including the design of symbiotic consortia between soil microorganisms and plant cells (or nitrogenfixing microorganisms living within plant nodules) as potential strategies of ecosystem repair . Concerning diseases associated with a malfunctioning microbiome, our results suggest that both permanent and transient modifications of some engineered strains could help to dynamically control some key pro-  (FIG.1a). b. Damped learning synthetic circuit. Bellow each diagram, there is the phase space relating the parameters with the behaviour exhibited: (A.) There is response to the unconditioned signal. (B.) Damped learning, there is a characteristic time where the two cells system responds to X and Y , afterwards the system does not respond to the unconditioned signal. (C.) Associative learning, once the cells are stimulated simultaneously by both molecules (X and Y ), the system responds either the conditioned or unconditioned stimulus. The mathematical models are exposed in the Supplementary Material. The parameters are set to the same values than in FIG.2. The phase space are lattices of 400 units per parameter, excepting the number of copies of LasI given that this parameter is discrete.
cesses requiring memory and learning. This is an interesting possibility given the feedback existing between both the immune system and the brain as connected with the microbiome (Mayer et al 2014; Sampson and Mazmanian 2015). Since both immune and brain networks are capable of displaying learning and memory, microbial consortia as the ones presented here could act as extensions of neural-like decision circuits.
Finally, another interesting possibility concerns the design of synthetic learning circuits that could be incorporated within organoids (Lancaster and Knoblich 2014). Such enhanced cognitive complexity seems a desirable trait of future designed organoids and allow to move away from natural designs, thus reaching some unexplored regions of organ space (Ollé-Vila et al 2016).

V. ACKNOWLEDGEMENTS
We thank the members of the Complex Systems Lab for useful discussions. This work has been supported by an ERC Advanced Grant Number 294294 from the EU seventh framework program (SYNCOM) the Botin Foundation by Banco Santander through its Santander Universities Global Division, the Secretaria d'Universitats i Recerca del Departament d'Economia i Coneixement de la Generalitat de Catalunya, a grant of MINECO, FIS2015-67616-P and by the Santa Fe Institute.