To prevent slope instability accidents, a combined model based on HEOA optimized XGBoost was proposed to predict slope stability in response to the uncertainty of slope instability and the complexity of influencing factors. First, the main controlling factors affecting slope instability were analyzed. Six key influencing factors related to slope rock mass were selected to establish a slope stability prediction index system. Second, range normalization was applied to unify the feature scales, and SMOTE was employed to balance the distribution of stability classes within the dataset. Third, the HEOA was used to optimize the maximum depth, learning rate, subsample ratio, column sample ratio, and minimum loss of the XGBoost model. Finally, the prediction results of the constructed model were comprehensively evaluated using the following metrics: accuracy, precision, recall, F1 score, and Cohen's Kappa coefficient, and the model was applied to specific engineering cases. The results show that the XGBoost model optimized by HEOA achieves the best performance when the maximum depth, learning rate, subsample ratio, column sample ratio, and minimum loss were 6, 0.583 8, 0.461 5, 0.584 6 and 0.024 4, respectively. Compared with other intelligent algorithms-optimized XGBoost models and single XGBoost model, the HEOA-XGBoost hybrid model shows improvements in all evaluation indicators in predicting slope stability, indicating that the model has high accuracy and generalization ability in predicting slope stability.