Rate of penetration (ROP) is an essential factor in drilling optimization and reducing the drilling cycle. Most of the traditional ROP prediction methods are based on building physical model and single intelligent algorithms, and the efficiency and accuracy of these prediction methods are very low. With the development of artificial intelligence, high-performance algorithms make reliable prediction possible from the data perspective. To improve ROP prediction efficiency and accuracy, this paper presents a method based on particle swarm algorithm for optimization of long short-term memory (LSTM) neural networks. In this paper, we consider the Tuha Shengbei block oilfield as an example. First, the Pearson correlation coefficient is used to measure the correlation between the characteristics and eight parameters are screened out, namely, the depth of the well, gamma, formation density, pore pressure, well diameter, drilling time, displacement, and drilling fluid density. Second, the PSO algorithm is employed to optimize the super-parameters in the construction of the LSTM model to the predict ROP. Third, we assessed model performance using the determination coefficient (R 2 ), root mean square error (RMSE), and mean absolute percentage error (MAPE). The evaluation results show that the optimized LSTM model achieves an R 2 of 0.978 and RMSE and MAPE are 0.287 and 12.862, respectively, hence overperforming the existing methods. The average accuracy of the optimized LSTM model is also improved by 44.2%, indicating that the prediction accuracy of the optimized model is higher. This proposed method can help to drill engineers and decision makers to better plan the drilling operation scheme and reduce the drilling cycle.