We have investigated structural and optical properties of Ga1-xInxAs/GaAs and Ga1-xInxNyAs1-y/GaNzAs1-z multiple quantum wells. The evolution of x-ray diffraction rocking curves during thermal treatment of the samples indicates that there is observable Ga/In interdiffusion across the heterointerfaces at high sample temperatures. X-ray diffraction also indicates that the diffusion length of the atoms decreases with an increase in nitrogen concentration, while the interface roughness, which exhibits remarkable changes for the two different quantum wells, only plays a minor role in diffusion. Structural stability of the Ga1-xInxNyAs1-y/GaNzAs1-z quantum wells against temperature variations is better than that of the Ga1-xInxAs/GaAs quantum wells. These observations can be accounted for by assuming that nitrogen has a tendency to suppress Ga/In interdiffusion across the heterojunctions.