Thermodynamic Costs of Information Processing in Sensory Adaptation

Biological sensory systems react to changes in their surroundings. They are characterized by fast response and slow adaptation to varying environmental cues. Insofar as sensory adaptive systems map environmental changes to changes of their internal degrees of freedom, they can be regarded as computational devices manipulating information. Landauer established that information is ultimately physical, and its manipulation subject to the entropic and energetic bounds of thermodynamics. Thus the fundamental costs of biological sensory adaptation can be elucidated by tracking how the information the system has about its environment is altered. These bounds are particularly relevant for small organisms, which unlike everyday computers, operate at very low energies. In this paper, we establish a general framework for the thermodynamics of information processing in sensing. With it, we quantify how during sensory adaptation information about the past is erased, while information about the present is gathered. This process produces entropy larger than the amount of old information erased and has an energetic cost bounded by the amount of new information written to memory. We apply these principles to the E. coli's chemotaxis pathway during binary ligand concentration changes. In this regime, we quantify the amount of information stored by each methyl group and show that receptors consume energy in the range of the information-theoretic minimum. Our work provides a basis for further inquiries into more complex phenomena, such as gradient sensing and frequency response.


Introduction
In order to perform a variety of tasks, living organisms continually respond and adapt to their changing surroundings through diverse electrical, chemical and mechanical signaling pathways, called sensory systems [1]. In mammals, prominent examples are the neurons involved in the visual, olfactory, and somatic systems [2][3][4][5]. But also unicellular organisms lacking a neuronal system sense their environment: Yeast can sense osmotic pressure [6], and E. coli can monitor chemical gradients [7], temperatures [8] and pH [9]. Despite the diversity in biochemical details, sensory adaptation systems (SAS) exhibit a common behavior: long-term storage of the state of the environment and rapid response to its changes [10]. Intuitively, one expects that for these SAS to function, an energy source -such as ATP or SAM -is required; but is there a fundamental minimum energy needed? To tackle this question, we first relate a generic SAS to a binary information processing device, which is tasked to perform fast information acquisition on the environment (response) and to record subsequently the information into its longer term memory (adaptation). Since the foundational works of Maxwell, Szilard and Landauer, the intimate relationship between thermodynamic costs and information processing tasks has been intensely studied [11][12][13][14][15][16][17]. As a result, the natural mapping between a generic SAS and an information processing device allows us to quantify the minimal energetic costs of sensory adaptation.
The idea of viewing biological processes as information processing tasks is not new [7,12,18]. However, rationalizing sensory adaptation is complicated by recent studies that have revealed that motifs in the underlying biochemical networks play a fundamental role in the thermodynamic costs. For instance, the steady state of feedback adaptive systems must be dissipative, with more dissipation leading to better adaptation [19], an observation echoed in the analysis of a minimal model of adaptive particle transport [20]. Other studies have suggested that some feedforward adaptive systems may require dissipation to sustain their steady state [21], while some may not [22,23]. Furthermore, past studies [18,24] have approached the notion of information by considering noisy inputs due to stochastic binding, a realm in which adaptation may not be relevant due to the separation of time-scales [25]. Here, we develop a different approach that avoids these caveats by considering a thermodynamically consistent notion of information that naturally incorporates the costs of sensing in sensory adaptation. Specifically, we derive a collection of universal bounds that relate the thermodynamic costs of sensing to the information processed. These bounds reveal for the first time that for a generic SAS, measuring an environmental change is energetically costly [(6) below], while to erase the memory of the past is energetically free, but necessarily irreversible [(5) below]. By formalizing and linking the information processing and thermodynamics of sensory systems, our work shows that there is an intrinsic cost of sensing due to the necessity to process information.
To illustrate our generic approach, we study first a minimal four-state feedforward model and then a detailed ten-state feedback model of E. coli chemotaxis. Owing to the symmetry of its motif's topology the four-state feedforward model does not require energy to sustain its adapted state. Instead, all the dissipation arises from information processing: acquiring new information consumes energy, while erasing old information produces entropy. By contrast, the E. coli model sustains its nonequilibrium steady state (NESS) by constantly dissipating energy, a requirement for adaptation with a feedback topology [19]. In this nonequilibrium setting, we generalize our thermodynamic bounds in order to pinpoint the additional energy for sensing over that required to maintain the steady state. We find with this formalism that in E. coli chemotaxis the theoretical minimum demanded by our bounds accounts for a sizable portion of the energy spent by the bacterium on its SAS.

Universal traits of sensory adaptation
To respond and adapt to changes in an environmental signal E, a SAS requires a fast variable, the activity A; and a slow variable, the memory M . For example, in E. coli the activity is the conformational state of the receptor, the memory the number of methyl groups attached to it, and the signal is the ligand concentration [7]. Without loss of generality, we consider in the following all three variables normalized such that they only lie between 0 and 1, and that the signal can only alternate between two values: a low value 0 and a high value 1.
As a result of thermal fluctuations, the time-dependent activity A t and memory M t are stochastic variables. Yet, the defining characteristics of sensory adaptation are captured by their ensemble averages A t and M t , both at the steady state and in response to changes in the signal.
At a constant environmental signal E = e, the system relaxes to an adapted e-dependent steady state, which may be far from equilibrium [19]. In this state, the memory is correlated with the signal, with an average value close to the signal, M st = |e − m | where m is a small error. The average activity however is adapted, taking a value roughly independent of the signal, A st = 1/2 ± ad , with adaption error ad .
Besides the ability to adapt, SAS are also defined by their multiscale response to abrupt signal changes, which is illustrated in Fig. 1. For example, given a sharp increase in the signal from E = 0 to 1 the average activity quickly grows from its adapted value to a peak 1 − g characterized by the gain error g . This occurs in a time τ a , before the memory responds. After a longer time τ m τ a , the memory starts to track the signal, and the activity gradually recovers to its adapted value (see Fig. 1A). For a sharp decrease in the signal, the behavior is analogous (see Fig. 1B).
We identify a SAS as any device that exhibits the described adapted states for low and high signals (0 or 1) and that reproduces the desired behavior to abrupt increases and decreases in the signal (see Fig. 1C for a cartoon biochemical example). While SAS typically exhibit additional features (such as wide range sensitivity [26,27]), they all exhibit the universal features illustrated in Fig. 1.

Minimal SAS: equilibrium feedforward model
To facilitate the development of our formalism, we first present a minimal stochastic model of a SAS, where the activity A and memory M are binary variables (0 or 1). This model is minimal, since it has the least number of degrees of freedom (or states) possible and still exhibits the required response and adaptive behavior. Treating the environmental signal E as an external field that drives the SAS, the system can be viewed as evolving by jumping stochastically between its four states depicted in Fig. 2A. The rates for activity A transitions from a → a given M = m at fixed E = e are denoted W m aa (e), and those for memory M transitions from m → m given A = a are W mm a (e). As an equilibrium model, it is completely characterized by a free energy function, which we have constructed in the Methods by requiring the equilibrium steady state to have the required signal correlations of a SAS, F (a, m; e) = |e − m|(∆ m + |e − a|∆ g ).
∆ m ≈ k B T ln −1 m is the energy penalty for the memory to mistrack the signal, ensuring adaptation (with T the temperature and k B Boltzmann's constant). In fact, one can show that ad ≈ m /4. ∆ g ≈ k B T ln −1 g is the penalty for the activity to mistrack the signal when M = E; it thus becomes relevant after a signal change, but before the memory adapts to the new signal, ensuring response. In Figs. 2C and D the energy landscape F (a, m; e) is represented for low and high signals (smaller radius corresponds to less probability and larger energy). Note that for fixed E = e, the adaptation error is zero when the energy penalty to misstrack the signal becomes large ∆ m → ∞, the system's configuration is then M = e and A takes on the values 0 and 1 with equal probability.
Finally, the dynamics are set by fixing the kinetic rates using detailed balance, e.g., ln W m aa (e)/W m a a (e) = − [F (a, m; e) − F (a , m; e)] /k B T , and then choosing well-separated bare rates to set the timescale of jumps: ω for activity transitions and k for memory transitions, with ω k, thereby enforcing the well-separated time-scales of adaptation. When there is a change in the signal, this model exhibits response and adaptation as characterized in Figs. 1A and B (verified in Figs. 1S and 2S), and relaxes towards a dissipationless equilibrium steady state in which detailed balance is respected. This is in contrast to previous studies on adaptive systems, which demonstrated that maintaining the steady state for a generic feedback system breaks detailed balance [19,20]. Our model, however, differs by its network topology. As depicted in Fig. 2B, it is a mutually repressive feedforward (all rates depend explicitly on E, and the actions of A and M on each other are symmetric). Similar topologies also underly recent suggestions for biochemical networks that allow for adaptation with dissipationless steady states [22,23].

Information processing in sensory adaptation
Any sensory system that responds and adapts can naturally be viewed as an information processing device. In the steady state, information about the signal is stored in the memory, since knowledge of M allows one to accurately infer the value of E. The activity A, on the other hand, possesses very little information about the signal, since it is adapted and almost independent of the signal. When confronted by an abrupt signal change, the activity rapidly responds by gathering information about the new signal value. As the activity decays back to its adapted value, information is stored in the memory. However, to make room for this new information, the memory must decorrelate itself with the initial signal, thereby erasing the old information. Thus sensory adaptation involves measurement as well as erasure of information.
To make this intuitive picture of information processing precise, let us focus on a concrete experimental situation where the signal is manipulated by an outside observer. This is the setup common in experiments on E. Coli chemotaxis where the signal (the ligand concentration) is varied in a prescribed, deterministic way [28]. To be specific, the initial random signal E i is fixed to an arbitrary value e i , either 0 or 1, with probability p(e i ), and the system is prepared in the corresponding e i -dependent steady state, characterized by the probability density p st (a, m|e i ). Then, at time t = 0, the signal is randomly switched to E f with final value e f = 0, 1 (which may be the same as e i ) according to the probability p(e f |e i ). The signal is held there while the system's time-dependent probability density p t (a, m|e i , e f ), which conditionally depends on both the initial and final signals, irreversibly relaxes to the final steady state p st (a, m|e f ). During this relaxation correlations between the system and the final signal value E f develop while the correlations with the past value E i are lost. As we will see, the measure of information that captures this evolution of correlations and naturally enters the thermodynamics of sensory adaptation is the mutual information between the system and the signal.
The mutual information is an information-theoretic quantification of how much a random variable U (such as the system) knows about another variable V (such as the signal), measured in nats [29]. Here, is the Shannon entropy, which is a measure of uncertainty. Thus, the mutual information measures the reduction in uncertainty of one variable given knowledge of the other. Of note, I(U ; V ) ≥ 0 with equality only when U and V are independent. There are two key appearances of mutual information in sensory adaptation capturing how information about the present is acquired, while knowledge of the past is lost, which we now describe. At the beginning of our experiment at t = 0, the SAS is correlated with E i , simply because the SAS is in a E i -dependent steady state. Thus there is an initial information I(A 0 , M 0 ; E i ) that the SAS has about the initial value of the signal E i . The signal is then switched; yet immediately after, the SAS has no information about the new signal value E f , so I(A 0 , M 0 ; E f ) = 0. Then for t > 0 the SAS evolves, becoming correlated with E f , thereby gathering (or measuring) information ∆I meas To illustrate this, we calculate the flow of information in the non-disspative feedforward model for p(e i ) = p(e f |e i ) = 1/2, which is a 1-bit operation (because H(E i ) = ln(2) nats = 1 bit). Figure 3A displays the evolution of the measured information (in black), which we decomposed as where I (M ) (red) is the information stored in the memory and I (A|M ) (blue) in the activity. We see the growth of ∆I meas proceeds first by a rapid (t ∼ τ a ) increase as information is stored in the activity (I (A|M ) grows) while the system responds, followed by a slower growth as adaptation sets in (t ∼ τ m ), and the memory begins to track the signal. At the end, the system is adapted, and there is almost no information in the activity, I With the small errors we have, the information acquired reaches nearly the maximum value of 1 bit, which is stored in the memory ∆I meas Figure 3B shows the erasure of information, visible by the decrease of I(A t , M t ; E i |E f ) from an initial value of nearly one bit to zero when the system has decorrelated from the initial signal E i .

Thermodynamic costs to sensory adaptation
We have seen that through an irreversible relaxation, an SAS first acquires and then erases information in the registry of the activity, followed by the memory. The irreversibility of these information operations is quantified by the entropy production, which we now analyze in order to pinpoint the thermodynamic costs of sensing. Specifically, we demonstrate in Methods that for a system performing sensory adaptation in response to an abrupt change in the environment, the total entropy production can be partitioned in two positive parts: one caused by measurement (∆S meas ) and the other by erasure (∆S eras ). The second law thus becomes with the reference set to an initial state at t < 0. The erasure piece is purely entropic in the sense that it contains no energetic terms. It solely results from the loss of information (or correlation) about the initial signal. By contrast, the energetics are contained in the measurement portion, where is the change in Shannon entropy of the system and Q t = t 0 ds ei,e f p(e i , e f ) a,mṗ s (a, m|e i , e f )F (a, m; e f ) is the average heat flow into the system from the thermal reservoir.
A useful alternative formulation can be obtained once we identify the internal energy U t . For example, in the equilibrium feedforward model, a sensible choice is the average energy U t = F (A t , M t ; E t ) (1). (Recall, that there is no unique division into internal energy and work, though any choice once made is thermodynamically consistent [30,31].) By substituting in the first law of thermodynamics Q t = ∆U t −W t , with W t the work, we arrive at This equation shows how the measured information ∆I meas t bounds the minimum energy required for sensing, which must be supplied as either work W t or free energy Thus, to measure is energetically costly; whereas, erasure is energetically free, but necessarily irreversible. In particular, for sensing to occur, the old information must be erased (∆I erase t > 0), implying that the process is inherently irreversible, Together (5) and (7) quantify the thermodynamic cost of sensing an abrupt change in the environment by an arbitrary sensory system. We have demonstrated from fundamental principles that sensing generically requires energy. However, (7) does not dictate the source of that energy: It can be supplied by the environment itself or by the SAS. The distinction originates because the definition of internal energy is not unique, a point to which we come back in our analysis of E. coli chemotaxis.
Using again our equilibrium feedforward model as an example, we apply our formalism to investigate the costs of sensory adaptation. Since this model sustains its steady state at no energy cost, the ultimate limit lies in the sensing process itself. We see this immediately in Fig. 4 where we verify the inequalities in (4) and (7). Since F in (1) is explicitly a function of the environmental signal E, the sudden change in E at t = 0 does work on the system, which is captured in Fig. 4A by the initial jump in W . This work is instantaneously converted into free energy ∆F and is then consumed as the system responds and adapts in order to measure. Thus, in this example the work to sense is supplied by the signal (the environment) itself and not the SAS, which is consistent with other equilibrium models of SAS [23]. Furthermore, Fig. 4B confirms that the erasure of information leads to an irreversible process with net entropy production. The bounds of (4) and (7) are not tightly met in our model, since we are sensing a sudden change in the signal that necessitates a dissipative response. Nonetheless, the total entropy production and energetic cost are on the order of the information erased and acquired. This indicates that these information theoretic bounds can be a limiting factor for the operation of adaptive systems. We now show that this is the case for E. coli chemotaxis, a fundamentally different system as it operates far from equilibrium.

Extension to NESS and application to E. coli chemotaxis
We have quantified the thermodynamic costs in any sensory adaptation system; however, for systems that break detailed balance and maintain their steady state far from equilibrium, (5) -(8) are uninformative, because of the constant entropy production. A case in point is E. coli's SAS, which enables it to perform chemotaxis by constantly consuming energy and producing entropy through the continuous hydrolysis of SAM.
Nevertheless, there is a refinement of the second law for genuine NESS in terms of the nonadiabatic ∆S na t and adiabatic ∆S a t entropy productions, ∆S tot t = ∆S a t + ∆S na t [32]. Crudely speaking, ∆S a is the entropy required to sustain a nonequilibrium steady state and is never null for a genuine NESS; whereas ∆S na is the entropy produced by the transient time evolution. When the system satisfies detailed balance ∆S a t = 0 always, be it at its equilibrium steady state or not; when its surroundings change, the entropy production is entirely captured by ∆S na t . We can refine our predictions for a NESS by recognizing that ∆S na t captures the irreversibility due to a transient relaxation, just as ∆S tot t does for systems satisfying detailed balance. Analogously to Eqs. (6) and (8), we derive (see Methods): Here, Q ex t = −k B T t 0 ds ei,e f p(e i , e f ) a,mṗ s (a, m|e i , e f ) ln p st (a, m|e f ) is the excess heat flow into the system, roughly the extra heat flow during a driven, nonautonomous process over that required to maintain the steady state [33]. As a result, it remains finite during an irreversible relaxation to a NESS, even though the NESS may break detailed balance.
E. coli is a bacterium that can detect changes in the concentration of nearby ligands in order to perform chemotaxis: the act of swimming up a ligand attractor gradient. It is arguably the best studied example of a SAS. At a constant ligand concentration [L], chemoreceptors in E. coli -such as the one in Fig. 1C have a fixed average activity, which through a phosphorylation cascade translates into a fixed switching rate of the bacterial flagellar motor. When [L] changes, the activity of the receptor A (which is a binary variable labeling two different receptor conformations) increases on a time-scale τ a ∼ 1ms. On a longer time-scale τ m ∼ 10s, the methylesterase CheR and methyltransferase CheB alter the methylation level of the receptor in order to recover the adapted activity value. In this way, the methylation level M (which ranges from none to four methyl groups for a single receptor) is a representation of the environment, acting as the long-term memory (see diagram in Fig. 5A). One important difference with the previous equilibrium model is that the chemotaxis pathway operates via a feedback. The memory is not regulated by the receptor's signal, but rather by the receptor's activity (see motif in Fig. 5B). The implication is that energy must constantly be dissipated to sustain the steady state [19], thus (9) and (10) are the appropriate tools for a thermodynamic analysis.
There is a consensus kinetic model of E. coli chemoreceptors [7,27,[34][35][36]] whose biochemical network is in Fig. 5A. The free energy landscape of the receptor coupled to its environment is with ∆ m the receptor's characteristic energy, m 0 the reference methylation level, and K A/I the active/inactive dissociation constants (values in Methods). In (11) the first term F 0 corresponds to the energy of the receptor, and the second V comes from the interaction with the environment (de facto a ligand reservoir). The dynamics of this receptor consist of thermal transitions between the states with different activity, while transitions between the different methylation levels are powered by a chemical potential gradient ∆µ = 6k B T due to hydrolisis of the methyl donor SAM (see Methods). Continuous hydrolysis of SAM at the steady state sustains the feedback at the expense of energy, allowing accurate adaptation in the ligand concentration range K I [L] K A , see Fig. 5B. To begin our study, we develop an equation analogous to (7), which requires identifying the internal energy of our system. As stated above, we consider the binding and unbinding of ligands as external stimuli, and thus define the internal energy as U t = F 0 (A t , M t ) . Using the excess heat Q ex t , we consistently define the excess work through W ex t = ∆U t − Q ex t , analogous to the first law. Upon substitution into (9) gives showing just as in (7) that measuring requires excess work and free energy. Because here the internal energy U is not a function of the ligand concentration, W ex is not due to signal variation: It represents the energy expended by the cell to respond and adapt to the external chemical force. In Fig. 5C, we compare W ex t and ∆F t to ∆I meas t during a ligand change of ∆[L] ∼ 10 2 µM. The sudden change in [L] produces a smooth, fast (∼ τ a ) increase in the free energy as the activity transiently equilibrates with the new environment. The excess work driving this response comes mainly from the interaction with environment. As adaptation sets in (∼ τ m ), the receptor utilizes that stored free energy, but in addition burns energy by the consumption of SAM. Thus, in order to adapt the cell consumes the free energy stored from the environment, as well as additional excess work coming now mostly from the hydrolysis of SAM molecules. The inequality in (7) with the measured information is satisfied at all times.
The energetic cost of responding and adapting to the ligand change is roughly 0.5k B T , of which much has already been used by t ∼ τ m = 10s. In comparison, the cost to sustain the chemotaxis pathway during this time is roughly ∼ 6k B T (see Methods). This means that the cost to sensing a step change is about 10% of the cost to sustain the sensing apparatus at steady-state. During this process the cell measures (and erases) roughly ∼ 0.3 bits, less than the maximum of 1 bit despite its very high adaptation accuracy. This limitation comes from the finite number of discrete methylation levels, so that the probability distributions in m-space for large and low ligand concentrations have large overlaps (Fig. S3). In other words, it is difficult to discriminate these distributions, even though the averages are very distinct, which results in lower correlation between the methylation level and signal. The minimal energetic cost associated to measuring these ∼ 0.3 bits (≈ 0.2 nats) is 0.2k B T . E. coli dissipates roughly 0.5k B T during this process, thus the energetic cost of sensory adaptation is slightly larger than twice its thermodynamic lower bound (2.5 ≈ 0.5/0.2).
We further explored the cost of sensing in E. coli by examining the net entropy production for ligand changes of different intensity. In Fig. 6A, we plot the amount of information erased/measured for different step changes of the signal up to ∆[L] ∼ 10 5 µM taking as lower base [L] = 50µM. The green shading highlights the region where adaptation is accurate (∆[L] K A ). The information erased is always below 1 bit and saturates for high ligand concentrations, for which the system is not sensitive. The total entropic cost (that is, ∆S na ∞ ) and its relation with the information erased appears in Fig. 6B. The dependence is monotonic, and thus reveals a trade-off between information processing and dissipation in sensory adaptation. Notably, for small acquisition of information (small ligand steps) it grows linearly with the information, an effect observed in ideal measurement systems [17].

Discussion
We have derived generic information-theoretic bounds to sensory adaptation.
We have focused on response-adaptive sensory systems subject to an abrupt environmental switch. This was merely a first step, but the procedure we have outlined here only relies on the validity of the second law of thermodynamics, and therefore can be extend to any small system affected by a random external perturbation to which we can apply stochastic thermodynamics, which is reviewed in [37].
Our predictions are distinct from (although reminiscent of) Landauer's principle [11,12], which bounds the minimum energy required to reset an isolated memory. By contrast, the information erased in our system is its correlations with the signal. There is another important distinction from the setup of Landauer, and more broadly the traditional setup in the thermodynamics of computation [11] as well as the more recent advancements on the thermodynamics of information processing in the context of measurement and feedback [15,[38][39][40][41][42][43][44][45]. There the memory is reset by changing or manipulating it by varying its energy landscape. In our situation, the erasure comes about because the signal is switched. The loss of correlations is stimulated by a change in the measured system -that is the environmental signal; erasure does not occur because the memory itself is altered. Also relevant is [46], which addresses the minimum dissipated work for a system to make predictions about the future fluctuations of the environmental signal, in contrast to the measured information about the current signal, which we have considered.
Our results predict that energy is required to sense changes in the environment, but do not dictate that source of energy. Our equilibrium feedforward model is able to sense and adapt by consuming energy provided by the environment. E. coli's feedback, however, uses mostly external energy to respond, but must consume energy of its own to adapt. The generic bounds here established apply to these two distinct basic topologies, irrespective of their fundamentally different energetics. For E. coli, to quantify to what extent W ex is affected by SAM consumption and ligand binding, a more detailed chemical model is required in conduction with a partitioning of the excess work into distinct terms.
For a ligand change of 10 2 µM, in the region of high adaptation, the information measured/erased is ∼ 0.3 bits. We observed that the corresponding average change in the methylation level for a chemoreceptor is ∼ 0.75, suggesting that a methylation level can store ∼ 0.5 bits for such 1-bit step response operations. Despite the small adaptation error, information storage is limited by fluctuations arising from the finite number of discrete methylation levels. Receptors cooperativity, which is known to reduce fluctuations of the collective methylation level, may prevent this allowing them to store more information. On the energetic side, we have shown that the cost of sensing these ligand changes per receptor is around 10% of the cost of sustaining the corresponding adaptive machinery. We also showed that the energetic cost of binary operations is roughly twice beyond its minimum for large ligand changes, in stark contrast with everyday computers for which the difference is orders of magnitude. Taken together these numbers suggest that 5% of the energy a cell uses in sensing is determined by information-thermodynamic bounds, and is thus unavoidable.
Future work should include addressing sensory adaptation in more complex scenarios. One which has recently aroused attention is fluctuating environments, which so far has been addressed using trajectory information [44,45,47]. However, under physiological conditions this is unlikely to play a significant role given the large separation of time-scales between binding, response, and adaptation [25]. Another scenario is a many bits step operation, in which instead of high and low signals a large discrete set of ligand concentrations is considered. Frequency response and gradient sensing are also appealing [27], since in them the system is in a dynamic steady state in which the memory is continuously erased and rewritten. Analysis of such scenarios is far from obvious, but the tools developed in this work constitute the first step in developing their theoretical framework.

Methods
Kinetics of equilibrium feedforward model: We determine a collection of rates that exhibit response and adaption as in Fig. 1 by first decomposing the steady state distribution as p st (a, m|e) = p m (m|e)p a (a|m, e). As a requirement to show adaptation, the memory must correlate with the signal, which we impose by fixing p m (m|e) = δ m,e (1 − m ) + (1 − δ m,e ) m . Next, in the steady state the activity is A st ≈ 1/2, or since A is binary the probability A = 1 is about 1/2. Recognizing that m is small, the average A st is dominated by adapted configurations with M = e. Thus, adaption will occur by demanding that p a (1|0, 0) = 1/2− a and p a (1|1, 1) = 1/2+ a , with a model parameter a 1. Finally, to fix the activity distribution for non-adapted configurations, M = e, we exploit the time-scale separation τ a τ m . In this limit, after an abrupt change in the signal, the activity rapidly relaxes. To guarantee the proper response, we set p a (1|0, 1) = 1 − g and p a (1|1, 0) = g . Using the symmetry condition p st (a, m|e) = p st (1−a, 1−m|1−e) we complete knowledge of p st . The energy levels F (a, m; e) are obtained using the equilibrium condition F = −k B T ln p st , where we choose as reference F (0, 0; 0) = F (1, 1; 1) = 0. Equation (1) is an approximation of this energy to lowest order in the small errors. Finally, the kinetic rates are obtained using either the approximate or exact energy function, imposing detailed balance, and keeping two bare rates, ω and k, for activity and memory transitions: W m aa (e) = ωe F (a ,m;e)/kBT for activity transitions and W mm a = ke F (a,m ;e)/kBT for memory transitions.
Information bounds on the thermodynamics of sensory adaptation: The bounds in (5) and (6) follow from a rearrangement of the second law of thermodynamics [48]. Consider a system with states x [(a, m) for SAS] with signal-dependent (free) energy function F (x; e) in contact with a thermal reservoir at temperature T . The system is subjected to a random abrupt change in the signal. Specifically, the initial signal is a random variable E i with values e i (which are 0, 1 in the main text), which we randomly change at t = 0 to a new random signal E f with values e f . For times t > 0, we model the evolution of the system's stochastic time-dependent state X t as a continuous-time Markov chain.
We begin our analysis by imagining for the moment that the signal trajectory is fixed to a particular sequence (e i , e f ). Then our thermodynamic process begins prior to t = 0 by initializing the system in its e i -dependent steady state p st (x|e i ) ∝ e −F (x;ei)/k B T . At t = 0, the signal changes to e f and remains fixed while the system's probability density p t (x|e i , e f ), which conditionally depends on the entire signal trajectory, evolves according to the master equation [49] where W e f xx is the signal-dependent transition rate for an x → x transition. The transition rates are assumed to satisfy a local detailed balance condition, ln W e f xx /W e f x x = −(F (x; e f ) − F (x ; e f )/k B T , which allows us to identify the energy exchanged as heat with the thermal reservoir in each jump. Eventually, the system relaxes to the steady state p st (x|e f ) ∝ e −F (x;e f )/k B T corresponding to the final signal value e f .
Since the signal trajectory is fixed, this process is equivalent to a deterministic drive by an external field, and therefore the total entropy production rate will satisfy the second law [48] where ∂ t H(X t |e i , e f ) = − xṗ t (x|e i , e f ) ln p t (x|e i , e f ) is the rate of change of the Shannon entropy of the system conditioned on the entire signal trajectory; anḋ is the heat current into the system from the thermal reservoir given the signal trajectory. Since (15) holds for any signal trajectory, it remains true after averaging over all signal trajectories sampled from the probability density p(e i , e f ): with H(X t |E i , E f ) = ei,e f p(e i , e f )H(X t |e i , e f ), and nonconditioned thermodynamic quantities, such aṡ Q t , denotes signal averages. We next proceed by two judicious substitutions of the definition of the mutual information (2) that tweeze out the contributions from the measured and erased information. First, we replace the Shannon entropy rate as The result is a splitting of the total entropy production rate asṠ tot t =Ṡ eras t +Ṡ meas t , with one part due to erasurė and one due to measuremenṫ The bounds in (5) and (6) follow by integrating (18) and (19) from time 0 to t.
To prove the positivity of (18) and (19), we use the definition of entropy and heat to recast them in terms of a relative entropy D(f ||g) = x f (x) ln(f (x)/g(x)) [29] aṡ Positivity then follows, since the relative entropy decreases whenever the probability density evolves according to a master equation, as in (14) [50].
To arrive at (9) and (10) for genuine NESS, we repeat the analysis above applied to the average nonadiabatic entropy production rate (cf. (17)) whereQ ex t = −k B T ei,e f p(e i , e f ) xṗ t (x|e i , e f ) ln p st (x|e f ) is the excess heat flow into the system [33], taking special note that now p st is the nonequilibrium stationary state and cannot be related to the energy, as in the equilibrium case above (16).
Description of the chemotaxis model: The parameters for F (a, m, s) in (11) are taken from [7] for a Tar  Here, ∆µ = 6k B T is the chemical potential force for the hydrolyzation of a SAM fuel molecule, which occurs when a methyl group is added or removed by CheR and CheB respectively [19], and at the steady state τ mṠ tot st = ∆µ ≈ 6k B T .   Corresponding negative feedback topology, displaying the dissipative energy cycle (green arrow) sustained by adiabatic entropy production, due to the consumption of chemical fuel. (C) Energetics of nonequilibrium measurement in the chemotaxis pathway for a ligand concentration change of ∆L = 10 2 µM (other parameters in Materials and Methods). The instantaneous change in ligand concentration performs chemical work on the cell, which increases its free energy ∆F as the cell responds. To adapt, the bacterium has to provide excess work W ex from its own chemical reservoir, the fuel SAM.