  We consider a glassy system of interacting spins driven by continual
switching amongst a finite set of nonuniform external fields. We find that the
system evolves over time towards configurations that minimize the work absorbed
from this external drive. The configurations which achieve this are specific to
the details of the external fields used to drive the system, and therefore act
effectively as a self-organized novelty-detector that embodies accurate
predictions about the typical future of its external environment.
