In this study, the influence of composition of thin films on the interface integrity between a hafnium dioxide thin film and a gate electrode was investigated by using a quantum chemical molecular dynamics method. Effect of the fluctuation of the composition around the HfO2±x/metal interface on the formation of the interfacial layer was analyzed quantitatively. Post-oxidation annealing after deposition of the hafnium oxide film restored oxygen vacancies and removed carbon interstitials from the film and thus, improved the quality of the oxide. However, when the excessive interstitial oxygen atoms remained in the film, the quality of the interface was deteriorated by forming a new interfacial oxide layer between the hafnium oxide and the deposited metal such as tungsten. No interfacial layer was observed, however, when a gold thin film was deposited on the hafnium oxide film with the various defects. Therefore, it is very important to control the composition around the interface, i.e., to minimize those point defects in the hafnium dioxide films and/or to introduce a diffusion barrier layer onto the oxide for improving the electronic performance and reliability of the stacked structure.