We quantitatively explore in a unbiased way the evolution of dust attenuation up to z ≈ 4 as a function of galaxy properties. We have used one of the deepest datasets available at present, in the GOODS-N field, to select a star forming galaxy sample and robustly measure galaxy redshifts, star formation rates, stellar masses and UV restframe properties. Our main results can be summarized as follows: i) we confirm that galaxy stellar mass is a main driver of UV dust attenuation in star forming galaxies: more massive galaxies are more dust attenuated than less massive ones; ii) strikingly, we find that the correlation does not evolve with redshift: the amount of dust attenuation is the same at all cosmic epochs for a fixed stellar mass; iii) this finding explains why and how the SFR–AUV relation evolves with redshift: the same amount of star formation is less attenuated at higher redshift because it is hosted in less massive galaxies; iv) combining our finding with results from line emission surveys, we confirm that line reddening is larger than continuum reddening, at least up to z ≈ 1.5; v) given the redshift evolution of the mass-metallicity relation, we predict that star forming galaxies at a fixed metal content are more attenuated at high redshift. Finally, we explored the correlation between UV dust attenuation and the spectral slope: vi) the correlation is evolving with redshift with star forming galaxies at lower redshift having redder spectra than higher redshift ones for the same amount of dust attenuation.