  The transition between a regime in which thermodynamic relations apply only
to ensembles of small systems coupled to a large environment and a regime in
which they can be used to characterize individual macroscopic systems is
analyzed in terms of the change in behavior of the Jarzynski estimator of
equilibrium free energy differences from nonequilibrium work measurements.
Given a fixed number of measurements, the Jarzynski estimator is unbiased for
sufficiently small systems. In these systems, the directionality of time is
poorly defined and configurations that dominate the empirical average, but
which are in fact typical of the reverse process, are sufficiently well
sampled. As the system size increases the arrow of time becomes better defined.
The dominant atypical fluctuations become rare and eventually cannot be sampled
with the limited resources that are available. Asymptotically, only typical
work values are measured. The Jarzynski estimator becomes maximally biased and
approaches the exponential of minus the average work, which is the result that
is expected from standard macroscopic thermodynamics. In the proper scaling
limit, this regime change can be described in terms of a phase transition in
variants of the random energy model (REM). This correspondence is explicitly
demonstrated in several examples of physical interest: near-equilibrium
processes in which the work distribution is Gaussian, the sudden compression of
an ideal gas and adiabatic quasi-static volume changes in a dilute real gas.
