The relationship between the position of oxygen vacancies in HfO2/SiO2/Si gate stacks and the leakage current is studied by first-principles electronic-structure and electron-conduction calculations. We find that the increase in the leakage current due to the creation of oxygen vacancies in the HfO2 layer is much larger than that in the SiO2 interlayer. According to previous first-principles total energy calculations, the formation energy of oxygen vacancies is smaller in the SiO2 interlayer than that in the HfO2 layer under the same conditions. Therefore, oxygen vacancies will be attracted from the SiO2 interlayer to minimize the energy, thermodynamically justifying the scavenging technique. Thus, the scavenging process efficiently improves the dielectric constant of HfO2-based gate stacks without increasing the number of oxygen vacancies, which cause the dielectric breakdown.