## Abstract

Finite-state machines (FSMs) are a theoretically and practically important model of computation. We propose a general, thermodynamically consistent model of FSMs and characterize the resource requirements of these machines. We model FSMs as time-inhomogeneous Markov chains. The computation is driven by instantaneous manipulations of the energy levels of the states. We calculate the entropy production of the machine, its error probability, and the time required to complete one update step. We find that a sequence of generalized bit-setting operations is sufficient to implement any FSM.

## 1. Introduction

Whenever a computation is done in the real world, some corresponding physical change to the world occurs (in Landauer’s words: ‘all computation is physical’). This change can be that work was performed on a system, or entropy produced or some heat generated. Attempts to understand the physical consequences of computation go back to pioneering work in the 1980s. A key result that was established then is the celebrated *Landauer limit*. It postulates that writing a bit to a memory device decreases the entropy of the memory by and thus requires at least an amount of work to be done. Yet, this Landauer limit does not fundamentally bound the cost of computation. As was shown by Bennett [1,2] it is possible to conceive systems that compute with no lower limits on the thermodynamic cost. The caveat is that all zero-cost computations proposed so far either require infinite time to complete or return a wrong result with a high probability. Both characteristics are unacceptable for real-world computations. The cost of computations that complete within finite time and return the correct result with high probability remains an open question.

Through relatively recent theoretical advancements leading to the frameworks of stochastic thermodynamics [3] and information thermodynamics [4] it has now become possible to probe rigorously the physical underpinnings of information processing. Applications of these frameworks to the physics of information processing have so far predominantly concentrated on proto-computations such as bit-rewriting or copying [5] and to biological systems [6–10]. By contrast, there are relatively few recent attempts to apply information thermodynamics directly to computer science. Exceptions are [11,12] who however consider fundamental limits to the thermodynamic cost of computation in the quasi static limit. While this is of high theoretical interest, focusing on the quasi static limit, which assumes infinitely slow processes, misses out on practically important performance measures of real-world computations, namely execution time and accuracy.

In the present contribution, we now wish go beyond quasi static computations and probe the thermodynamic cost of computations that complete within a finite time and return the correct result with a probability close to 1. More specifically, we will not be content with considering proto-computations, or computational processes, but we will insist on staying close to computational theory, so as to understand the resource requirements that are implied by models of computations as they are formulated in computer science. To focus the discussion, we will consider a particular model of computation, namely *finite-state machines* (FSMs).

In computer science, models of computation are mathematically rigorous descriptions of automated mechanisms of symbolic reasoning. There is not just one such model, but many different ones. A fundamental result in theoretical computer science is that there is a class of ‘Turing complete’ or ‘universal’ models that are (i) equivalent to one another and (ii) more general than the models to which they are not equivalent. Equivalence means that anything that can be represented in one model can be translated into the other and vice versa. Turing complete models can represent non-Turing complete models as well, but the reverse is not true.

A well-known example of a complete model of computation are Turing machines. A Turing machine is a formal construct that consists of a reading head that (i) at any one time is in one of a finite number of possible internal states; (ii) is in contact with a symbol from a tape; the tape symbols are drawn from a finite set and the reading head can read the symbol and overwrite it; finally (iii) it is characterized by a fixed set of rules. These rules specify the next state of the head depending on the current tape symbol, what symbol to write to the current tape element (possibly the same as the one encountered), and whether the reading head should move left or right next. It is essential to the universality of the Turing machine that the tape is unlimited, i.e. that the machine has an infinite amount of temporary memory at its disposal.

In contrast to Turing machines, real-world computers never have unlimited resources. Turing machines may therefore often not be very good descriptions of such devices. FSMs which only ever consume finite resources are often a useful alternative model. They are of particular interest in situations where resources are severely limited, as is the case in, for example, *in vivo* computers [13–15]. On the downside, they are also non-universal, which means that there are computations that they cannot do.

Similar to Turing machines, FSMs have internal states and can be thought of as having a reading head that can read symbols from, but not write to, an external tape. Furthermore, the reading head moves consistently into one direction on the tape [16] thus receiving a sequence of symbols. Formally, they can be defined as follows:

### Definition 1.1

(FSM). A FSM is a tuple (*Q*, *Σ*, *δ*, *I*, *F*), where *Q* is a finite set of internal states, *Σ* represents a finite alphabet of *n* different symbols, *δ* is a transition function *Q* × *Σ* → *Q* and *I* and *F* are a set of initial states and accepting states, respectively.

The operation of an FSM is as follows. At time *t* = 0 the machine is in a designated start state and in contact with the first symbol on the tape, which will be one of *n* possible symbols that constitute the tape of length *L*. The transition function *δ* defines the next state for every state–symbol pair. State transitions always coincide with moving the tape ahead, such that the FSM is in contact with the next symbol on the tape when reaching the new state. The machine is updated until the end of the tape is reached, at which point the computation halts. If the final state of the machine is a designated ‘accepting’ state, then the input tape is deemed as ‘accepted’, otherwise it is not.

Computer scientists distinguish between deterministic and non-deterministic FSMs. A deterministic FSM is one where for each state there is at most one possible transition for each possible tape symbol, i.e. given a tape symbol the next state is determined. Non-deterministic FSMs, on the other hand, may have several possible transitions for each state–symbol pair. It is a well-known result that deterministic and non-deterministic FSMs are computationally equivalent, in the sense that the two classes can solve the same problems. Henceforth, we will only consider deterministic FSMs.

One attraction of studying FSMs is that each state transition can be understood as a *unit* of computation, or an elementary cycle, as we will refer to it. Once we know the thermodynamics of such an elementary unit, we know the thermodynamics of any conceivable FSM because any FSM is just a sequence of those *elementary cycles*. Furthermore, it will become evident that these elementary cycles can themselves be further broken down into more fundamental computational steps. We will find that only two types of computational steps are required to implement any FSM, namely generalizations of bit flips and bit sets that we call *N*-it setters and *N*-it flips.

The main results of this article are as follows. (i) We show that an elementary cycle of a FSM can be implemented as sequences of *N*-it setters followed by *N*-it flips. This implies that these components, even though they are extremely simple physical mechanisms, are sufficient for a very large class of computational problems. (ii) We present a general scheme to translate any specification of an FSM into a thermodynamically consistent model with a defined thermodynamic cost, and operating accuracy and execution time. (iii) We derive a relationship between the cost and error probability per state transition of the FSM and show that in the limit of high accuracy the resource consumption of an FSM when implemented as a Markovian system becomes independent of the size of the tape alphabet.

## 2. Results

### 2.1. Stochastic information processors

Before describing a physically plausible model of FSMs, we will introduce the two atomic processes that we will act as fundamental building blocks from which arbitrary FSMs can be built and describe their relevant thermodynamics. Specifically, these are generalizations of simple bit-set and bit-flip operation, but with multiple states and only three energy levels. We call these *N*-it setters and *N*-it flips.

Firstly, however, for clarity, we consider a simple bit-flip and bit-set as often conceived of, modelled by a two state system, {1, 2}. First, we consider the bit flip where each state is initially associated with an energy level {−Δ*E*, 0}. In this model, the system is also in contact with an external heat-bath that is kept at some constant temperature *T*. On sufficiently long time scales the system will be found in state 1 with probability , *i* signifying initial. The energy levels correspond to transition rates between the two states, namely *k*_{1→2} and *k*_{2→1}, which we initially set as *k*_{1→2} = *k*^{−} and *k*_{2→1} = *k*_{+}, *k*_{+} > *k*_{−}, through a postulate that the system obeys local detailed balance [17], i.e. *k*_{+}/*k*_{−} = exp(Δ*E*/*kT*). To enact the bit-flip the energy level of state one is raised to *E*_{1} = +Δ*E*, upon which the transition rates exchange values such that *k*_{2→1} = *k*^{−} and *k*_{1→2} = *k*_{+} and after a suitably long time, the system will be found in state 2 with probability , *f* signifying final. To enact the bit flip thus, on average, incurs work
2.1and total entropy production
2.2where we have set here and throughout. This is easily computed by considering the difference in the free energy *F* = −ln*Z* in the initial and final configurations where is the partition sum.

By contrast, a bit set operation, modelled here as a relaxation, transforms a distribution governed by the energy landscape {0, 0} into one governed by {−Δ*E*, 0}. As such the probabilities evolve from to . Consequently, the work associated with the bit-set is
2.3and the mean total entropy production is
2.4

#### 2.1.1. The *N*-it setter

Here, we consider the first atomic process and generalization of the above bit set, which we call the *N*-it setter. As with the bit set and bit flip operations, it involves altering the energy landscape in order to drive the system towards a preferential state, exchanging energy as work. However, this operation is slightly more complicated, involving *N* + 1 states, where *N* is a free parameter of the *N*-it setter that we discuss later in the paper. We denote these states {*L*, *D*_{1}, … , *D*_{N}} for reasons that will become apparent later. As before we assign each state an initial energy level, specifically, {0, Δ*E*, … , Δ*E*}. The exchange of work and relaxation we consider then corresponds to the final energy levels, given by {0, Δ*E*, … , −Δ*E*, … , Δ*E*} corresponding to states {*L*, *D*_{1}, … , *D*_{m}, … , *D*_{N}} such that state *D*_{m}, 1 ≤ *m* ≤ *N*, is preferentially selected or ‘set’ in the operation. Consequently, we are performing a setting of the system into state *D*_{m} from state *L* in the presence of *N* ‘distractor’ states which reside at a higher energy. As before, energy level differences of Δ*E* are effected through transition rates, e.g. , . While it is of no consequence here, later we require at no time are transitions between different states *D*_{i} allowed.

Analogously to the bit flip we may compute the initial probability to be in state *D*_{m}, given here by . Following the exchange of energy levels and a suitable period of equilibration the final probabilities change with the probability of being in the preferred state *D*_{m} now given by
2.5Consequently, we may thus compute the mean work incurred in such an operation as
2.6and the entropy production
2.7

#### 2.1.2. The *N*-it flip

Here, we consider the second atomic operation and generalization of the above bit flip. Again this operation performs work by altering the energy landscape in order to drive the system towards a preferential state, here driving it out of an already preferential state. As with the *N*-it setter this operates on states {*L*, *D*_{1}, … , *D*_{N}}. However, in this instance we ‘flip’ from the single state *D*_{m} to a single target state, *L*, in the presence of *N* − 1 distractor states at a higher energy level. As before, to achieve this, we assign each state an initial energy level, specifically, {0, Δ*E*, … , −Δ*E*, … , Δ*E*} corresponding to states {*L*, *D*_{1}, … , *D*_{m}, … , *D*_{N}} such that, again, *D*_{m} is the set state with energy level −Δ*E*. The injection of work and relaxation we consider then corresponds to the final energy levels, given by {0, Δ*E*, … , Δ*E*}. Again transitions between *D*_{i} states are disallowed (figure 1).

Analogously to the bit flip we may compute the initial probability to be in the mechanically raised state *D*_{m} given here by . Following the exchange of energy levels and a suitable period of equilibration the final probability of being in the specific set state *L* is
2.8Consequently, we may thus compute the mean work incurred in such an operation as
2.9and the entropy production is given by
2.10

### 2.2. Time scales of the atomic operations

In order to understand any trade-off between time, energy requirements and accuracy of the FSM, we need to understand the characteristic relaxation times to equilibrium following the initial exchange of work in the atomic operations. This is found by solving the relevant master equations associated with the *N* + 1 state systems involved in each with transition rates matched to the subsequent energy levels, but with an initial condition matched to the initial energy levels. Doing so reveals a characteristic time scale for the bit-flip
2.11and a characteristic time for the bit-set of
2.12In the high accuracy limit, *k*_{+} ≫ *k*_{−}*N*, both *τ*_{flip}(*N*) and *τ*_{set}(*N*) scale like 1/*k*_{+}, independently of *N*. This means that the *N*-it setter and flip procedures operate fast when they operate accurately.

The characteristic time for *N*-it setters to reach their equilibrium will determine the operating time of the FSM. In a strict sense, the system only reaches its equilibrium after an infinite time. Yet, equilibrium is approached exponentially fast, thus, in practice, it will be sufficient to wait for a few multiples of *τ*_{flip} or *τ*_{set} in order to be so close to the true equilibrium that for all practical purposes the probabilities of the system are indistinguishable from an equilibrium system. If we decide to let the system relax for given multiples of *τ*_{flip} or *τ*_{set}, say 10, before the system is measured (or further manipulated), then the Markov *N*-it setter is operated in a defined finite time.

### 2.3. A physical model of finite-state machines

We will now turn to constructing a thermodynamically consistent model of FSMs. We will show that arbitrary FSMs can be constructed using a series of *N*-it setters and *N*-it flips. FSMs are time-inhomogeneous Markov chains, in that the transition rates between two states depend on the current tape-symbol. Therefore, any physical implementation of an FSM also requires a protocol to switch the transition rates between states depending on the tape-symbol. Before describing the model in §2.4, we will motivate our modelling choices in a step by step manner.

We start by re-interpreting the above defined logical model of the FSM as a (continuous) time-inhomogeneous Markov chain . We do this by associating a single physical state, which we call a *label state*, with each internal state in *Q* of the FSM. We refer to these states with symbol *L*_{i} where 1 ≤ *i* ≤ |*Q*|. We will then find that this naive translation of the conceptual FSM is not sufficient to implement the required mechanisms as a credible physical system. It will turn out that one way to solve this problem is to introduce additional ‘helper’ states to the FSM.

We first translate naively the FSM into a Markov chain model . This can be done as follows:

(1) The states and transitions of , with states identified as the set of label states

*L*_{i}, are the same as the states and transitions of the FSM.(2) Every transition from some state

*L*_{i}to some state*L*_{j}is (conceptually) associated with a symbol*a*of the input alphabet.(3) Each time an internal state transition happens, the external tape moves forward and the machine is in contact with the next tape element which contains a (possibly different) symbol

*a*.(4) When the current tape symbol is

*a*and if the transition from state*L*_{i}to state*L*_{j}is associated with*a*then the transition rate is*k*_{ij}= 1 and*k*_{ji}= 0; otherwise*k*_{ij}= 0.

As a next step, we now consider how this abstract Markov chain could be implemented as a plausible physical system. To this end, we re-interpret the chain as a microscopic system in contact with some heat-bath. Each state *L*_{i} of the chain is represented by an energy level *E*_{i}. Again postulating local detailed balance we can now derive the transition rates between any state *i* and *j* as *k*_{ij}/*k*_{ji} = exp((*E*_{i} − *E*_{j})/*T*). Note that this entails that if the forward transition *L*_{i} → *L*_{j} happens, then the reverse transition *j* → *i* may also take place, albeit with a possibly very small rate. In the original FSM model, reverse transitions were not allowed. The micro-reversibility is an immediate consequence of thermodynamic consistency.

#### 2.3.1. Dynamic states are necessary to consistently encode transition rates by energy differences

Before we arrive at a complete model of the FSM further states, beyond the label states associated with the internal states of the FSM, need to be introduced (see in this context [18]). This arises because transitions between states need to be forced by energy differences between the states, i.e. desired next states should have a low energy and all other states a high energy, but as we will show, this is not possible.

To see this consider the specific transition from state *L*_{i} to state *L*_{j}. Assume that for symbol *a* this transition should happen at a low rate *k*_{−}, i.e. *a* is associated with a transition from *L*_{i} to a different state *L*_{l}. Consequently, the energy of state *L*_{j} should be high. At the same time, it may be the case that the tape symbol *a* is associated with the transition from a different state *L*_{k} ≠ *L*_{i} to *L*_{j}, i.e. this transition should happen with a rate *k*_{+}. Accordingly, the energy of *L*_{j} should be low. In general, it is, therefore, not possible to achieve consistent transition rates by adjusting the energy levels of label states; see figure 2 for a graphical explanation.

This can be overcome by introducing a new state for each individual transition between each logical state of the FSM, including, importantly, self-transitions. We call these *dynamic states*. Since every possible tape symbol induces some transition in the FSM (albeit possibly a self-transition) this entails adding another *n* states for each label state, where *n* is the number of tape symbols. We denote these states *D*_{α}^{i→j} = *D*_{α}^{i→i(α)} to be interpreted as the dynamic state associated with the transition away from state *L*_{i}, towards state *L*_{j}, when symbol α is on the tape. Note that for every *i* and α combination there is exactly one value *j*, also denoted *j* = *i*(α), which may be equal to *i* in the case of a self-transition in the FSM.

Consequently, we thus have distinct states for each of the internal states of the FSM (label states), but also for each of the possible ‘directions’ that the system can transition in from each internal state (dynamic states). If there are *M* = |*Q*| internal states, then there are *M*(*n* + 1) total states and *M* dynamic states corresponding to each possible symbol on the tape. We use notation *D*_{α} to denote all dynamic states associated with tape symbol *j*, i.e. *D*_{α} = {*D*_{α}^{1→1(α)}, … , *D*_{α}^{M→M(α)}} and *D*^{i} to denote all dynamic states associated with label state *L*_{i}, i.e. . Any individual label state, *L*_{i}, will have connections to *n* outgoing dynamic states, *D*^{i}, designed to take the system from that label state to another state, and up to *n*|*Q*| incoming dynamic states from other label states from which the system is intended to transition. We summarize the procedure to transform an FSM with *n* tape symbols into a physically plausible Markov model:

(1) Identify every internal state of the FSM with a physical label state,

*L*_{i}.(2) For each label state,

*L*_{i}, introduce another*n*states—the dynamic states,*D*^{i}. Each is associated with a different symbol of the tape alphabet and can connect to exactly one other label state.(3) Introduce possible transitions between different label states via a dynamic state. The transitions should be as specified by the FSM model. If the FSM specifies that there is a transition from state

*L*_{i}to state*L*_{j}for a tape symbol*a*, then the model should contain reversible transitions from the label state*L*_{i}to a dynamic state and reversible transition from that dynamic state and the label state*L*_{j}.

Figure 3 illustrates the procedure with a specific example.

### 2.4. Detailed description of the model

In order to implement any FSM it is sufficient to postulate three energy levels, corresponding to *E* = {±Δ*E*, 0}. We choose that the transition and label states always remain at *E* = 0. By contrast, the dynamic states are at *E* = ±Δ*E*. An *elementary cycle* is the procedure that needs to be executed in order to implement a single state transition of a FSM. This elementary cycle is generic in that it can be used in any network topology and for any number of tape symbols; figure 4 illustrates an elementary cycle for a tape consisting of two symbols. It is important to stress that an elementary cycle is not a traditional thermodynamic cycle, such as, for example, a Carnot cycle, that brings the system back into its initial state. Instead, it is a sequence of manipulations that achieve an elementary logical operation. In general, an elementary cycle will not bring the FSM back to the same state.

#### 2.4.1. Outline of the elementary cycle

The elementary cycle consists of the two atomic computational steps outlined earlier interleaved alongside minimal mitigation to ensure evolution in the correct direction. The purpose of the generalized flips is to extract the system from some dynamic state, *D*_{α}^{i→j} and into the next label state *L*_{j} as determined by the behaviour of the FSM. The purpose of the generalized sets is then to take the system from a label state *L*_{j} into the appropriate dynamic state, *D*_{α}^{j→j(α)}, given symbol α is on the tape.

The mitigation against backwards evolution takes the form of energy barriers between the states. We assume that the heights of these barriers are effectively infinite, such that over relevant time scales there will be no transitions over these barriers. These barriers can be placed between the label and dynamic states in two different configurations. In the first configuration, the *outgoing configuration*, they lie between label states and all outgoing dynamic states associated with them, i.e. between all states *L*_{i} and corresponding dynamic states *D*^{i}. In the second configuration, the *incoming configuration*, they lie between the label states and incoming dynamic states that are directed towards them, i.e. between all states *L*_{j} and corresponding dynamic states *D*_{α}^{l→j} for all corresponding internal states *l* and tape symbols α.

Use of such energy barriers amounts to a coarse-graining of certain states (or operations) required of the system and thus inevitably results in a model with lower energetic costs. In this sense, our results provide a minimum bound on energy requirements and performance. We do this to simplify the discourse, but use minimal use of such barriers in order to retain pertinent features that effect energy input and accuracy—specifically dependence on alphabet and machine size. We achieve this by insisting that we are only able to arrange them in the outgoing and incoming configurations such that the relevant dependence on the size of the machine and alphabet, reflected in the relevant multiplicities of the *N*-it set and flip operations, are in turn reflected in the cost and precision calculations.

The machine operates over three fixed energy levels. Continuous operation is therefore only possible if, through input of work, the energy levels of states are lifted to drive the computations. We will now describe a generic protocol so as to realize an arbitrary FSM. Note that the execution of this protocol does not depend on knowledge of the state of the machine at a particular time.

*Step by step procedure*. We arbitrarily define the beginning of the cycle as a machine state where (i) the label states *L*_{i} have an associated energy *E* = 0; (ii) the machine is in some dynamic state *D*_{α}^{i→i(α)} corresponding to label state *L*_{i} and symbol on the tape α; all dynamic states *D*_{α} have associated energy *E* = −Δ*E*, while all other dynamic states, *D*_{α′≠α}, have associated energy *E* = +Δ*E*; see figure 4; and (iii) the energy barriers are in the outgoing configuration. The machine may be in a different state initially, which may result in an error of the computation; see §2.6.

*Step* 1. Lift all dynamic states to energy *E* = +Δ*E*. Wait for a chosen multiple of *τ*_{flip} before proceeding to the next step. This implements a *N*-it flip from §2.1.2 relaxing the system into label state *L*_{j} to which the currently occupied dynamic state is directed. Because of the outgoing energy barriers, up to *n*|*Q*| possible incoming dynamic states lead into the same label state. Consequently, the bit-flip is performed with *N* ≤ *n*|*Q*|.

*Step* 2. Existing energy barriers are removed and instead, new energy barriers are set in the incoming configuration.

*Step* 3. The tape is advanced, at some cost, and the dynamic state energy levels are set in accordance with the symbol on the read head. Wait for a chosen multiple of *τ*_{set} before proceeding to the next step.

This implements the *N*-it setter from §2.1.1 causing the system to enter the dynamic state *D*_{α}^{i→i(α)} associated with the current label state *L*_{i} and the symbol α on the tape. Specifically, if symbol *a* is now on the tape all dynamic states *D*_{a} are lowered to energy level *E* = −Δ*E* while the rest remain at energy level *E* = +Δ*E*. Because of the incoming energy barriers and the structure of FSMs there are exactly *n* outgoing dynamic states attached to the current label state ensuring that the bit-set is performed with *N* = *n*.

*Step* 4. Existing energy barriers are removed and instead new energy barriers are set in the outgoing configuration. This takes the machine back to the beginning of a new elementary cycle.

### 2.5. Energetics of the finite-state machine

The computation is driven primarily by lifting the energy levels of the machine during step 1, with the potential for (small) work extraction in step 3. On average this requires positive work expenditure. During step 1 the dynamic state is lifted from *E* = −Δ*E* to *E* = Δ*E*. Since step 1 is associated with a *N*-it flip, with *N* = *N*_{Q} ≤ *n*|*Q*|, we associate it with work expenditure
2.13Similarly, the work that can be extracted during step three is associated with a *n*-it setter with *N* = *n*:
2.14The sum is, therefore, the total expenditure of work expected under this model
2.15Specifically, we note in this high accuracy, *k*_{+} ≫ *k*_{−}, limit the result is independent of the size of the alphabet *n* and the size of the machine expressed through *N*_{Q}.

Note also, that if the energy barriers always enclose the particle (also valid only in the high accuracy limit, *k*_{+} ≫ *k*_{−}), and the system returns to the same label state *L*_{i} as it was previously, then the system has performed a bona fide thermodynamic cycle captured entirely accurately by these two operations such that the mean entropy production is the sum of the entropy productions of the atomic operations; this is equal to the work since the free energies cancel, as they must, due to the cyclical operation.

In addition to the energy expenditure during elementary cycles, there is an addition expenditure required to reset the machine to the start state at the beginning of the computation. We note that the thermodynamic cost of this procedure will depend on the number of states of the FSM, but is independent of the number of computational steps that will be done. In the limit of long tapes *L* ≫ 1 it will be insignificant.

### 2.6. Error probabilities

We will now consider the error probabilities implied by the model. For this purpose, we will limit the discussion to errors that arise from the micro-reversibility of the model. Specifically, we will ignore the possibility that the machine may erroneously transition between unconnected states. We also assume that energy barriers cannot be overcome.

With this caveat in mind, it is clear that the probability of errors during the computation depends on the energy differences Δ*E* between states. The larger the difference, the smaller the error. The steps where errors occur are, however, not those where the energy levels are changed, but instead those where the barriers are redistributed. The redistribution may fix the system in incorrect states and thus affect the reliability of the computation. When analysing the error probability of the machine, we therefore only need to consider steps 2 and 4.

During step 2 the machine could be in one of the *N*_{Q} ≤ *n*|*Q*| dynamic states (at energy level Δ*E*) rather than in the intended label state (at energy level 0). This will then result in an error. The probability of being in one of these dynamic states, recalling the local detailed balance relation *k*_{+}/*k*_{−} = exp(Δ*E*), is given by
2.16Assuming that no further errors happen, the outcome of this error will be that the machine misses a transition, while the tape moves ahead—tape and FSM de-synchronize. Under some circumstances this remains inconsequential, but typically it will mean that the computational path has been altered and the result of the computation is unreliable.

Energy barriers are also rearranged during step 4 when another misstep can happen. The intended state of the machine before step 4 is a low energy dynamic state (energy level −Δ*E*). In reality, the machine may be in the relevant label state *L*_{i} (energy level 0) or in one of the remaining (*n* − 1) high energy dynamic states *D*^{i} (energy level +Δ*E*). The probability *p*_{err2} is the probability of being in any state other than the low energy dynamic state, i.e.
2.17Altogether, the total error probability per cycle is then
2.18We note, even in the high accuracy limit, that the error is sensitive to the size of the machine through the parameter *N*_{Q}, but note that, in a worst case scenario, is equal to *n*|*Q*|.

### 2.7. Time required for the computation

The time required for an elementary cycle to complete is spent while waiting for the system to approach equilibrium after step 1 and step 3. This time is *N*_{M}(τ_{set}(*n*) + τ_{flip}(*N*_{Q})), where *N*_{M} is the chosen multiple of the relaxation time and *N*_{Q} < *n*|*Q*|; see equation (2.12).

## 3. Discussion

In this paper, we have presented a simple implementation of a FSM as a non-homogeneous continuous time Markov chain. Key aspects of the model we have presented include the requirement for dynamic states over and above the label states that represent the internal states of the FSM that would result from a naive attempt at an implementation. Further, we have demonstrated that they can be represented using two key atomic operations that flip and set the system amongst these states. Using this model we have investigated the energy consumption and probability of accurate computation.

We find for the FSM in the high accuracy regime that the probability of an error scales like (see equation (2.18)), while the cost in terms of the work required to implement the cycle only increases logarithmically with *k*_{+} (see equation (2.15) and figure 5). Expressed in terms of the energy differences between states Δ*E*, we find that the average work scales (expectedly) linear with Δ*E* but the error falls exponentially. This benign scaling echoes previous results on different models of computation (cf. [19]). It tells us that our model can compute with perfect accuracy, but only in the limit of infinite energy dissipation. Still, quasi-deterministic computation that has practically negligible error probabilities can be done at a finite, even modest energy expense. At the same time, it is clear that—especially for high accuracies—the model we proposed here dissipates well above the theoretical limit.

Interestingly, in the high accuracy limit the size of the input alphabet and size of the machine no longer matters for the cost of the computation (figure 3). One may speculate that a larger tape alphabet allows more information to be processed per computational step with only marginally increased energy costs (when compared with smaller alphabets). This suggests that it is more efficient to run Markovian computers with large alphabets than with small ones. However, the error probability can also be seen to depend, in the worst case, on the size of the machine and the size of the alphabet, *n*|*Q*|. The size of the alphabet can be seen to be a constant parameter in the specification of any given FSM; however the size of the machine |*Q*| depends on the specific computation. It is important to recognize that such an error probability is only equal to *n*|*Q*| in the worst case. In reality, the number may be much lower than this as the value of *N*_{Q} that determines the accuracy is determined by the number of incoming dynamic states in each *N*-it flip. This is an issue of the *coding* of the particular algorithm to be performed by the FSM into its particular topology of internal states and transitions between them. This suggests that for any given algorithm there will be multiple possible FSM implementations, some of which will be favourable with respect to accuracy (and thus energy expenditure given some acceptable error tolerance) while others will be unfavourable. This opens up an interesting possibility of performance, energy and accuracy trade-offs determined primarily by *implementation* rather than just by the physical framework being used and the computation to be performed.

It is important to acknowledge the limitations, simplifications and inefficiencies in the model we have presented. Firstly, when considering the efficiency of the model it is important to bear in mind that it relies on instantaneous shifts in energy levels. The energy expenditure entailed by the model, therefore, does not represent a fundamental lower limit for FSMs as instantiated here. For one, the *N*-it setting could be done quasi-statically, which would reduce the cost of the running the FSM to a theoretical minimum, albeit at the cost of infinitely slow processing speed. Having identified *N*-it setters as the basic components required to implement FSMs, it remains an interesting problem to identify optimal finite time processes that can implement those, for example, along the lines of [20]. Finally, we note the usage of infinite energy barriers in the step by step protocol that operates the FSM in this model. The use of such barriers amounts to a coarse-graining of additional states and steps then inevitably ignores an energy cost and possibility of further error. In this sense, we present a lower bound on the work and error calculations. However, the choice to make limited use of such energy barriers was deliberate such that dependence on fundamental aspects of FSMs, such as |*Q*| and *n*, was retained. It is expected that the coarse-graining of such processes will have progressively little effect upon the cost and error probability as the high accuracy limit *k*_{+} ≫ *k*_{−} is taken.

### 3.1. Programmability and entropy production

Another property of our model is that it entails a thermodynamic cost of programmability. The model proposed above requires four interventions per cycle, namely lifting/lowering of state energies and erecting barriers. The procedure can be simplified when the model of the FSM is made less general, i.e. more assumptions are made about the type of computation that will be performed. As a first simplification we assume that the input tape is always of a fixed length *L*. In this case, the machine can be ‘unrolled’, in the following way. Let {*L*_{1}, *L*_{2}, *L*_{3}, …} denote the internal states of the FSM. An unrolled FSM whose input tape is of length *L* would then have the time-indexed states {*L*_{1,1}, *L*_{2,1}, *L*_{3,1}, …} and {*L*_{1,2}, *L*_{2,2}, *L*_{3,2}, …} up to {*L*_{1,L}, *L*_{2,L}, *L*_{3,L}, …}. Additionally, it would also have for each indexed state corresponding dynamic states {*D*^{1,1}, *D*^{2,1}, *D*^{3,1}, …}.

In the unrolled FSM transitions always take place from a time-indexed label state to the transition state with the same index and label. This transition is coupled to advancing the tape and a reconfiguration of the rates between transition states and dynamic states, as above, such that only those transitions are favourable that are associated with the relevant symbol from the tape alphabet. For example, if for a given symbol the FSM stipulates a transition from, say, state *L*_{i} to state *L*_{j} when the current tape element is *a*, then in the unrolled graph, this would entail a transition from *L*_{i,T} to to *L*_{j,T+1}. All states with α′ ≠ α would be at a higher energy than *D*_{α}^{i}. This unrolled transition graph would have many more states than the original model, but the total number of states and the total number of transitions to be completed for one computation are known. It is, therefore, possible to arrange the states over 3*L* energy levels and it is no longer necessary to erect energy barriers, which simplifies the computing protocol from 4 to 2 steps per elementary cycle.

While simpler, assuming a fixed length to the external tape limits the programmability of the system to programs that are at most of length *L*. Based on this, we conjecture that programmability itself may entail a thermodynamic cost. This becomes even more apparent when we consider as a further simplification the case where the precise symbol sequence of the tape, and not only its length are known. Then transition and dynamic states are dispensable and the machine can be reduced to state transitions between label states only. This is because once the input tape is known, the sequence of intended state transitions is known, and it is possible to reduce the transition graph to *L* states arranged over *L* energy levels.

At this point a further reduction is possible. Computationally, nothing is gained by the *L* − 2 states between the initial and final state. Directly connecting the initial and final state leads to a logically equivalent chain. Hence, once the actual input tape is known in advance, it is possible to reduce the computation to a simple bit-flip. The cost of this operation is independent of the length of the tape.

## Data accessibility

This article has no additional data.

## Competing interests

We declare we have no competing interests.

## Funding

No funding has been received for this article.

## Acknowledgements

We thank Andre Barato for comments on early versions of the manuscript. D.C. also thanks the Max Planck Institute for the Physics of Complex Systems where part of this work was done.

## Footnotes

One contribution of 10 to a theme issue ‘Computation by natural systems’.

- Accepted September 14, 2018.

- © 2018 The Author(s)

Published by the Royal Society. All rights reserved.