Recent studies have shown that massive elliptical galaxies have total mass density profiles within an effective radius that can be approximated as \rho _ { tot } \propto r ^ { - \gamma ^ { \prime } } , with mean slope \langle \gamma ^ { \prime } \rangle = 2.08 \pm 0.03 and scatter \sigma _ { \gamma ^ { \prime } } = 0.16 \pm 0.02 . The small scatter of the slope ( known as the bulge-halo conspiracy ) is not generic in \Lambda cold dark matter ( \Lambda { CDM } ) based models and therefore contains information about the galaxy formation process . We compute the distribution of \gamma ^ { \prime } for \Lambda { CDM } -based models that reproduce the observed correlations between stellar mass , velocity dispersion , and effective radius of early-type galaxies in the Sloan Digital Sky Survey . The models have a range of stellar initial mass functions ( IMFs ) and dark halo responses to galaxy formation . The observed distribution of \gamma ^ { \prime } is well reproduced by a model with cosmologically motivated but uncontracted dark matter haloes , and a Salpeter-type IMF . Other models are on average ruled out by the data , even though they may happen in individual cases . Models with adiabatic halo contraction ( and lighter IMFs ) predict too small values of \gamma ^ { \prime } . Models with halo expansion , or mass-follows-light predict too high values of \gamma ^ { \prime } . Our study shows that the non-homologous structure of massive early-type galaxies can be precisely reproduced by \Lambda { CDM } models if the IMF is not universal and if mechanisms such as feedback from active galactic nuclei , or dynamical friction , effectively on average counterbalance the contraction of the halo expected as a result of baryonic cooling .