A sizable fraction of the heavy elements synthesized by stars in galaxies condenses into sub-micron-sized solid-state particles, known as dust grains^1, 2. Dust produces a wavelength-dependent attenuation, Aλ, of the galaxy emission, thereby significantly altering its observed properties^3. Locally, Aλ is in general the sum of a power-law and a UV feature (’bump’)^4 produced by small, carbon-based grains^5. However, scant information exists regarding its evolution across cosmic time. Here, leveraging data from 173 galaxies observed by the James Webb Space Telescope in the redshift range z = 2 − 12^6, we report the most distant detection of the UV bump in a z ∼ 7.55 galaxy (when the Universe was only ∼ 700 Myr old), and show for the first time that the power-law slope and the bump strength decrease towards high redshifts. We propose that the flat Aλ shape at early epochs is produced by large grains newly formed in supernova ejecta^7, which act as the main dust factories at such early epochs. Importantly, these grains have undergone minimal reprocessing in the interstellar medium due to the limited available cosmic time^8. This discovery opens new perspectives in the study of cosmic dust origin and evolution.