In the context of dam deformation monitoring, the prediction task is essentially a time series prediction problem that involves non-stationarity and complex influencing factors. To enhance the accuracy of predictions and address the challenges posed by high randomness and parameter selection in LSTM models, a novel approach called sparrow search algorithm–long short-term memory (SSA–LSTM) has been proposed for predicting the deformation of concrete dams. SSA–LSTM combines the SSA optimization algorithm with LSTM to automatically optimize the model’s parameters, thereby enhancing the prediction performance. Firstly, a concrete dam was used as an example to preprocess the historical monitoring data by cleaning, normalizing, and denoising, and due to the specificity of the data structure, multi-level denoising of abnormal data was performed. Second, some of the data were used to train the model, and the hyperparameters of the long and short-term memory neural network model (LSTM) were optimized by the SSA algorithm to better match the input data with the network structure. Finally, high-precision prediction of concrete dam deformation was carried out. The proposed model in this study significantly improves the prediction accuracy in dam deformation forecasting and demonstrates effectiveness in long-term time series deformation prediction. The model provides a reliable and efficient approach for evaluating the long-term stability of dam structures, offering valuable insights for engineering practices and decision-making.