  We investigate theoretically quantum entanglement of light with the
collective spin polarization of a cold atomic ensemble in cavity-assisted Raman
schemes. Previous works concentrated mostly on the bad cavity limit where the
signals are much longer than the cavity field lifetime. In view of atomic
relaxation and other imperfections, there may arise a need to speed-up the
light-atoms interface operation. By increasing the cavity field lifetime, one
can achieve better light-matter coupling and entanglement. In our work, we
consider the non-adiabatic effects that become important beyond the bad cavity
limit in both low-photon and continuous variables regime. We find classical
control field time profiles that allow one to retrieve from the cavity an
output quantized signal of a predefined time shape and duration, which is
optimal for the homodyne detection, optical mixing or further manipulation.
This is done for a wide range of the signal duration as compared to the cavity
field lifetime. We discuss an optimal cavity-atomic ensemble matching in terms
of the cavity field lifetime which allows one to apply less intense control
field and to minimize a variety of non-linear effects, such as AC light shifts,
four-wave mixing, etc, which may be potentially harmful to an experiment.
