Coarse-graining via the fluctuation-dissipation theorem and large-deviation theory