defects. With regards to surface defects, Cs defects have the largest impact on the stability of CsPbI 3 when the defect concentration is less than 15 %, whereas Pb defects act play a dominant role for defect concentrations exceeding 20 %. Most importantly, this machine-learning-based MD simulation strategy provides a new avenue to explore the ionic defect effects on the stability of perovskite-like materials, laying a theoretical foundation for the design of stable perovskite materials.