Ultraviolet light illumination is shown experimentally to be able to induce hydrogen evolution in hydrogenated amorphous silicon nitride (a-SixNyHz) film and the total hydrogen (H) removal percentage depends strongly on the composition with a maximum with balanced silicon-hydrogen and nitride-hydrogen single bonds (Si–H/N–H ratio equals to 1). We developed a general model for analyzing H removal in such alloyed glass system. Our statistical Monte Carlo models reveal that H2 evolution is the result of highly selective chemical reactions among nearest neighbor SiH and NH bonds in a-SiNxHy, which leads to formation of Si–N bonds. This process is sensitive to its local chemical environment. The nearest neighbor coordination number and the presence of SiH2 and NH2 groups in a-SixNyHz network have impact on the total H removal. Our model gives quantitative measures for all the corresponding reaction constants, consistent with experimental observations.