To understand the behavior of rare earth elements (REE) in magmatic systems it is important to characterize in a systematic way their incorporation into silicate melts and glasses. Here, we study the structural environment of the REE Y and La in four aluminosilicate glasses and melts with varying REE content, using a combined simulation and diffraction approach. Glasses are investigated by X-ray and neutron diffraction as well as classical molecular dynamics simulations using two different polarizable ion potentials. Structure models of the corresponding melts are derived from classical and first-principles molecular dynamics simulations. We discuss the effect of temperature on coordination numbers and rationalize the structural changes in ...