In order to enhance the prediction accuracy and computational efficiency of chaotic sequence data, issues such as gradient explosion and the long computation time of traditional methods need to be addressed. In this paper, an improved Particle Swarm Optimization (PSO) algorithm and Long Short-Term Memory (LSTM) neural network are proposed for chaotic prediction. The temporal pattern attention mechanism (TPA) is introduced to extract the weights and key information of each input feature, ensuring the temporal nature of chaotic historical data. Additionally, the PSO algorithm is employed to optimize the hyperparameters (learning rate, number of iterations) of the LSTM network, resulting in an optimal model for chaotic data prediction. Finally, the validation is conducted using chaotic data generated from three different initial values of the Lorenz system. The root mean square error (RMSE) is reduced by 0.421, the mean absolute error (MAE) is reduced by 0.354, and the coefficient of determination (R2) is improved by 0.4. The proposed network demonstrates good adaptability to complex chaotic data, surpassing the accuracy of the LSTM and PSO-LSTM models, thereby achieving higher prediction accuracy.