  Massive quiescent compact galaxies have been discovered at high redshifts,
associated with rapid compaction and cessation of star formation (SF). In this
work we set out to quantify the time-scales in which SF is quenched in compact
galaxies at intermediate redshifts. For this, we select a sample of green
valley galaxies within the COSMOS field in the midst of quenching their SF at
$0.5<z<1.0$ that exhibit varying degrees of compactness. Based on the H$\delta$
absorption line and the 4000 \AA \ break of coadded zCOSMOS spectra for
sub-samples of normal-sized and compact galaxies we determine quenching
time-scales as a function of compactness. We find that the SF quenching
time-scales in green valley compact galaxies are much shorter than in
normal-sized ones. In an effort to understand this trend, we use the Illustris
simulation to trace the evolution of the SF history, the growth rate of the
central super massive black hole (SMBH) {\bf and the AGN-feedback in compact
and normal-sized galaxies. We find that the key difference between their SF
quenching time-scales is linked to the mode of the AGN-feedback. In the compact
galaxies predominates the kinematic-mode, which is highly efficient at
quenching the SF by depleting the internal gas. On the normal-sized galaxies,
the prevailing thermal-mode injects energy in the circumgalactic gas, impeding
the cold gas supply and quenching the SF via the slower strangulation
mechanism.} These results are consistent with the violent disk instability and
gas-rich mergers scenarios, followed by strong AGN and stellar feedback.
Although this kind of event is most expected to occur at $z=2-3$, we find
evidences that the formation of compact quiescent galaxies can occur at $z<1$.
