In recent years, with the development of modern technology and industrialization, the shipbuilding industry has become an essential field in a country. Offshore operations, such as helicopter takeoff and landing, and ship-to-ship cargo replenishment, need an accurate prediction of ship motion attitude, not only to improve efficiency but also to protect crew members' lives. However, using the single model has limited influence on prediction. Therefore, this paper proposed a Cross-Parallel optimization algorithm framework, which made full use of the development ability of the Harris Hawk optimization algorithm (HHO) and the searching ability of the sine-cosine algorithm (SCA). In this paper, we use Rosenbrock and Rastrigin functions for testing. The results show that the cross-parallel optimization algorithm has faster search speed and stronger optimization capability. The optimization algorithm is used to optimize the hyperparameters of long short-term memory (LSTM) neural networks. It improves the network's training ability to predict the ship's attitude. The proposed method in this paper is compared with 9 models such as BP, LSTM, GRU, BILSTM and TCN. It is tested with three degrees of freedom under different sea states. MAE and RMSE are used as the evaluation indexes of this paper. In the six sets of experimental results, compared with the other nine models, the method in this paper can reduce the MAE by up to 9.2%, 7.2%, 4.7%, 5.4%, 6.4%, and 6.8%, respectively. When using RMSE as the evaluation index, the decrease was at most 10.1%, 8.7%, 5.6%, 7.1%, 7.5%, and 8.2%. The experimental results show that the method in this paper has the highest prediction accuracy.