## Abstract

DNA has proved to be an exquisite substrate to compute at the molecular scale. However, nonlinear computations (such as amplification, comparison or restoration of signals) remain costly in term of strands and are prone to leak. Kim *et al.* showed how competition for an enzymatic resource could be exploited in hybrid DNA/enzyme circuits to compute a powerful nonlinear primitive: the winner-take-all (WTA) effect. Here, we first show theoretically how the nonlinearity of the WTA effect allows the robust and compact classification of four patterns with only 16 strands and three enzymes. We then generalize this WTA effect to DNA-only circuits and demonstrate similar classification capabilities with only 23 strands.

## 1. Introduction

Intense efforts have been devoted to building synthetic molecular circuits, *in vitro* or *in vivo*, in part to understand and control biological processes [1–3]. DNA, because of its programmability and biocompatibility, has emerged as the substrate of choice to build complex structures [4–11], or to compute and actuate elaborate functions [8,12–22]. In particular, strand displacement has proved an exquisite mechanism to orchestrate the hybridization of DNA strands [23–29]. In this mechanism, a strand of DNA (the output) is selectively displaced from a gate by the action of one or several strands (the inputs) [30–32]. Efforts in DNA-based molecular programming have culminated in the construction of a variety of molecular systems [33–35], including large-scale [36,37], reversible [38,39] and reprogrammable circuits [13,40], as well as circuits multiplying matrices [41] and neural networks [42]. Besides those DNA-only circuits, hybrid DNA/enzyme circuits have been reported recently. Such molecular networks—which use DNA for encoding function and signalling but enzymes for production and degradation of signals—have emerged as a general approach to construct circuits with dynamic behaviours such as oscillations or bistability [43–49].

Most logic circuits require nonlinear computations, such as the amplification, restoration or comparison of signals, which are often the most difficult parts of a circuit to implement. Here, we show how to exploit nonlinear chemical effects to naturally compute nonlinear functions in DNA circuits with a low number of strands. Kim *et al.* theoretically demonstrated that competition of autocatalysts for a common enzymatic resource generates a winner-take-all (WTA) effect that digitally compares concentrations by amplifying infinitesimal differences (figure 1; [50]). We generalize this effect by demonstrating theoretically WTA circuits with DNA strands only. Furthermore, we illustrate the benefit of competition with a DNA-only classifier that uses only 23 strands to recognize four patterns and their corrupted versions, and a hybrid DNA/enzyme circuit that does the same with only 16 strands. We attribute this compactness to the essential features of nonlinearity, generality and invariance of WTA circuits.

We first describe the classification of patterns with WTA hybrid DNA/enzyme circuits. Competitive effects naturally appear in enzymatic systems, because enzymes are resources that are often shared by a great number of substrates [50–53]. Our classifiers are structurally similar to Hamming classifiers, in which a layer computes Hamming distances (the number of bits that are different) between stored and inputted patterns, and another layer selects the minimal distance [54]. Our general architecture is the following. A strand displacement layer computes several pseudo-weighted sums of the inputs. This linear layer controls a nonlinear layer that performs all nonlinear computations through a WTA circuit [55]. The nonlinear layer amplifies the maximal sum at the expense of the others, digitizing the outputs. The circuit exhibits a peculiar structure: the outputs are globally coupled, although there are no explicit connections between them.

The chemical reactions used for the computations are shown in figure 2. The chemistry is based on the enzymatic toolbox of Montagne *et al*. [45]: protected single-stranded DNA templates encode the topology of a circuit, directing the enzymatic production of transient signal oligonucleotides. The input strands *X _{i}* represent digital variables: their initial concentrations [

*X*](0) can be either 0 (FALSE),

_{i}*c*

_{0}(TRUE) or 0.5

*c*

_{0}(ambiguous input), the latter modelling corruption of an input. The summation operation is based on the mass action kinetics of strand displacement. An input

*X*displaces an inhibiting strand

_{i}*I*from a weight complex

_{i}*W*=

_{ij}*I*:

_{i}*T*to yield an activated template

_{j}*T*: 1.1

_{j}The mass action constant of strand displacement *k _{f}* is 10

^{6}M

^{−1}s

^{−1}, which gives a half-time of displacement of approximately 10 s for

*X*and

_{i}*W*in the 100 nM range [56]. Because mass action kinetics are linear in each reactant, the concentration of released template

_{ij}*T*varies approximately linearly with

_{j}*X*, thus mimicking a weighted sum. This can be easily seen when the input strands are in large excess (), and the level of inputs is either 0 or

_{i}*c*

_{0}(no ambiguous inputs). After completion of displacement, the amount of active template [

*T*](

_{j}*∞*) is [

*T*](

_{j}*∞*) =

*∑*min([

_{i}*W*](0), [

_{ij}*X*](0)). Because [

_{i}*X*](0) is either 0 or

_{i}*c*

_{0}, [

*T*](

_{j}*∞*) will simplify to the weighted sum

The enzymatic layer uses the dual-repeat templates *T _{j}* produced by the linear layer to replicate outputs

*Y*[45]. This replication proceeds as follows: the template

_{j}*T*(reversibly) binds to

_{j}*Y*to form a primer–template substrate, which triggers the elongation of

_{j}*Y*by the polymerase. A nicking enzyme recognizes this duplex and cuts one of its strands to yield two bound output strands

_{j}*Y*, which spontaneously unbind from the template (the inhibitor strand is chemically protected from being nicked). The temperature and lengths of domains are chosen so that outputs—but not inhibitors—spontaneously unbind from the templates on the experimental timescale. As a rule of thumb, eight nucleotides for domain 1 and 4 nucleotides for the specific domain of

_{j}*Y*should be appropriate and provide enough room to accommodate four different sequences of outputs. Inputs and templates are chemically protected from degradation, for example by phosphorothioate backbone modifications [45].

_{j}The net reactions for *Y _{j}* are as follows. For the reversible binding, we have
1.2

The binding of a template *T _{j}* to its output

*Y*is designed to be reversible, with a fast equilibration (less than or equal to 1 s) and a large dissociation constant (

_{j}*K*

_{b}= 1 μM). We thus have . Kinetic and thermodynamic constants are taken to be identical for all templates, outputs and inputs. Regarding the enzymatic steps, we have 1.3for the replication and decay. The polymerase has a Michaelis–Menten constant

*K*

_{m}= 40 nM. At full speed, the polymerase replicates outputs at a rate of

*V*

_{max}= 10 nM s

^{−1}. The output strands are degraded by an exonuclease, assuming a first-order degradation with a rate of

*k*

_{r}= 0.01 s

^{−1}. We assume nicking is much faster than polymerization, which becomes the kinetically limiting step. The production of DNA is therefore approximated by a competitive Michaelis–Menten model for the polymerase. We assume that the degradation of DNA is first order. This yields equation (1.4), governing the evolution of the concentration of output strands 1.4Competition is reflected by the presence in the denominator of all outputs

*Y*that use the polymerase [52]. We base our discussion and simulations on biochemical constants found in the literature [45].

_{i}The WTA effect is a nonlinear kinetic effect that amplifies selectively one output to the detriment of the others. It spontaneously emerges when several outputs compete for the polymerase (figure 1). The higher the level of an output, the higher the fraction of polymerase it sequesters. This nonlinear feedback reinforces the output with the quickest replication rate and gradually evicts other outputs—leaving only one output at the steady state [50,53]. From a perspective of signal processing, the WTA effect is a perfect nonlinear primitive to digitize signals. We use WTA effects to compare the replication rates of species, amplify the fastest and suppress the others, thereby instantiating the response of the circuit.

Because the autocatalysis is first order (only one *Y _{i}* is required to catalyse the production of a new

*Y*), the WTA circuits have an important property of invariance: the winning output

_{i}*Y*depends only on the kinetic parameters and the steady-state concentration of templates, and not on the initial concentrations of outputs [53,57]. (The situation would be different for higher-order autocatalysis [50].) Any large excess of a slowly replicating output will eventually be overcome by a tiny fraction of another output replicating faster. Because all kinetic parameters are assumed equal, the winner is determined solely by the concentration of activated templates. Thus, the winner is unchanged by a shift of all templates concentrations by a common constant (figure 1

_{j}*e*). This invariance

*a priori*allows all the weights to be positive, and surmounts a limitation of molecular circuits, which cannot easily handle negative values because concentrations are always positive. Molecular engineers often overcome this limitation with a dual-rail representation: the positive and negative parts of a signal are carried by two distinct species [37]. Unfortunately, the dual-rail representation complicates the synthesis and debugging of logic circuits because it doubles their size [37,42]. Our circuits do not require negative values, because we constrain the weights to be positive in the selection algorithm.

The general structure of the classification circuit is shown in figure 3. It takes as input the answers to four questions about a scientist and returns as output the corresponding scientist (following the game proposed by Qian *et al.* [42]). Input strands *X*_{1} … *X*_{4} encode the answers of a human player to the questions. The circuit's answer is given by the surviving output strand *Y _{j}* at the steady state.

We found the weights using a randomized search based on the perceptron algorithm (see the electronic supplementary material). For the simulations in figure 4, the concentration of *c*_{0} is 300 nM, and the concentration of the weights is (in nM):
1.5

The sum of a column *j* in *W* gives the maximal amount of template *T _{j}* produced when all inputs are present in large excess. Simulations of a hybrid DNA/enzyme circuit that classifies 36 patterns (four correct and 32 corrupted) are shown in figure 4. The patterns are the same as electronic supplementary material, fig. S15 of Qian

*et al.*[42]. We model the corruption of an input by injecting an ambiguous concentration of 0.5

*c*

_{0}rather than 0 or

*c*

_{0}.

For large and random patterns, an algorithmic search for the weights is probably not needed. Indeed, for Hamming classifiers, the pattern matrix (or its transpose, depending on how it is defined) always provides correct weights [54]. In our case, the pattern matrix should be an appropriate weight matrix for large and random patterns. Indeed, consider a set of patterns *X ^{j}* with

*N*bits, each bit of each pattern being chosen independently and randomly to be 0 or 1. We have where the brackets denote the average value of the dot product. Thus, for two distinct patterns

*X*and

^{a}*X*, the average of (

^{b}*X*−

^{a}· X^{a}*X*) is on the order of

^{a}· X^{b}*N*, whereas its standard deviation is on the order of . For a large number of bits

*N*, it is extremely unlikely that there will exist a spurious pattern

*X*such that (

^{b}*X*−

^{a}· X^{a}*X*) < 0 and the weight matrix will provide satisfying weights with a high probability. Note that for small patterns such as those used here, this approach will not necessarily yield correct weights. For example, the pattern 1111 would win for all presented inputs if we used the pattern matrix as a weight matrix.

^{a}· X^{b}Note that the steady-state level of the winning output varies according to the pattern presented. This occurs because the concentration of template released also varies between patterns. In order to obtain a truly digital behaviour, a set of threshold/amplifying gates could be added downstream to normalize the concentration of outputs [36,37].

The classification is robust to corruption of patterns; it classifies without errors all the presented correct and corrupted patterns (similar to Qian *et al.* [42]). The classification is quick; it takes about 5–15 min for the winning output to reach 50 per cent of its steady state. For comparison, the half-time for similarly complex computations with a DNA-only circuit ranges from 30 min to 10 h [34,37,42].

An interesting metric for a DNA circuit is the number of strands required for its construction. This gives a proxy for the practical complexity of the synthesis and preparation. Note that similar but distinct metrics, such as the number of DNA complexes or the total number of base pairs, also inform on the experimental complexity of DNA circuits. According to the strand count, our hybrid circuit is remarkably compact: it classifies four patterns and 32 corrupted versions with only 16 strands (four inputs, four templates, four outputs and four inhibitors). As a point of comparison, we can compare our circuit with some propositions [50] or demonstrations [42] of Hopfield associative memories (which are however recurrent classification circuits). The memory of Qian *et al.* [42]—which recognizes and completes four-bit patterns—is built from 71 strands (112 strands with the reporters) [42]. The proposal of Kim *et al.* for the construction of an associative memory with a hybrid DNA/enzyme circuit would require 28 strands [50].

Three factors contribute to the compactness of our circuit based on enzymatic competition. First, DNA strands serve only to encode the circuit, whereas enzymes are in charge of the digitization machinery. In DNA-only circuits, a DNA machinery specific to each gate is in charge of digitization [34,36,37]. Second, competitive inhibition between *n* outputs usually requires *O*(*n*^{2}) connections between them. We do not need those mutual connections, because the WTA effect is a general and global effect: the variation of one output immediately affects the replication rate of all others. The polymerase acts as a means to communicate information between outputs. Similar use of subtle physical effects to implement WTA effects in electronic circuits has been demonstrated [58]. Finally, the invariance property of the WTA effect dispenses with the use of dual-rail logic, which roughly doubles the size of logic circuits. More generally, our circuits highlight how neural networks are a promising paradigm for molecular computation, given their capacity to encode a larger number of functions with fewer species than Boolean circuits [42].

However, there are important differences between the recurrent circuits of Qian *et al.* or Kim *et al.*, and the circuits presented here. First, our classification circuit is feed-forward (it associates an output to a set of inputs), whereas the circuits of Qian *et al.* and Kim *et al.* are recurrent (they complete their inputs so as to converge to a stable pattern). Thus, if we require some information about the bits of the classified patterns (turning our classifier into a memory), a look-up table is needed, which will increase the size of the circuit. Conversely, if we need to interpret the result of recurrent circuits (turning the memory into a classifier), then a look-up table is equally needed. Second, the storage capacity of Hopfield memories is limited, growing sublinearly with the number of bits in the patterns [59]. The feed-forward circuits presented here could potentially store many more patterns, because they are structurally similar to Hamming classifiers (which use positive or negative values for weights and inputs) and whose capacity grows exponentially with the number of bits in the patterns [60]. Third, the distributive architecture of recurrent networks confers them robustness to deletion of strands. By contrast, in our feed-forward circuit, omission of an output in the preparation of the circuit will prevent this output from competing, thus effectively erasing the corresponding pattern from the classifier.

The competition leading to a WTA effect is not limited to enzymes and applies equally to amplification mechanisms based on DNA only. It is straightforward to enforce competition in synthetic DNA circuits, because strands with common domains can easily be designed, thanks to the modularity of Watson–Crick base pairing.

Figure 5 shows how to exploit competition for a fuel strand in order to perform the WTA effect in DNA-only systems. First, inputs displace outputs from weights strands (similar to the way inputs release templates in figure 4). 1.6

The rest of the circuit is based on the strand-exchange mechanism of Zhang *et al.* [31]. The autocatalytic outputs compete for a common fuel and are continuously sequestered by threshold gates [42].
1.7and
1.8Those processes replace the continuous production–degradation of DNA in hybrid circuits. The crucial point is that all outputs cannot survive, because there is not enough fuel to saturate all the respective thresholds, [Th* _{j}*](0) < [Fuel](0) <

*∑*[Th

*](0). The fuel becomes a limiting resource for the replication of outputs. Intuitively, this shortage of fuel should lead to a competition between outputs that nonlinearly amplifies small differences, leading to a WTA effect. Contrary to the hybrid circuits, the winner of this competition should depend on initial concentrations, because exhaustion of fuel will stop amplification before the circuit has had enough time to ‘forget’ its initial state. Because the concentrations of gates and thresholds are initially identical for all outputs, we expect that the initial concentration of outputs will determine the surviving output after exhaustion of fuel. The DNA-only circuits are compact for reasons similar to the hybrid circuits (no dual-rail, nonlinear and global nature of competition). They require the synthesis and mixing of 23 strands, which should allow their fast preparation. An experimental implementation of this scheme should be careful of potential cross-interactions between components. For example, the toehold of the weights may initiate an invasion of the amplification or threshold gates through a four-way branch migration (the speed of which is greatly reduced in a magnesium buffer [61]).*

_{i}We used visual DNA strand displacement (Visual DSD) [62–64] to simulate this circuit and verify numerically the existence of a WTA effect (code in the electronic supplementary material). Inspired by model-checking in computer science, Visual DSD automatically compiles and simulates strand displacement reactions from a domain-level definition of strands. We used the standard kinetic parameters and default compilation of Visual DSD. All toehold domains have identical lengths and binding constants.

The response of the circuit to the 36 patterns is computed in deterministic mode, without leaks simulated (figure 6). After a transient period of about 15 min, the output corresponding to the presented pattern emerges as the winner for the majority of patterns. The final concentration of the winning output is a small fraction of the total amount of output produced; the vast majority of outputs are sequestered by their threshold gates. The final level of the winning output varies by a factor of 10, a larger ratio than for the hybrid circuit. For some patterns, all the outputs decay (such as ??10, 0??1, ??0?), or a winner exists but with a very low level (?00?). Note that while we have found numerically conditions in which a WTA effect occurs in DNA-only circuits, it is not guaranteed that a unique winner will exist whenever competition for fuel occurs. The competition condition ([Th* _{j}*](0) < [Fuel](0) <

*∑*[Th

*](0)) does not exclude cases where a winner may fail to emerge, or more than one winner may exist. Thorough analytical studies are needed to better understand the regimes that lead to it.*

_{i}Strand displacement is prone to leak, which is thought to arise mainly from blunt-end displacement (displacement of a strand from a duplex without the assistance of a toehold) [32,65,66]. Leak is especially problematic for first-order autocatalytic circuits because they amplify exponentially even a miniscule leak (contrary to second-order amplification which occurs only above a threshold, in the presence of first-order degradation) [31]. Yet, we expect our classification circuit to be robust to leak because of the invariance of the WTA effect. A small, uniform leak of outputs will shift their levels by a common concentration, which should not change the winner. Note that there are limits to the invariance of the DNA-only circuit, because shifting the level of all outputs by a very large concentration will annihilate the WTA effect, because all thresholds will be saturated.

Fully simulating all possible leak reactions is prohibitive for deterministic simulations, so we simulated the circuit with the just-in-time mode (which performs stochastic simulations and compiles reactions on-the-fly) in order to evaluate the robustness to leaks [62,67]. Figure 7 shows the effect of increased leaking rates on the circuit. For the standard rate of leak of 1 M^{−1} s^{−1} [56,66], the classification is robust, and only the correct winner persists. For a stronger leak rate of 10 M^{−1} s^{−1}, the correct winner initially dominates, but after a dozen of minutes, the levels of all outputs drift upwards. This is not unexpected as strong leakage should accelerate the convergence of such single-use circuit towards a thermodynamic equilibrium, in which the concentration of all free outputs is non null (see figure 7 right). Similar drifts in DNA circuits have been observed experimentally before [23,31,34,37]. The robustness of WTA circuits to moderate leakage, which we probed at the stochastic level for technical reasons, is a property that we expect to be true at the deterministic level.

We have presented two implementations of the WTA effect in synthetic DNA systems. While they both use autocatalysis and competition for a resource, their properties are different. The hybrid DNA/enzyme circuit used competition for an enzyme, whereas the DNA-only circuit used competition for a fuel. The winning output of the hybrid DNA/enzyme circuit was determined by the concentration of template released and was independent of the initial concentration of outputs. In the DNA-only circuits, the winning output was determined by the initial concentration of output *Y _{i}* released (all gates have equal concentrations). Those differences in design illustrate the flexibility of the WTA effect and, in principle, any limiting and shared resource is appropriate to enforce competition [50,53].

The precise implementation of the WTA effect may be dictated by criteria of performance, robustness or ease of design. DNA-only circuits are entirely synthetic, which facilitates their debugging and increases their modularity. Cascading WTA modules appears easier with DNA-only circuits than hybrid DNA/enzyme circuits, because the competitive effects can be localized to various subnetworks using different fuel strands (whereas competition for enzymes would lead to system-wide coupling). On the other hand, hybrid DNA/enzyme designs may prove more suitable for actuating circuits that respond dynamically to change in their input patterns, given that they continuously degrade and produce DNA strands (instead of simply releasing and sequestering them).

## 2. Conclusion

We have sought to exploit low-level physical effects inherent to biochemistry in order to compute nonlinear functions. We have shown that a powerful computational primitive (WTA effect) is naturally implemented in DNA circuits when replicating strands are forced to compete for a limited resource. We identify three features of the WTA effect (invariance, nonlinearity and compactness) which allow robust nonlinear computations from a reduced set of strands. We believe that such low-level routines may considerably widen the repertoire of DNA logic circuits, while facilitating their preparation. Last, our work further highlights how competition for a limited resource may provoke the emergence of complex dynamics, which has often been noted in studies on the origin of life, and searches for early replicating peptides or nucleic acids [57,68–70].

## Acknowledgements

We thank Jongmin Kim, Lulu Qian, David Soloveichik, Andrew Turberfield, Erik Winfree and David Zhang for discussions, as well as Andrew Phillips for help with Visual DSD. A preliminary version of this manuscript appeared as an extended abstract in Genot *et al*. [71].

- Received March 6, 2013.
- Accepted May 23, 2013.

- © 2013 The Author(s) Published by the Royal Society. All rights reserved.