Nowadays, as computer technology makes quick progress, innovative algorithms like deep learning are getting used more and more in underground engineering and lots of other fields. When working on rectangular pipe jacking tunnel projects, accurately predicting the magnitude of pipeline settlement is really key to keeping the work moving smoothly. But traditional ground settlement prediction methods mainly rely on empirical formulas and numerical simulation software. When applied to tunnels with complex geometries, though, these methods usually don’t work as well as needed. To fix this problem, our study came up with a new model called PSO-LSTM-Self-Attention Mechanism (shortened to PSO-LSTM-SAM), specifically designed to predict pipeline settlement caused by rectangular pipe jacking work. This model takes the data collected from construction monitoring and uses that as the input for time series modeling work. That allows for in-depth analysis of real-time settlement data, and as a result, it can make more precise predictions of long-term pipeline settlement. To verify the effectiveness of the PSO-LSTM-SAM algorithm, the researchers compared its prediction results with those from a conventional LSTM network, an LSTM-SAM network, and a PSO-SVR network. They also checked the model’s performance by looking at pipeline settlement predictions from different monitoring points, using data from the Changsha Railway Transit Line 6 project. The results show that the PSO-LSTM model, with the self-attention mechanism added in, greatly boosts how accurate tunnel settlement predictions are, and the model fits the data better, too. This proves that the PSO-LSTM-SAM model works well: by using the strengths of deep learning, it offers a new way to predict pipeline settlement when building rectangular pipe jacking tunnels.