  We study the relationship between the UV continuum slope and infrared excess
(IRX$\equiv L_{\rm IR}/L_{\rm FUV}$) predicted by performing dust radiative
transfer on a suite of hydrodynamical simulations of galaxies. Our suite
includes both isolated disk galaxies and mergers intended to be representative
of galaxies at both $z \sim 0$ and $z \sim 2-3$. Our low-redshift isolated
disks and mergers often populate a region around the the locally calibrated
\citet[][M99]{M99} relation but move well above the relation during
merger-induced starbursts. Our high-redshift simulated galaxies are blue and
IR-luminous, which makes them lie above the M99 relation. The value of UV
continuum slope strongly depends on the dust type used in the radiative
transfer calculations: Milky Way-type dust leads to significantly more negative
(bluer) slopes compared with Small Magellanic Cloud-type dust. The effect on
$\beta$ due to variations in the dust composition with galaxy properties or
redshift can dominate over other sources of $\beta$ variations and is the
dominant model uncertainty. The dispersion in $\beta$ is anticorrelated with
specific star formation rate and tends to be higher for the $z \sim 2-3$
simulations. In the actively star-forming $z \sim 2-3$ simulated galaxies, dust
attenuation dominates the dispersion in $\beta$, whereas in the $z \sim 0$
simulations, the contributions of SFH variations and dust are similar. For
low-SSFR systems at both redshifts, SFH variations dominate the dispersion.
Finally, the simulated $z \sim 2-3$ isolated disks and mergers both occupy a
region in the \irxbeta\ plane consistent with observed $z \sim 2-3$ dusty
star-forming galaxies (DSFGs). Thus, contrary to some claims in the literature,
the blue colors of high-z DSFGs do not imply that they are short-lived
starbursts.
