# Supplemental material for “Exploiting bias in optimal finite-time copying
protocols”

Daan Mulder, Pieter Rein ten Wolde and Thomas E. Ouldridge

##  A The average work to copy a data bit

We derive the average work to copy the data bit, which corresponds to the
process that takes the system from state I to state III in Fig. 1 of the main
text. The full finite-time copy protocol consists of several substeps, which
are not shown in that figure. For clarity, we therefore present a more
detailed version of the copy protocol in Fig. S1.

We study the cost to bring the system from state I to VII in Fig. S1. It is
given by

$\displaystyle{\cal W}$
$\displaystyle=k_{B}TI(D;M)+k_{B}TD_{\text{KL}}(P^{f}_{M}||P^{i}_{M})+T\Delta\mathcal{S}^{\text{irr}},$
(S1) $\displaystyle={\cal W}^{\rm rev}+T\Delta\mathcal{S}^{\text{irr}}.$ (S2)

In the top line, the first two terms on the right-hand side give the
reversible work ${\cal W}^{\rm rev}$ to perform the copy operation, which is
the work in the quasi-static limit; the third term is the finite time cost. In
section 2 we derive the latter. First, in section 1, we derive the expression
$\mathcal{W}^{\text{rev}}=k_{B}TI(D;M)+k_{B}TD_{\text{KL}}(P^{f}_{M}||P^{i}_{M})$
for the average reversible work.

###  1 The average reversible work for copying

The average reversible work ${\cal W}^{\rm rev}$ is an average of the
reversible work $W^{\rm rev}_{d}$ to copy each state of the data bit $d$:

$\displaystyle{\cal W}^{\rm rev}=p^{\prime}W^{\rm
rev}_{1}+(1-p^{\prime})W^{\rm rev}_{0},$ (S3)

where $P(D=1)=p^{\prime}$ is the probability that the data bit is in state
$1$. The reversible work $W_{d}^{\rm rev}$ to copy state $d$ of the data bit
is given by the free-energy change $\Delta F_{d}=\Delta U_{d}-T\Delta S_{d}$
over the course of the copy operation, taking the system from state I to VII
in Fig. S1. This observation means that the average work is also given by

$\displaystyle{\cal W}^{\rm rev}$ $\displaystyle=\sum_{d}P(d)\Delta F_{d}$
(S4) $\displaystyle=\sum_{p}P(d)(F_{d}^{f}-F_{d}^{i})$ (S5)
$\displaystyle=\langle F^{f}\rangle-\langle F^{i}\rangle,$ (S6)

where $P(d)=P(D=d)$ is the probability that the data bit is in state $d$,
$F_{d}^{f}$ and $F_{d}^{i}$ are, respectively, the free energy of the memory
bit at the beginning and end of the copy operation when the data bit is in
state $d$, $\langle F^{f}\rangle=\sum_{d}P(d)F_{d}^{f}$ is the average free
energy of the correlated data-memory system at the end of the copy process,
and $\langle F^{i}\rangle$ is the average free energy at the beginning of the
copy process. The average free energy of the memory bit when the system is
state $\alpha=i,f$, i.e. either at the beginning or the end of the copy
process, is

$\displaystyle\langle F^{\alpha}\rangle$
$\displaystyle=\sum_{d}P(d)\sum_{m}P^{\alpha}(m|d)E^{\alpha}(m|d)+k_{\rm
B}T\sum_{d}P(d)\sum_{m}P^{\alpha}(m|d)\ln P^{\alpha}(m|d).$ (S7)

Here, $E^{\alpha}(m|d)$ is the energy of the memory bit when it is in state
$m=0,1$ given that the data bit is in state $d=0,1$ and $P^{\alpha}(m|d)$ is
the probability that the memory bit is in state $m$ given that the data bit is
in state $d$. This equation can be rewritten as

$\displaystyle\langle F^{\alpha}\rangle$
$\displaystyle=\sum_{d}P(d)\sum_{m}P^{\alpha}(m|d)E^{\alpha}(m|d)+k_{\rm
B}T\sum_{m}P^{\alpha}(m)\ln P^{\alpha}(m)$ $\displaystyle+k_{\rm
B}T\sum_{d}P(d)\sum_{m}P^{\alpha}(m|d)\ln\frac{P^{\alpha}(m|d)}{P^{\alpha}(m)}$
(S8) $\displaystyle=U_{M}^{\alpha}-TS_{M}^{\alpha}+k_{\rm B}TI^{\alpha}(D;M),$
(S9) $\displaystyle=F_{M}^{\alpha}+k_{\rm B}TI^{\alpha}(D;M).$ (S10)

Here, $U_{M}^{\alpha}$, $S_{M}^{\alpha}$, $F_{M}^{\alpha}$ are, respectively,
the energy, the entropy, and the free energy of the memory bit, when viewed in
isolation, i.e. marginalizing over the two states of the data bit, either at
the beginning, $\alpha=i$, or at the end, $\alpha=f$, of the copy step. In the
second term, $I^{\alpha}(D;M)$ is the mutual information between the memory
and the data bit when the memory is in state $\alpha=i,f$.

Figure S1: The finite-time copy protocol. This is an expended version of
Figure 1 (a) of the main text: double-well potential showing the energy $E$
for memory state $M=0$ (left) and $M=1$ (right). The circles below show their
respective occupancies. A black line between the wells implies the switching
rates are 0; the memory is fixed. The upper row corresponds to copying state
$d=0$ of the data bit, and the lower row to $d=1$. The substeps are described
in Section 2 under Overview optimal copy protocol.

Using Eq. S6, the average work is given by

$\displaystyle{\cal W}^{\rm rev}=\Delta F_{M}+k_{\rm B}TI(D;M),$ (S11)

where we have exploited that at the beginning of the copy step the mutual
information between the memory and data bit is zero, so that we drop the
superscript $f$ in $I^{f}(D;M)$, with $I(D;M)$ being the mutual information
$I^{f}(D;M)$ at the end of the copy operation, when the system is in state VII
of Fig. S1.

The memory bit starts in thermal equilibrium, such that
$P^{i}(m|d)=P^{i}(m)=p_{m}(t=0)$ is independent of the data bit and obeys the
Boltzmann distribution, $p_{m}(0)=P^{i}(m)=e^{-\beta E^{i}(m)}/Q^{i}$, with
$Q^{i}=e^{-\beta E^{i}(0)}+e^{-\beta E^{i}(1)}=e^{-\beta F^{i}}$ and
$\beta=1/k_{\rm B}T$. Moreover, at the end of the copy operation, the energy
levels have been reset to their original levels, such that
$E^{f}(m|d)=E^{i}(m)$ (see Fig. S1). The free-energy change $\Delta F_{M}$ is
then given by

$\displaystyle\beta\Delta F_{M}=D_{KL}(P_{M}^{f}||P_{M}^{i})$ (S12)

where $D_{KL}(p_{x}||q_{x})=\sum_{x}p_{x}\ln(p_{x}/q_{x})$ is the Kullback-
Leibler divergence between the marginal distribution of the memory bit at the
end and the beginning of the copy operation. The term $\Delta F_{M}$ thus
describes how much the memory bit is driven out of thermal equilibrium during
the copy process, quantifying how much free energy is stored in its non-
equilibrium marginal distribution after the copy step, i.e. in configuration
VII in Fig. S1.

We can express the mutual information $I(D;M)$ and $\Delta F_{M}$ in terms of
the statistics of the data bit, given by $p^{\prime}=P(D=1)$ and the copy
accuracies $s_{0}$ and $s_{1}$. The accuracy $s_{d}$ is defined as the
probability that the memory bit ends up in the same state as the data bit $d$
after the copy operation: $s_{0}=P^{f}(M=0|D=0)$, $s_{1}=P^{f}(M=1|D=1)$, with
$1-s_{0}=P^{f}(M=1|D=0)$ and $1-s_{1}=P^{f}(M=0|D=1)$. The marginal
probability $f$ that the memory bit after the copy operation is in state 1 is
given by

$\displaystyle f=(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}.$ (S13)

Using the short-hand notation for the initial equilibrium distribution of the
memory, $a\equiv p_{1}(0)=P^{i}(M=1)$, we then find for the free-energy change
of the memory bit $\Delta F_{M}$ (Eq. S12) and the mutual information $I(D;M)$
(see third term right-hand side Eq. S8)

$\displaystyle\beta\Delta F_{M}$
$\displaystyle=D_{KL}(P^{f}_{M}||P^{i}_{M})=(1-f)\ln\left(\frac{1-f}{1-a}\right)+f\ln\left(\frac{f}{a}\right)$
(S14) $\displaystyle I(D;M)$
$\displaystyle=(1-p^{\prime})s_{0}\ln\left(\frac{s_{0}}{1-f}\right)+(1-p^{\prime})(1-s_{0})\ln\left(\frac{1-s_{0}}{f}\right)+p^{\prime}(1-s_{1})\ln\left(\frac{1-s_{1}}{1-f}\right)+p^{\prime}s_{1}\ln\left(\frac{s_{1}}{f}\right)$
(S15)

Finally, again exploiting that after the copy operation the energy levels are
reset to their initial equilibrium levels, it can be seen that the reversible
work to copy a given state of the data bit $d$ is given by the Kullback-
Leibler divergence between the initial, equilibrium distribution of the memory
bit and its final distribution given the state of the data bit:

$\displaystyle W_{d}^{\rm rev}$ $\displaystyle=\Delta F_{d}=k_{\rm
B}TD_{KL}(P^{f}_{M|d}||P^{i}_{M}),$ (S16)

which for the two respective data bit states yields:

$\displaystyle W_{0}^{\rm rev}$
$\displaystyle=s_{0}\ln\left(\frac{s_{0}}{1-a}\right)+(1-s_{0})\ln\left(\frac{1-s_{0}}{a}\right)$
(S17) $\displaystyle W_{1}^{\rm rev}$
$\displaystyle=(1-s_{1})\ln\left(\frac{1-s_{1}}{1-a}\right)+s_{1}\ln\left(\frac{s_{1}}{a}\right).$
(S18)

It can be indeed be verified, as we show in Appendix A, that the average
reversible work ${\cal W}^{\rm rev}=p^{\prime}W_{1}^{\rm
rev}+(1-p^{\prime})W_{0}^{\rm rev}$ using Eqs. S17 and S18 gives the same
result as Eq. S11.

Alternative derivation Instead of using $W_{d}=\Delta F_{d}=\Delta
U_{d}-T\Delta S_{d}$ to derive Eqs. S17 and S18, we can arrive at the same
result by considering the work needed to change the state of a memory bit over
the course of an interval of length $\tau$, and then consider the quasi-static
limit, corresponding to $\tau\to\infty$, where the system remains in thermal
equilibrium during the copy operation. This approach is also amenable to the
finite-time case, analyzed in the next section.

In general, irrespective of whether the system remains in thermal equilibrium,
the work to change the state of the system is given by

$\displaystyle W_{d}=\int_{0}^{\tau}dt\sum_{m\in M}p_{m}\frac{dE_{m}}{dt},$
(S19)

where we have used the short-hand notation $p_{m}=P(m|d)$ and $E_{m}=E(m|d)$.
To simplify the equations, we will fix $E_{0}=0$, which ensures its derivative
is also $0$. We are allowed to do so since the energy levels undergo a full
cycle.

In order to perform a copy, $E_{1}$ is altered to bias the memory to the state
that matches the data (see Fig. S1). Subsequently, the barrier between the two
states of the memory is raised, so that the memory remains in this state, and
the energy level $E_{1}$ is reset to its initial value. To account for this
decoupling step, we introduce a jump in the value of $E_{1}$ at $t=\tau$,
which leads to a delta peak in the derivative of $E_{1}$. Eq. S19 can then be
rewritten to yield the work to perform the copy operation, taking the memory
from state I to state VII in Fig. S1, as

$\displaystyle
W_{d}=p_{1}(\tau)E_{1}(\tau)-p_{1}(\tau^{-})E_{1}(\tau^{-})+\int_{0}^{\tau^{-}}dtp_{1}\frac{dE_{1}}{dt},$
(S20)

where use $\tau^{-}$ to refer to the time just before the instantaneous change
in energy. Note that $p_{1}(\tau^{-})=p_{1}(\tau)$: although the energy levels
instantaneously change, the probabilities do not.

For a quasistatic copy operation, the change in energy on the interval
$[0,\tau^{-}]$ happens so slowly that we can assume that the system always
remains in the equilibrium state, so $p_{1}=e^{-\beta E_{1}}/(1+e^{-\beta
E_{1}})$. Rewriting Eq. S20 as an integral over $E_{1}$, using the boundaries
$\beta E_{1}(0)=\beta E_{1}(\tau)=-\ln(a/(1-a))$, and $\beta
E_{1}(\tau^{-})=-\ln(x/(1-x))$, where $x=p_{1}(\tau^{-})=1-s_{0}$ (in the case
$d=0$) or $x=s_{1}$ (in the case $d=1$), we find that the work to copy the
data bit in state $d=0$ is

$\displaystyle\beta W_{0}$ $\displaystyle=p_{1}(\tau)\beta
E_{1}(\tau)-p_{1}(\tau^{-})\beta
E_{1}(\tau^{-})+\int_{E_{1}(0)}^{E_{1}(\tau^{-})}\frac{e^{-\beta
E_{1}}}{1+e^{-\beta E_{1}}}dE_{1}$ $\displaystyle=p_{1}(\tau)\beta
E_{1}(\tau)-p_{1}(\tau^{-})\beta E_{1}(\tau^{-})-\ln\left(1+e^{-\beta
E_{1}(\tau^{-})}\right)+\ln\left(1+e^{-\beta E_{1}(0)}\right)$
$\displaystyle=-(1-s_{0})\ln\left(\frac{a}{1-a}\right)+(1-s_{0})\ln\left(\frac{1-s_{0}}{s_{0}}\right)-\ln\left(1+\frac{1-s_{0}}{s_{0}}\right)+\ln\left(1+\frac{a}{1-a}\right)$
$\displaystyle=s_{0}\ln\left(\frac{s_{0}}{1-a}\right)+(1-s_{0})\ln\left(\frac{1-s_{0}}{a}\right).$
(S21)

just as we found in the first route by using $W_{d}=\Delta F_{d}=\Delta
U_{d}-T\Delta S_{d}$, see Eq. S17. Replacing $s_{0}$ with $1-s_{1}$ gives us
$W_{1}$, and we can calculate $\mathcal{W}$ by averaging over the two, to
arrive at Eq. S11, with $\Delta F_{M}$ and $I(M;D)$ given by Eqs. S14 and S15,
respectively.

Figure S2: Quasistatic cost of copying in the equal accuracy case
($s_{0}=s_{1}=s$) in the case that $P(D=1)=p^{\prime}=0.9$. In (a), we plot
the cost of copying a given state of the data $W_{d}$ for both $d=0$ and
$d=1$, in the case that the accuracy $s=0.95$, as a function of the initial
distribution of the memory, parameterised by $p_{1}(0)$. We see that the
minima are located at the points where no change to the memory bit needs to be
made (i.e. $p_{1}(0)=0.05$ if $d=0$, $p_{1}(0)=0.95$ in the case $d=1$). In
(b), we plot the weighted contributions $P(D=0)W_{0}$ (blue line) and
$P(D=1)W_{1}$ (red line) to the average work
$\mathcal{W}=P(D=0)W_{0}+P(D=1)W_{1}$. When we plot the sum of the two, the
average work $\mathcal{W}$, in panel (c) (thick solid red line), we see that
the bias in the data shifts the minimum of the average cost towards the state
of the memory corresponding to 1, $p_{1}(0)=1$; the red area is the
contribution $P(D=1)W_{1}$ and the blue area is $P(D=0)W_{0}$. The average
work $\mathcal{W}$ is minimized when the initial distribution of the memory,
$p_{1}(0)$, equals the final marginal distribution of the memory after the
copy operation, $f$, i.e. when $p_{1}(0)=f=(1-p^{\prime})(1-s)+p^{\prime}s$
(dashed vertical line). In (d), we split the average cost $\mathcal{W}$ in
terms of mutual information $I(D;M)$ (dark red) and a Kullback-Leibler
divergence $D_{KL}(P_{M}^{f}||P_{M}^{i}$) (red), as in Eq. S11. While the
mutual information is independent of the initial distribution of the memory
bit (area below horizontal dark red line), the latter (area between red and
dark red line) is indeed minimized and equal to 0 when the initial
distribution of the memory equals the final distribution of the memory
averaged over the two states of the data bit, $p_{1}(0)=f$ (as marked by
dashed vertical line).

Optimal initial distribution in the quasistatic case. The cost of quasistatic
copying is plotted in in Fig. S2 as a function of the initial distribution of
the memory, characterized by $p_{1}(0)$, in the case that the copying
accuracies are identical and equal $s_{0}=s_{1}=0.95$, and the data bit has a
bias ($P(D=1)=p^{\prime}=0.9$). Despite the fact that the cost $W_{0}$ is the
mirror image of $W_{1}$ in the line $p_{1}(0)=1/2$ (panel (a)), the weighted
cost $P(d)W_{d}$ (panel (b)) is not symmetric due to the bias in the data.
This implies that the average quasistatic cost
$\mathcal{W}^{\text{rev}}=\sum_{d}P(D=d)W_{d}$ is not symmetric around
$p_{1}(0)=1/2$ either. In fact, we see in panels (c,d) that the total quasi-
static cost $k_{B}TI(D;M)+k_{B}TD_{KL}(P^{f}_{M}||P^{i}_{M})$ is minimized
when the initial distribution of the memory bit, characterized by $p_{1}(0)$,
equals the final distribution after the copy operation, parameterised by $f$,
i.e. when $p_{1}(0)=f$ (see Eq. S13, dashed vertical line in Fig. S2(c,d));
this value ensures that $D_{KL}(P_{M}^{f}|P_{M}^{i})=0$ (see Eq. S14). In this
case, the cost is only given by the mutual information $k_{B}TI(D;M)$ after
the copy operation, which indeed does not depend on $p_{1}(0)$ (Fig. S2(d),
horizontal dark red line).

###  2 Derivation minimal work $W_{d}$ to copy data bit in finite time

In this section, we derive the work to perform a copy operation in a finite
time $\tau$, Eq. S2. The general setup of the protocol is given by Fig. S1. We
will see that the work $W_{d}$ to copy a given state $d$ of the data bit can
be written as a sum of two terms,

$\displaystyle W_{d}=\Delta F_{d}+T\Delta S^{\text{irr}}_{d},$ (S22)

where $\Delta F_{d}$ is the free-energy change over the course of the copy
operation, i.e. the minimal work if the process were quasistatic, and $T\Delta
S^{\text{irr}}_{d}$ is the finite time cost, both given that the state of the
data bit is $d=0,1$. With $P(D=d)=p^{\prime}$ the probability that the data
bit is in state $d$, the average work to copy the data bit is then given by

$\displaystyle\mathcal{W}$ $\displaystyle=(1-p^{\prime})W_{0}+p^{\prime}W_{1}$
(S23) $\displaystyle=(1-p^{\prime})(\Delta F_{0}+\Delta
TS^{\text{irr}}_{0})+p^{\prime}(\Delta F_{1}+T\Delta S^{\text{irr}}_{1})$
(S24) $\displaystyle=(1-p^{\prime})\Delta F_{0}+p^{\prime}\Delta
F_{1}+T\Delta\mathcal{S}^{\text{irr}},$ (S25)

where in the last line the first two terms on the right-hand side of the
equation are the average reversible work, analyzed in the previous section,
and we have defined the average irreversible entropy production
$\Delta\mathcal{S}^{\text{irr}}=(1-p^{\prime})S^{\text{irr}}_{0}+p^{\prime}\Delta
S^{\text{irr}}_{1}$.

To find an expression for Eq. S22, and be able to minimize the finite-time
costs, we model the memory as a two state energy landscape with a master
equation

$\displaystyle\dot{p_{1}}=-\dot{p_{0}}=k_{10}(t)p_{0}(t)-k_{01}(t)p_{1}(t),$
(S26)

with a fixed relaxation rate $k_{T}=k_{10}+k_{01}$. These dynamics are also
studied in [1, 2]. Our derivation for the minimal work $W_{d}$ to copy a given
state of the data bit $d$ within a time $\tau$ follows that of [2] for a bit
reset in finite time. For brevity of notation, we take in what follows below,
$k_{\rm B}T=1$. Given that we fix $E_{0}=0$, we have that
$E_{1}(t)=-\ln(k_{10}/k_{01})$ since the equilibrium state must obey the
Boltzmann distribution.

The memory starts in an equilibrium state with
$P_{M}^{i}=\\{p_{0}(0),p_{1}(0)\\}$ and will change to $p_{0}(\tau)=s_{0}$ and
$p_{1}(\tau)=1-s_{0}$ when $d=0$, or $p_{0}(\tau)=1-s_{1}$ and
$p_{1}(\tau)=s_{1}$ when $d=1$. We calculate the work $W_{d}$ associated with
the optimal protocol by integrating the power
$\dot{W}=\sum_{i}p_{i}\dot{E_{i}}$. Since $E_{0}$ remains $0$ over the whole
course of the interval, its derivative is $0$ as well, so it does not
contribute to the required work, and $\dot{W}=p_{1}\dot{E_{1}}$.

Before we proceed, note that from Eq. S26 we can straightforwardly obtain the
minimal time $\tau_{\rm min}$ that is required to perform a copy operation
with an accuracy $s$, which is the time at which the work diverges. It
corresponds, for $d=1$, to the case that $U_{1}=-\infty$, so that
$k_{10}=k_{T}$ and $k_{01}=0$. The minimal time $\tau_{\rm min}$ necessary to
achieve an accuracy $s_{1}=p_{1}(\tau)$ is then given by
$\tau_{\text{min}}=-1/k_{T}\ln\left(1-s_{1})/(1-p_{1}(0))\right)$, for
$s_{1}>p_{1}(0)$. A similar argument shows that in the case $d=0$,
$\tau_{\text{min}}=-1/k_{T}\ln\left(1-s_{0})/(1-p_{0}(0))\right)=-1/k_{T}\ln\left(1-s_{0})/p_{1}(0)\right)$.

Overview optimal copy protocol. The optimal protocol takes the following form,
see Fig. S1: We raise the barrier between the two memory states and then
instantaneously change $E_{1}(t)$ from its equilibrium value
$E_{1}(0)=-\ln(p_{1}(0)/(1-p_{1}(0)))$ to $E_{1}(0^{+})$ (step (a.1) in Fig.
S1). This step being instantaneous means that this step is much faster than
the time it takes the memory to cross the barrier between its two states. We
then lower the barrier again, and next change $E_{1}(t)$ continuously such
that over the course of the interval $[0^{+},\tau^{-}]$ the memory bit reaches
the desired final distribution at $t=\tau$, set by the copy accuracy $s_{d}$
(step (a.2) in Fig. S1); during this operation $p_{1}$ relaxes toward the
evolving equilibrium distribution, following Eq. S26. At $t=\tau$
(configuration V in Fig. S1) , in the decoupling step, the barrier is raised
and $E_{1}(\tau^{-})$ is discontinuously changed back to
$E_{1}(\tau)=E_{1}(0)$ (step (b) in Fig. S1). This decoupling step brings the
memory to state VII.

Derivation minimal finite time work. The steps shown in Fig. S1 give the
following contributions to the cost:

$\displaystyle W_{d}$
$\displaystyle=\int_{0}^{\tau}dtp_{1}\dot{E_{1}}=p_{1}(0)[E_{1}(0^{+})-E_{1}(0)]+p_{1}(\tau)[E_{1}(\tau)-E_{1}(\tau^{-})]+\int_{0+}^{\tau^{-}}dtp_{1}\dot{E_{1}}$
$\displaystyle=-p_{1}(0)E_{1}(0)+p_{1}(\tau)E_{1}(\tau)-\int_{0+}^{\tau^{-}}dt\dot{p_{1}}E_{1}$
$\displaystyle=(p_{1}(\tau)-p_{1}(0))\ln\left(\frac{1-p_{1}(0)}{p_{1}(0)}\right)-\int_{0+}^{\tau^{-}}dt\dot{p_{1}}E_{1},$
(S27)

where in the first line we have written out the result for the integral of the
Dirac delta function associated with the discontinuous change of $E_{1}$ at
the start and at the end of the copy operation (step (a.1) and (b) in Fig.
S1). We perform a partial integration in the next line, where the boundary
terms with $E_{1}(0^{+})$ and $E_{1}(\tau^{-})$ are cancelled by the Dirac
delta terms since $p_{1}(0)=p_{1}(0^{+})$ and $p_{1}(\tau)=p_{1}(\tau^{-})$.
In the last line we have exploited that after the decoupling step
$E_{1}(\tau)=E_{1}(0)$, and the system is in equilibrium initially.

We note that the first term on the right-hand side of Eq. S27 in the last line
gives the energy change $\Delta U_{d}$ over the copy process, taking the
system from state I $\to$ VII in Fig. S1. The second term is the heat $-Q_{d}$
transferred to the environment. In accordance with the first law of
thermodynamics $W_{d}=\Delta U_{d}-Q_{d}$, and in the spirit of stochastic
thermodynamics, this transferred heat equals the temperature $T$ times the
entropy change in the environment $\Delta S_{{\rm env},d}$, which in turn
equals the total entropy production $\Delta{\cal S}^{\rm irr}_{d}$ minus the
entropy change of the system $\Delta S_{d}$:
$-\int_{0^{+}}^{\tau^{-}}dt\dot{p}_{1}E_{1}=-Q_{d}=-T\Delta S_{d}+T\Delta{\cal
S}^{\rm irr}_{d}$. The derivation below will make this observation concrete.

We derive the optimal protocol via an Euler-Lagrange equation as in [1]. We
define a Lagrangian $\mathcal{L}=-\dot{p_{1}}E_{1}$, such that Eq. S27 becomes

$\displaystyle
W_{d}=(p_{1}(\tau)-p_{1}(0))\ln\left(\frac{1-p_{1}(0)}{p_{1}(0)}\right)+\int_{0^{+}}^{\tau^{-}}dt\mathcal{L}.$
(S28)

To use the Euler-Lagrange equation we must write
$\mathcal{L}=-\dot{p_{1}}E_{1}$ in terms of $p_{1}$ and $\dot{p_{1}}$. We can
do this by writing $E_{1}$ in terms of $k_{01}$ and $k_{10}$, and rewriting
these rates in terms of $p_{1}$ and $\dot{p_{1}}$ by using Eq. S26, the fact
that $p_{0}+p_{1}=1$ and the assumption $k_{T}=k_{01}+k_{10}$. Exploiting
these observations, we can indeed write $E$ and hence ${\cal L}$ as a function
of $p_{1}$ and $\dot{p}_{1}$: ${\cal
L}(p_{1},\dot{p}_{1})=-\dot{p}_{1}E(p_{1},\dot{p}_{1})$. Next, we will show
that for the optimal trajectory that minimizes the work, we can write
$\dot{p_{1}}$ in terms of $p_{1}$, so that we can write $E_{1}$ for the
optimal protocol as a function of $p_{1}$ only: $\tilde{E_{1}}(p_{1})$. We can
then calculate the work by changing variables in Eq. S28, yielding

$\displaystyle
W_{d}^{\text{min}}=(p_{1}(\tau)-p_{1}(0))\ln\left(\frac{1-p_{1}(0)}{p_{1}(0)}\right)-\int_{p_{1}(0^{+})}^{p_{1}(\tau^{-})}dp_{1}\tilde{E_{1}}(p_{1}),$
(S29)

as we will now show. Note that this minimal work $W_{d}^{\rm min}$ corresponds
to the minimal work $W_{d}$ in the main text, where we have omitted the
superscript “min” for brevity of notation.

Specifically, to calculate $W_{d}^{\text{min}}$, we start by rewriting Eq. S26
to obtain

$\displaystyle\frac{k_{10}}{k_{01}}=\frac{k_{T}p_{1}+\dot{p_{1}}}{k_{T}(1-p_{1})-\dot{p_{1}}},$
(S30)

leading to

$\displaystyle\mathcal{L}=-\dot{p_{1}}E_{1}=\dot{p_{1}}\ln\left(\frac{k_{10}}{k_{01}}\right)=\dot{p_{1}}\ln\left(\frac{k_{T}p_{1}+\dot{p_{1}}}{k_{T}(1-p_{1})-\dot{p_{1}}}\right).$
(S31)

We now use the fact that for a Lagrangian $\mathcal{L}(p_{1},\dot{p_{1}})$
with no explicit time dependence, any solution of the Euler-Lagrange equations
is also a solution of
$\kappa=\dot{p_{1}}\frac{\partial\mathcal{L}}{\partial\dot{p_{1}}}-\mathcal{L}$,
where $\kappa$ is a conserved quantity, i.e. a constant. One can see this by
taking the derivative of $\kappa$ with respect to $t$ and using the Euler-
Lagrange equation to show $\dot{\kappa}=0$. As we will show later, we can
determine the value of $\kappa$ from the boundary conditions: the values of
$p_{1}(0)$ and $p_{1}(\tau)$, with $p_{1}(\tau)$ set by the required accuracy
and the state $d$ of data bit, and $p_{1}(0)$ a parameter that we will
optimize to minimize the work. Using Eq. S31, we find that $\kappa$ is given
by

$\displaystyle\kappa=\frac{k_{T}\dot{p_{1}}^{2}}{(k_{T}p_{1}+\dot{p_{1}})(k_{T}(1-p_{1})-\dot{p_{1}})},$
(S32)

which yields

$\displaystyle\dot{p_{1}}=\frac{k_{T}\kappa(1-2p_{1})+\sqrt{k_{T}^{2}\kappa^{2}(1-2p_{1})^{2}+4(k_{T}+\kappa)k_{T}^{2}\kappa
p_{1}(1-p_{1})}}{2(k_{T}+\kappa)}=\frac{1-2p_{1}+\sqrt{1+4k_{T}p_{1}(1-p_{1})/\kappa}}{2(1/\kappa+1/k_{T})}.$
(S33)

Here, we have chosen the positive solution of $\dot{p_{1}}$, assuming $p_{1}$
is increasing. We can do so without loss of generality by using a symmetry
argument: the work to bring the memory from $p_{1}(0)$ to $p_{1}(\tau)$ is the
same as the work to bring it from $1-p_{1}(0)$ to $1-p_{1}(\tau)$. Hence, if
$p_{1}$ is decreasing, we can use $1-p_{1}$, which is increasing, as an
argument instead of $p_{1}$.

The constant of motion $\kappa$ differs from that of [3], because we minimize
the work for a given time $\tau$, instead of a given average number of
transitions per copy, $A=\int_{0}^{\tau}dt(k_{10}p_{0}+k_{01}p_{1})$ [4].

Filling Eq. S33 into $\mathcal{L}$, Eq. S31, we find that

$\displaystyle\int_{0^{+}}^{\tau^{-}}dt\mathcal{L}=\int_{p_{1}(0^{+})}^{p_{1}(\tau^{-})}dp_{1}\ln\left(\frac{(\kappa+k_{T})p_{1}+\frac{\kappa}{2}(1-2p_{1}+\sqrt{1+4k_{T}p_{1}(1-p_{1})/\kappa})}{(\kappa+k_{T})(1-p_{1})-\frac{\kappa}{2}(1-2p_{1}+\sqrt{1+4k_{T}p_{1}(1-p_{1})/\kappa})}\right).$
(S34)

This integral has indeed the form of Eq. S29, with the integrand being
$\tilde{E}_{1}$, which is a function of $p_{1}$ only. We can perform this
integral to obtain

$\displaystyle\int_{0^{+}}^{\tau^{-}}dt\mathcal{L}$
$\displaystyle=\left[2\ln(1-p_{1})-\ln(1+2k_{T}(1-p_{1})/\kappa+\sqrt{Y}))+p_{1}\ln\left(\frac{1+2k_{T}p_{1}/\kappa+\sqrt{Y}}{1+2k_{T}(1-p_{1})/\kappa-\sqrt{Y}}\right)\right.$
$\displaystyle\left.+\sqrt{\frac{\kappa}{k_{T}}}\tan^{-1}\left(\frac{\sqrt{k_{T}}(2p_{1}-1)}{\sqrt{\kappa
Y}}\right)\right]_{p_{1}(0^{+})}^{p_{1}(\tau^{-})},$ (S35)

where we have defined $Y\equiv 1+4k_{T}p_{1}(1-p_{1})/\kappa$ to simplify the
expression. In the limit $\kappa\to 0$, which corresponds to the quasistatic
limit $\tau\to\infty$, the expression between the brackets simplifies to minus
the entropy $p_{1}\ln p_{1}+(1-p_{1})\ln(1-p_{1})$ plus an integration
constant, so that filling in $p_{1}(0^{+})=p_{1}(0)$ and
$p_{1}(\tau^{-})=s_{1}$ when $d=1$ or $p_{1}(\tau^{-})=1-s_{0}$ when $d=0$
gives the entropy decrease in the system in the quasistatic case. Together
with the first term on the right-hand side of Eq. S28 this then indeed gives
the reversible work for copying the two states of the data bit, given by Eq.
S17 and Eq. S18 for $d=0$ and $d=1$, respectively.

The expression in Eq. S35 still depends on $\kappa$. To calculate
$W_{d}^{\text{min}}$ as a function of $p_{1}(0)$, $p_{1}(\tau^{-})$, $k_{T}$
and $\tau$, we need to determine the appropriate value of $\kappa$ given these
conditions. In order to do so, we rewrite the differential equation in Eq. S33
in terms of $p_{1}$:

$\displaystyle\dot{p_{1}}=\frac{1-2p_{1}+\sqrt{1+4k_{T}p_{1}(1-p_{1})/\kappa}}{2(1/\kappa+1/k_{T})}.$
(S36)

Dividing both sides by the right-hand side, and integrating from $0^{+}$ to
$\tau^{-}$, using $\dot{p_{1}}dt=dp_{1}$, we can get

$\displaystyle k_{T}\tau$
$\displaystyle=\left[\sqrt{\frac{k_{T}}{\kappa}}\tan^{-1}\left(\frac{(2p_{1}-1)\sqrt{k_{T}}}{\sqrt{\kappa
Y}}\right)\right.$
$\displaystyle\left.+\frac{1}{2}\left(\tanh^{-1}\left(\frac{\sqrt{Y}}{1+2(1-p_{1})k_{T}/\kappa}\right)-\tanh^{-1}\left(\frac{\sqrt{Y}}{1+2p_{1}k_{T}/\kappa}\right)-\ln(p_{1}(1-p_{1}))\right)\right]_{p_{1}(0^{+})}^{p_{1}(\tau^{-})},$
(S37)

where $Y=1+4k_{T}p_{1}(1-p_{1})/\kappa$ again. Note that the inverse
hyperbolic tangents are defined since $\sqrt{Y}$ is smaller than both
$1+2p_{1}k_{T}/\kappa$ and $1+2(1-p_{1})k_{T}/\kappa$. We can numerically
solve this expression for $\kappa$, with the appropiate boundary conditions:
$p_{1}(0^{+})=p_{1}(0)$ and $p_{1}(\tau^{-})=s_{1}$ when $d=1$ or
$p_{1}(\tau^{-})=1-s_{0}$ when $d=0$. We can use this value of $\kappa$ in Eq.
S35 to find the minimal value of the work using Eq. S28.

Figure S3: Characteristics of finite-time copying. The optimal protocol
$|\Delta E|(t)$ to make a copy of accuracy $s_{1}=0.95$ of the data bit in
state $d=1$, starting from $p_{1}=p_{0}=1/2$ for different values of the copy
time $k_{T}\tau$ is plotted in (a). In this case
$k_{T}\tau_{\text{min}}\approx 2.30$ (vertical grey line). At $t=0$, the
energy level $E_{1}(t)=\Delta E(t)$ (since $E_{0}$ is zero) starts at $\Delta
E(0)=0$, and is then instantaneously set to $\Delta E(0^{+})$. Over the course
of the copy process, the energy level is further raised until $t=\tau$, when
it is instantaneously brought back to its initial value, see Fig. S1. The
black dotted line represents the value of $\Delta E$ for a quasistatic
measurement. A finite copy time requires that $|\Delta E|$ is larger than this
quasistatic value for at least the final portion of the measurement. At
$k_{T}\tau_{\text{min}}$, the required energy difference diverges. In panel
(b), we plot the corresponding value of $p_{1}(t)$, the probability to find
the memory in state $m=1$, as a function of time $t$, over the course of the
copy operation. We plot this quantity for different durations of the copy
operation $\tau$. Since the energy difference between the two states of the
memory abruptly changes at $t=0$ (see Fig. S1), the derivative of $p_{1}$ is
non-zero at $t=0$. At the end of the protocol, $p_{1}(\tau)=s_{1}=0.95$ as set
by the required accuracy $s_{1}$ (horizontal dotted line). The operation
requires a minimal time $\tau_{\rm min}$ due to the finite relaxation time of
the system, which leads to a forbidden zone in the plot (grey area). In (c),
we plot the minimally required work to bring the system from $p_{1}(0)=1/2$ to
$p_{1}(\tau)=s_{1}$ as function of copy time $k_{T}\tau$ for different values
of the accuracy $s_{1}$. As $k_{T}\tau\to\infty$, the cost decreases to its
value in the quasi-static limit, $\Delta F=\ln(2)+s_{1}\ln
s_{1}+(1-s_{1})\ln(1-s_{1})$ (dashed line). For smaller values of $k_{T}\tau$,
the cost increases and diverges at $k_{T}\tau_{\text{min}}$. In (d), we plot
the asymptotic expansion of the work $W$ in $1/k_{T}\tau$, for the case
$p_{1}(0)=1/2$ and $s_{1}=0.95$. In the long time regime $k_{T}\tau\to\infty$,
the cost converges to the quasistatic cost $W^{\text{rev}}=\Delta F$ as
$1/k_{T}\tau$. As expected, the approximation fails in the short-time regime,
where it does not account for the minimally required copy time. The inset
shows the value of $W-W^{\text{{rev}}}$, as a function of $1/k_{T}\tau$,
highlighting that the approximation correctly captures the first-order
correction to the copy cost.

Characteristics of finite-time protocol. We show characteristics of the
optimal finite time protocol in Fig. S3. As observed in earlier work on bit
resetting [1, 2], the optimal protocol consists of a jump, and subsequently a
gradual change in the difference between the energy levels, in order to force
the system to the desired final state. The shorter $\tau$, the larger the jump
and the change in $\Delta E$ over the course of the interval (see panel (a)).
Due to the constrained rates of the system, the distribution $p_{1}(0)$ can
not change faster than an exponential with rate $k_{T}$ (panel (b)). This
leads to a finite-time cost which diverges for a value of
$\tau_{\text{min}}>0$ (panel (c)). Clearly, a higher required accuracy demands
a higher minical copy time $\tau_{\rm min}$.

Work for asymmetric accuracies. In the main text, we discuss copying at fixed
mutual information, allowing the two accuracies $s_{0}$ and $s_{1}$ to vary
along a contour of the information (see Fig. 1(b) of the main text). In Fig.
S4 we compare the finite time results ($\tau=2.5$) of $W_{d}$ plotted in
Figure 1 (c) and (d) of the main text to the quasistatic cost
($\tau\to\infty$). We show contour plots of $W_{d}$ as a function of accuracy
$s_{1}$ and initial distribution of the memory $p_{1}(0)$, in the case of
$d=0$ (panel (a) and (b)), and $d=1$ (panel (c) and (d)). The required work is
zero if $p_{1}(0)=1-s_{0}$ in the case $d=0$ and zero for $p_{1}(0)=1-s_{1}$
in the case $d=1$, highlighted by the dashed black lines. For a given value of
$s_{1}$ and $p_{1}(0)$, the required work increases as $\tau$ decreases.
Furthermore, a striking aspect of the contour plots for $\tau=2.5$ is the
emergence of the “forbidden” white areas, where the cost diverges since the
initial and final distributions of the memory are too far apart to bridge
within that short copy time.

Figure S4: Contour plots of work $W_{d}$ to copy a data bit in state $d$ as a
function of $s_{1}$ and $p_{1}(0)$, in the case that $d=0$ (a-b) and $d=1$
(c-d), in the quasistatic case (a) and (c) and in the case of short copy time
$\tau=2.5$ (b) and (d), as shown in the main text. The data bit is biased,
with $p^{\prime}=0.9$, and $s_{0}$ is covaried with $s_{1}$ along the marked
iso-information contour of Fig. 1 (b) of the main text; this contour crosses
the diagonal of equal copying accuracy at $s_{1}=s_{0}=s=0.95$ (marked by grey
vertical lines). The work $W_{d}$ is minimal and equal to $0$ if
$p_{1}(0)=p_{1}(\tau)$, which equals $1-s_{0}$ if $d=0$, and $s_{1}$ if $d=1$
(black dashed lines). For a given value of $s_{1}$, the work increases with
the distance between $p_{1}(0)$ and $p_{1}(\tau)$, and is higher the smaller
the value of $\tau$ is. Whereas the work stays finite in the quasistatic case,
there is a forbidden region (white) where the work diverges in the finite-time
case, bounded by $p_{1}(0)=(1-s_{0})\exp(k_{T}\tau)$ for $d=0$ and
$p_{1}(0)=1-(1-s_{1})\exp(k_{T}\tau)$ for $d=1$.

Expression for work in the long-time limit. We derive an expression for the
the work in the long-time limit $k_{T}\tau\to\infty$ to first order in
$1/k_{T}\tau$. To this end, we write Eq. S37 as

$\displaystyle k_{T}\tau$
$\displaystyle=\Bigg{[}\sqrt{\frac{k_{T}}{\kappa}}\tan^{-1}\left(\frac{(2p_{1}-1)\sqrt{k_{T}}}{\sqrt{\kappa
Y}}\right)$
$\displaystyle+\frac{1}{4}\ln\left(\frac{1+2p_{1}(1-p_{1})(\frac{k_{T}}{\kappa}-1)-(1-2p_{1})\sqrt{Y}}{1+2p_{1}(1-p_{1})(\frac{k_{T}}{\kappa}-1)+(1-2p_{1})\sqrt{Y}}\right)-\frac{1}{2}\ln(p_{1}(1-p_{1}))\Bigg{]}_{p_{1}(0^{+})}^{p_{1}(\tau^{-})}.$
(S38)

Eq. S32 shows that in the long-time limit $k_{T}\tau\to\infty$, where
$\dot{p}_{1}\to 0$, the constant of motion becomes vanishingly small,
$\kappa\to 0$. In this limit, the arctan-term in Eq. S38 is the only relevant
term, since the other two terms are bounded given the values of
$p_{1}(\tau^{-})$ and $p_{1}(0^{+})$. In the long-time limit, Eq. S38, with
$Y=1+4k_{T}p_{1}(1-p_{1})/\kappa$, therefore reduces to:

$\displaystyle
k_{T}\tau\approx\left[\sqrt{\frac{k_{T}}{\kappa}}\tan^{-1}\left(\frac{(2p_{1}-1)\sqrt{k_{T}}}{\sqrt{\kappa+4p_{1}(1-p_{1})k_{T}}}\right)\right]_{p_{1}(0^{+})}^{p_{1}(\tau^{-})}\approx\left[\sqrt{\frac{k_{T}}{\kappa}}\tan^{-1}\left(\frac{p_{1}-\frac{1}{2}}{\sqrt{p_{1}(1-p_{1})}}\right)\right]_{p_{1}(0^{+})}^{p_{1}(\tau^{-})}.$
(S39)

We can write Eq. S35 in the same limit, where we obtain

$\displaystyle\int_{0^{+}}^{\tau^{-}}dt\mathcal{L}\approx\left[(1-p_{1})\ln(1-p_{1})+p_{1}\ln(p_{1})+\sqrt{\frac{\kappa}{k_{T}}}\tan^{-1}\left(\frac{p_{1}-\frac{1}{2}}{\sqrt{p_{1}(1-p_{1})}}\right)\right]_{p_{1}(0^{+})}^{p_{1}(\tau^{-})}.$
(S40)

The first two terms equal $-T\Delta S_{d}$ Combining Eq. S39 and Eq. S40, we
see that

$\displaystyle\int_{0^{+}}^{\tau^{-}}dt\mathcal{L}$
$\displaystyle\approx-T\Delta S_{d}+\frac{d(P_{M}^{i},P_{M}^{f})}{k_{T}\tau},$
(S41)

where the distance between the final and initial state
$d(P_{M}^{i},P_{M}^{f})$ is given by

$\displaystyle d(P_{M}^{i},P_{M}^{f})$
$\displaystyle=\left(\sin^{-1}\left(2p_{1}^{f}-1\right)-\sin^{-1}\left(2p_{1}^{i}-1\right)\right)^{2}$
(S42)

and we have used the fact that
$\tan^{-1}((x-1/2)/\sqrt{x(1-x)})=\sin^{-1}(2x-1)$ and
$p_{1}(0^{+})=p_{1}(0)=p_{1}^{i}$ and $p_{1}(\tau^{-})=p_{1}(\tau)=p_{1}^{f}$.
Note that Eq. S42 is symmetric under the transformation $p_{1}\to 1-p_{1}$, so
we can use this result irrespective of whether $p_{1}$ is increasing or
decreasing; this observation allows us to use the above result to obtain both
the work $W_{0}$ for copying data bit state $d=0$ and $W_{1}$ for copying
$d=1$.

By combining Eq. S28 and Eqs. S41 and S42, we now find by filling in the
appropriate values of $p_{1}^{i}$ and $p_{1}^{f}$ that

$\displaystyle W_{0}(\tau)$ $\displaystyle\approx\Delta
F_{0}+\frac{1}{k_{T}\tau}\left(\sin^{-1}\left(2s_{0}-1\right)+\sin^{-1}\left(2p_{1}(0)-1\right)\right)^{2}$
(S43)

and

$\displaystyle W_{1}(\tau)$ $\displaystyle\approx\Delta
F_{1}+\frac{1}{k_{T}\tau}\left(\sin^{-1}\left(2s_{1}-1\right)-\sin^{-1}\left(2p_{1}(0)-1\right)\right)^{2}.$
(S44)

The distance $d(P_{M}^{i},P_{M}^{f})$ is independent of the copy time $\tau$.
Eqs. S43 and S44 thus show that in the long-time limit the finite-time cost to
copy a data bit, $W_{d}$, scales with the copy time as $1/\tau$, as observed
for other finite-time transport problems, like in [5]. We compare the full and
approximate expression for the work in Fig. S3 (d). Clearly, the approximation
correctly captures the work in the long-time limit.

Figure S5: Symmetry breaking for an unbiased data bit ($p^{\prime}=0.5$). (a)
Iso-information contours for an unbiased bit $p^{\prime}=0.5$. In bold, the
iso-information contour along which the work is optimized; it crosses the
diagonal $s_{1}=s_{0}$ line at $s_{0}=s_{1}=0.95$. The other panels show the
total work (panels (b,c)), the quasistatic work (panel (e) and the finite-time
cost (panels (f-h)) along this bold contour. (b) The total work $\mathcal{W}$
(solid lines) and the work $\mathcal{W}_{\rm we}$ with extraction of the free
energy stored in the memory bit, given by $k_{B}TD_{KL}(P_{M}^{f}||P_{M}^{i})$
(dashed lines), as a function of the initial distribution of the memory bit,
characterized by $p_{1}(0)$, for different values of the copy time $\tau$;
$s_{1}$ has been optimized over. For sufficiently short copy times, a symmetry
breaking transition occurs, irrespective of whether
$D_{KL}(P_{M}^{f}||P_{M}^{i})$ is extracted or not. (c) Work $\mathcal{W}_{\rm
do}$ as a function of $p_{1}(0)$ in the direct overwrite scenario, in which
$p_{1}(0)=f$; $s_{1}$ has been optimized over. No symmetry-breaking transition
occurs. (d) The optimal values of $p_{1}(0)$ (black lines) and $s_{1}$ (blue
lines) as a function of the copy time $\tau$, with (dashed lines) and without
$D_{KL}(P_{M}^{f}||P_{M}^{i})$ extraction (solid lines). Extracting the free
energy stored in the memory bit alone, corresponding to a total cost without
the $D_{KL}$ term (dashed lines), causes the symmetry-breaking transition to
happen earlier, i.e. at larger copy times; this is because the symmetry-
breaking transition is driven by the finite-time cost, which becomes
relatively larger when the $D_{KL}$ cost is omitted. In the scenario without
$D_{\text{KL}}$-term, the optimal values equal the minimal or maximal value
within numerical accuracy for $\tau<2.5$. (e) The quasi-static work
$k_{B}TI(D;M)+k_{B}TD_{KL}(P_{M}^{f}||P_{M}^{i})$ as a function of $p_{1}(0)$
and $s_{1}$. The red line shows the line
$p_{1}(0)=f=(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}$ along which
$D_{KL}(P_{M}^{f}||P_{M}^{i})$ is zero. The quasi-static work cannot induce a
symmetry-breaking transition. (f) - (h) Finite-time cost
$\Delta\mathcal{S}^{\rm irr}$ as a function of $p_{1}(0)$ and $s_{1}$ for
three values of the copy time: $\tau=5$ (panel (f)), $\tau=2.5$ (panel (g)),
and $\tau=2.3$ (panel (h)). The dashed line shows the value of $p_{1}(0)$ that
minimize the finite-time cost as a function of $s_{1}$; the solid line with
the same color shows the value of $p_{1}(0)$ as a function of $s_{1}$ that
minimizes the total work $\mathcal{W}$. For large copy times, the minimum
corresponds to $p_{1}(0)=1/2$ and $s_{1}=s_{0}$, marked by the colored dot in
panel (f), but for sufficiently short copy times, two minima develop, near,
respectively, $p_{1}(0)\to 1$ and $s_{1}\to 1$, and $p_{1}(0)\to 0$ and
$s_{0}\to 1$ (and $s_{1}\to s_{1}^{\rm min}$, i.e. the smallest value along
the bold iso-information contour of (a)); the colored dots mark the minima of
$\mathcal{W}$, see also panel (d). The red line in panels (f)-(h) is the same
as that in panel (e).

Averaging the work $W_{d}$ over both states of the data bit $d=0,1$, using the
results from Eqs. S11 and S12 to show that the averaging of $\Delta F_{d}$
yields the mutual information $I(D;M)$ and Kullback-Leibler divergence
$D_{KL}(P_{M}^{f}||P_{M}^{i})$, we find that, to first order in $\tau^{-1}$

$\displaystyle\beta\mathcal{W}(\tau)=$ $\displaystyle
I(D;M)+D_{KL}(P_{M}^{f}||P_{M}^{i})+\frac{(1-p^{\prime})}{k_{T}\tau}\left(\sin^{-1}\left(2s_{0}-1\right)+\sin^{-1}\left(2p_{1}(0)-1\right)\right)^{2}$
$\displaystyle+\frac{p^{\prime}}{k_{T}\tau}\left(\sin^{-1}\left(2s_{1}-1\right)-\sin^{-1}\left(2p_{1}(0)-1\right)\right)^{2}+O(\tau^{-2}).$
(S45)

We now have an analytical expression to first order in $\tau^{-1}$ for the
average finite time work ${\cal W}$ to perform a copy operation as a function
of $s$, $p^{\prime}$, $k_{T}\tau$ and $p_{1}(0)$. In the regime where the
long-time approximation fails, we can obtain $W_{d}$ and hence the average
work $\mathcal{W}=(1-p^{\prime})W_{0}+p^{\prime}W_{1}$ from numerically
solving Eq. S28, Eq. S35 and Eq. S37.

##  B Details of symmetry breaking

In the main text, we discussed the symmetry breaking transition in the case of
copying an unbiased data bit, with $p^{\prime}=0.5$: despite the symmetry of
the data, it becomes beneficial for short copy times $\tau$ to start the copy
process from an asymmetric initial distribution of the memory. Here, we show
the details of this symmetry breaking. Furthermore, we discuss the direct-
overwrite scenario, where no symmetry breaking occurs, and the case of copying
a weakly biased data bit. We start by discussing copying an unbiased data bit.

Unbiased data bit. In the case of copying an unbiased data bit
($p^{\prime}=0.5$), the generated mutual information $I(D;M)$ is symmetric in
the line $s_{0}=s_{1}$ (see Fig. S5, panel (a)). Again, we examine copying at
fixed generated mutual information along the iso-information contour that
crosses the line $s_{0}=s_{1}$ at $s_{0}=s_{1}=0.95$.

In Fig. S5 (e), we show a contour plot of the quasistatic work for making a
copy, $k_{B}TI(D;M)+k_{B}TD_{KL}(P^{f}_{M}||P^{i}_{M})$, as a function of
$s_{1}$ and $p_{1}(0)$. The quasistatic work has a minimum for
$p_{1}(0)=f=(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}$, shown as a red line,
since this value of $p_{1}(0)$ minimizes the $D_{KL}$ term (see Eqs. S11 and
S14). In panels (f)-(h) we plot the finite-time cost
$\Delta\mathcal{S}^{\text{irr}}$ for different values of $\tau$, respectively.
The optimal value of $p_{1}(0)$ that minimizes the finite-time cost for a
given value of $s_{1}$ is given by the dashed line, with a color set by
$\tau$. The minimum of the total work $\mathcal{W}$, given by the sum of the
quasistatic work and the finite-time cost, is given by the solid line with the
same color as that of the dashed line (as again set by $\tau$); for ease of
comparison, we also show in these panels the red line of panel (e) that
corresponds to the minimum of the quasistatic work. Panels (f) - (h) show that
the optimal value of $p_{1}(0)$ for a given $s_{1}$ that minimizes the total
work (orange, yelow, or green solid line, respectively) is in between the
value that minimizes the quasistatic work, given by the red solid line, and
the value of $p_{1}(0)$ that minimizes the finite-time cost, given by the
dashed line. Clearly, the system faces a trade-off between minimizing the
finite-time cost and the quasistatic work.

Panels (e) - (h) show that the finite-time cost $\Delta\mathcal{S}^{\rm irr}$
can induce a symmetry-breaking transition. The quasistatic work is minimized
and equal to the constant value of $I(D;M)$ along the line $p_{1}(0)=f$
irrespective of the copy time $\tau$ (red line panel (e)); this is because
along this line $D_{KL}(P_{M}^{f}||P_{M}^{i})=0$. In contrast, the finite-time
cost $\Delta\mathcal{S}^{\rm irr}$ exhibits a global minimum at
$(p_{1}(0)=1/2,s_{1}=s_{0})$ for large copy times (panel (f)), yet for short
copy times two equally stable local minima develop (panels (g, h)); these
minima move, respectively, towards $(p_{1}(0)\to 1,s_{1}\to 1)$ and
$(p_{1}(0)\to 0,s_{0}\to 1)$ as $\tau$ approaches its minimum value at which
the work diverges. In the limit of large copy times, the finite-time cost is
small compared to the quasistatic work and indeed no symmetry breaking of the
total work $\mathcal{W}$ occurs, see panel (b). Only when $\tau$ becomes
sufficiently small so that the finite-time cost becomes significantly large
and two local minima develop, does $\mathcal{W}$ undergo a symmetry breaking
transition. For example, for $\tau=5$, the optimal values of $p_{1}(0)$ and
$s_{1}$ that minimize $\mathcal{W}$ are given by $p_{1}(0)=1/2$ and
$s_{1}=s_{0}$ (panel (f)): both states of the data bit are copied with the
same accuracy and the optimal initial distribution of the memory is $50:50$.
However, when the copy time becomes shorter than $\tau\simeq 2.5$, copying the
two states of the data bit with the same accuracy and with a memory that is
initially evenly distributed gives a higher total cost $\mathcal{W}$ than that
in a scenario where one data bit state is copied with higher accuracy (and the
other thus with lower accuracy), using a memory that is biased towards the
data bit state that is copied with the higher accuracy. The effect is even
stronger for shorter copy times: for $\tau=2.3$, as shown in panel (h), the
cost would diverge for a symmetric and unbiased copy operation. In contrast,
biasing the initial memory to one of the states of the data bit, and,
additionally, copying that data bit state with higher accuracy, makes it
possible to copy the two data bit states at the same fixed mutual information
for a finite cost.

Interestingly, the symmetry breaking of $\Delta\mathcal{S}^{\rm irr}$ does not
immediately lead to a symmetry breaking transition of the total work
$\mathcal{W}=I(D;M)+D_{KL}(P_{M}^{f}||P_{M}^{i})+\Delta\mathcal{S}^{\rm irr}$:
only when the copy time becomes sufficiently small such that the positive
curvature of $\Delta\mathcal{S}^{\rm irr}$ is larger than the negative
curvature of $D_{KL}(P_{M}^{f}||P_{M}^{i})$ does the symmetry breaking
transition of $\mathcal{W}$ emerge. This can be seen in panels (b) and (d). In
particular, for $\tau\simeq 2.5$, $\Delta\mathcal{S}^{\rm irr}$ already
exhibits symmetry breaking (panel (g)), but the total work $\mathcal{W}$ does
not yet (panel (b)): the opposite negative curvature of the
$D_{KL}(P_{M}^{f}||P_{M}^{i})$ prevents this. Indeed, in the scenario where
$D_{KL}(P_{M}^{f}||P_{M}^{i})$ is recovered, the work $\mathcal{W}_{\rm ex}$
(dashed lines, panels (b), (d)) does exhibit symmetry breaking for this value
of $\tau$, in contrast to $\mathcal{W}$ (solid lines, panels (b),(d)). This
observation also explains why in the scenario that
$D_{KL}(P_{M}^{f}||P_{M}^{i})$ is extracted, the symmetry breaking transition
occurs earlier, i.e. for shorter copy times (panel (d)).

In the direct-overwrite scenario no symmetry breaking can occur, as shown in
panel (c). This can be understood via the contourplots of the quasistatic work
and the finite-time cost, shown in panels (e) - (f), respectively. In the
direct overwrite scenario, the memory is simply overwritten during each copy
operation such that the initial memory distribution, characterized by
$p_{1}(0)$, is set by the outcome of the previous copy operation,
characterized by $f=(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}$: $p_{1}(0)=f$.
This constraint means that $p_{1}(0)$ and $s_{1}$ must fall on the red line,
given by $p_{1}(0)=f$. Along this line, the total work $\mathcal{W}$ is
minimized at $p_{1}(0)=1/2$ and $s_{1}=s_{0}$, even for the shortest possible
copy times (where $\mathcal{W}$ remains finite): in this optimum, both states
are copied with the same accuracy, the memory is initially evenly distributed,
and the symmetry breaking transition does not occur. The same picture emerges
for different values of $I(D;M)$.

Weakly biased data bit. Fig. 2 of the main text corresponds to a strongly
biased data bit ($p^{\prime}=0.9$) in which the finite-time cost
$\Delta\mathcal{S}^{\rm irr}$ and hence the total work $\mathcal{W}$ exhibit
only one minimum for each copy time $\tau$ (see Fig. 2(f) - (h)).
Interestingly, for a more weakly biased data bit, $p^{\prime}=0.6$, the
finite-time cost and therefore the total work $\mathcal{W}$ still develop two
local minima for sufficiently short copy times, with one minimum being lower
than the other. This is illustrated in Fig. S6. We again consider systems
along an iso-information contour, shown in panel (a). Fig. S6 (b,d) shows that
in this case a symmetry breaking transition does occur for sufficiently short
copy times. However, the minimum corresponding to the scenario in which the
more likely state of the data bit is copied with higher accuracy,
$s_{1}>s_{0}$, and the initial distribution of the memory is biased towards
that more likely state of the data bit, $p_{1}(0)>1/2$, is clearly lower than
the other, in marked contrast to the case of the unbiased data bit. As for the
unbiased data bit, the direct overwrite scenario does not yield a symmetry
breaking transition (panel (c)). These observations can be understood using
the arguments given above for the unbiased data bit, with the notable
difference that when a bifurcation occurs it is optimal to bias the copy
operation towards the more likely state of the data bit, corresponding to the
lowest local minimum of $\mathcal{W}$ in panel (b).

Finally, it is worthy of note that the weak bias in the distribution of the
data bit leads to different behaviour of the optimal initial distribution of
the memory as a function of $\tau$ (see Fig. S6(d)). Even for values of $\tau$
that do not lead to symmetry breaking, the optimal initial memory distribution
is time dependent, like in the strongly biased case discussed in the main
text.

Figure S6: Symmetry breaking for a weakly biased data bit ($p^{\prime}=0.6$).
(a) Iso-information contours for a weakly biased data bit $p^{\prime}=0.6$. In
bold, the iso-information contour along which the work is optimized; it
crosses the diagonal $s_{1}=s_{0}$ line at $s_{0}=s_{1}=0.95$. The other
panels show the total work (panels (b,c)), the quasistatic work (panel (e))
and the finite-time cost (panels (f-h)) along this bold contour. (b) The total
work $\mathcal{W}$ (solid lines) and the work $\mathcal{W}_{\rm we}$ with
extraction of the free energy stored in the memory bit, given by
$k_{B}TD_{KL}(P_{M}^{f}||P_{M}^{i})$ (dashed lines), as a function of the
initial distribution of the memory bit, characterized by $p_{1}(0)$, for
different values of the copy time $\tau$; $s_{1}$ has been optimized over. For
sufficiently short copy times, a second local minimum emerges reminiscent of
the symmetry breaking transition for the unbiased data bit (see Fig. S5). (c)
Work $\mathcal{W}_{\rm do}$ as a function of $p_{1}(0)$ in the direct
overwrite scenario, in which $p_{1}(0)=f$; $s_{1}$ has been optimized over. No
symmetry-breaking transition occurs. (d) The optimal values of $p_{1}(0)$
(black lines) and $s_{1}$ (blue lines) as a function of the copy time $\tau$,
with (dashed lines) and without $D_{KL}(P_{M}^{f}||P_{M}^{i})$ extraction
(solid lines). Extracting the free energy stored in the memory bit alone,
corresponding to a total cost without the $D_{KL}$ term (dashed lines), causes
the symmetry-breaking transition to happen slightly earlier, i.e. at larger
copy times, as observed for the unbiased data bit (Fig. S5(d)). In the
scenario without $D_{\text{KL}}$-term, the optimal values equal the minimal or
maximal value within numerical accuracy for $\tau<2.6$. (e) The quasi-static
work $k_{B}TI(D;M)+k_{B}TD_{KL}(P_{M}^{f}||P_{M}^{i})$ as a function of
$p_{1}(0)$ and $s_{1}$. The red line shows the line
$p_{1}(0)=f=(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}$ along which
$D_{KL}(P_{M}^{f}||P_{M}^{i})$ is zero. The quasi-static work cannot induce a
symmetry-breaking transition. (f) - (h) Finite-time cost
$\Delta\mathcal{S}^{\rm irr}$ as a function of $p_{1}(0)$ and $s_{1}$ for
three values of the copy time: $\tau=5$ (panel (f)), $\tau=2.5$ (panel (g)),
and $\tau=2.3$ (panel (h)). The dashed line shows the value of $p_{1}(0)$ that
minimize the finite-time cost as a function of $s_{1}$; the solid line with
the same color shows the value of $p_{1}(0)$ as a function of $s_{1}$ that
minimizes the total work $\mathcal{W}$. For large copy times, only one minimum
is present, but for sufficiently short copy times, two minima develop, near,
respectively, $p_{1}(0)\to 1$ and $s_{1}\to 1$, and $p_{1}(0)\to 0$ and
$s_{0}\to 1$ (and $s_{1}\to s_{1}^{\rm min}$, i.e. the smallest value along
the bold iso-information contour of (a)); the colored dots mark the minima of
$\mathcal{W}$, see also panel (d). The red line in panels (f)-(h) is the same
as that in panel (e).

##  Appendix A Average reversible work obtained by averaging the work to copy
the two states of the data bit

Here we show that combining Eqs. S17 and S18 yields the result of Eq. S15:

$\displaystyle\mathcal{W}$
$\displaystyle=(1-p^{\prime})W_{\text{d=0}}+p^{\prime}W_{\text{d=1}}$
$\displaystyle=(1-p^{\prime})s_{0}\ln(s_{0})+(1-p^{\prime})(1-s_{0})\ln(1-s_{0})+p^{\prime}(1-s_{1})\ln(1-s_{1})+p^{\prime}s_{1}\ln(s_{1})$
$\displaystyle\hskip
56.9055pt+[(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})]\ln\left(\frac{1}{1-a}\right)+[(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}]\ln\left(\frac{1}{a}\right)$
$\displaystyle=(1-p^{\prime})s_{0}\ln(s_{0})+(1-p^{\prime})(1-s_{0})\ln(1-s_{0})+p^{\prime}(1-s_{1})\ln(1-s_{1})+p^{\prime}s_{1}\ln(s_{1})$
$\displaystyle\hskip
14.22636pt-[(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})]\ln((1-p^{\prime})s_{0}+p^{\prime}(1-s_{1}))+[(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}]\ln((1-p^{\prime})(1-s_{0})+p^{\prime}s_{1})$
$\displaystyle\hskip
14.22636pt+[(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})]\ln\left(\frac{(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})}{1-a}\right)+[(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}]\ln\left(\frac{(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})}{a}\right)$
$\displaystyle=(1-p^{\prime})s_{0}\ln\left(\frac{s_{0}}{(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})}\right)+(1-p^{\prime})(1-s_{0})\ln\left(\frac{1-s_{0}}{(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}}\right)$
$\displaystyle\hskip
14.22636pt+p^{\prime}(1-s_{1})\ln\left(\frac{1-s_{1}}{(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})}\right)+p^{\prime}s_{1}\ln\left(\frac{s_{1}}{(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}}\right)$
$\displaystyle\hskip
14.22636pt+[(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})]\ln\left(\frac{(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})}{1-a}\right)+[(1-p^{\prime})(1-s_{0})+p^{\prime}s_{1}]\ln\left(\frac{(1-p^{\prime})s_{0}+p^{\prime}(1-s_{1})}{a}\right)$
$\displaystyle=(1-p^{\prime})s_{0}\ln\left(\frac{s_{0}}{1-f}\right)+(1-p^{\prime})(1-s_{0})\ln\left(\frac{1-s_{0}}{f}\right)+p^{\prime}(1-s_{1})\ln\left(\frac{1-s_{1}}{1-f}\right)+p^{\prime}s_{1}\ln\left(\frac{s_{1}}{f}\right)$
$\displaystyle\hskip
14.22636pt+(1-f)\ln\Big{(}\frac{1-f}{1-a}\Big{)}+f\ln\Big{(}\frac{f}{a}\Big{)}$
$\displaystyle=I(D;M)+D_{KL}(P^{f}_{M}||P^{i}_{M}).$ (S46)

## References

  * [1] M. Esposito, R. Kawai, K. Lindenberg, and C. Van den Broeck.  Finite-time thermodynamics for a single-level quantum dot.  Europhysics Letters, 89(2):20003, feb 2010.
  * [2] Giovanni Diana, G. Baris Bagci, and Massimiliano Esposito.  Finite-time erasing of information stored in fermionic bits.  Phys. Rev. E, 87:012111, Jan 2013.
  * [3] Jae Sung Lee, Sangyun Lee, Hyukjoon Kwon, and Hyunggyu Park.  Speed limit for a highly irreversible process and tight finite-time landauer’s bound.  Phys. Rev. Lett., 129:120603, Sep 2022.
  * [4] Naoto Shiraishi, Ken Funo, and Keiji Saito.  Speed limit for classical stochastic processes.  Phys. Rev. Lett., 121:070601, Aug 2018.
  * [5] Patrick R. Zulkowski and Michael R. DeWeese.  Optimal finite-time erasure of a classical bit.  Phys. Rev. E, 89:052140, May 2014.