The reaction between gallium (Ga) and silicon (Si), termed melt-back etching, greatly deteriorates the quality of GaN grown on a Si substrate. In this paper, the mechanism of melt-back etching was investigated layer-by-layer in a GaN/AlN/Si system. It is found that the environment of the reactor plays a critical role in melt-back etching, which may happen as early as during the baking process. Drawing on experimental evidence and analyses, a two-step melt-back etching model is proposed. Finally, optimized pretreatments including an AlN precoating process and reduction in baking temperature were used to successfully solve the etching problem and verify the model.