  Under certain conditions, it takes a shorter time to cool a hot system than
to cool the same system initiated at a lower temperature. This phenomenon - the
"Mpemba Effect" - is well known in water, and has recently been observed in
other systems as well. However, there is no single generic mechanism that
explains this counter-intuitive behavior. Using the theoretical framework of
non-equilibrium thermodynamics, we present a widely applicable mechanism for
this effect, derive a sufficient condition for its appearance in Markovian
dynamics, and predict an inverse Mpemba effect in heating: under proper
conditions, a cold system can heat up faster than the same system initiated at
a higher temperature. Our results suggest that it should be possible to observe
the Mpemba effect and its inverse in a variety of systems, where they have
never been demonstrated before.
