JWST has measured an unprecedented abundance of galaxies above z≳4−5, whose formation and evolution are still difficult to reconcile within traditional galaxy evolution models in a I^CDM framework. Here, we present a study on the star formation histories of these high-redshift galaxies between z≃5−12 via a data-driven semi-empirical model that uses the observed UV LFs as input to retrieve SFRs, naturally bypassing any uncertain modelling of cooling, feedback and/or stochastic processes. Galaxy stellar masses are progressively built in time by integrating their SFRs assigned along their progenitor haloes via the SFR-halo accretion rate relation, derived from abundance matching between the input observed UV LFs with the dark matter halo accretion rate distributions at each redshift. This makes the SFEs a full prediction of the model rather than a tuned input, serving as a natural baseline to test burstiness, dust attenuation, or IMF variations. Our approach naturally reproduces the total stellar mass function, the large-scale clustering, and the star-forming main sequence. We find that massive galaxies grew their stellar mass with a bursty star formation at z∼9−10, broadly in agreement with the star formation histories inferred from spectral energy distribution fitting, with the SFE reaching high peaks of 0.8−0.9 at z>9 and lowering to standard values of 0.2−0.3 below z≲9. We find that the presence of dust could enhance the predicted SFRs at z≲8, better reproducing the observed SFRs of massive dusty galaxies, and increase the SFEs to values close to or even above unity at z≳8. Finally, switching to top-heavy IMFs reduces the SFEs by a factor of 2−3, highlighting the need for a variable IMF as an inevitable ingredient in the evolution of galaxies at high redshifts to avoid unphysical SFEs, especially in the presence of dust.