We discuss the Damour--Esposito-Far`ese model of gravity, which predicts the spontaneous scalarization of neutron stars in a certain range of parameter space. In the cosmological setup, the scalar field responsible for scalarization is subject to a tachyonic instability during inflation and the matter domination stage, resulting in a large value of the field today. This value feeds into the PPN parameters, which turn out to be in gross conflict with the Solar system measurements. We modify the original Damour--Esposito-Far`ese model by coupling the scalar to the inflaton field. This coupling acts as an effective mass for the scalar during inflation. For generic couplings that are not extremely small, the scalar (including its perturbations) relaxes to zero with an exponential accuracy by the beginning of the hot stage. While the scalar exhibits growth during the subsequent cosmological stages, the resulting present value remains very small---in a comfortable agreement with the Solar system tests.