Desalination plays a role in tackling the global water scarcity issue. Enhancing the efficiency of desalination plants in terms of water recovery (WR) and salt rejection (SR) is crucial for cost-effectiveness and improvements. This study introduces AttnDesal, a neural network model crafted to forecast key performance indicators of desalination facilities. We can use Gated Recurrent Units (GRU) and Long Short-Term Memory (LSTM) networks along with a way to pay attention to make the AttnDesal system find relationships between time series data, whether in the short and long term. The model underwent training and testing using a dataset, incorporating parameters such as feed temperature (Tf), feed flow rate (Qf), concentrate pressure (Cp), and energy consumption (kWh). The evaluation results reveal that AttnDesal exhibits performance, achieving a mean squared error (MSE) of 0.0024, a mean absolute error (MAE) of 0.0032 for WR, and an R squared value of 0.9818. Regarding SR prediction, the model obtained an MSE of 0.0019, an MAE of 0.0390, and an R squared value of 0.9795. These findings underscore the model’s precision and dependability in forecasting desalination plant efficiency. Comparisons between the actual. Predicted values prove that the model effectively captures the intricate relationships in the data. We suggest evaluating AttnDesal’s performance using datasets from water treatment and desalination facilities around the world to ensure its wide application and reliability. This article also covers the preprocessing steps, such as data cleaning, normalization, and reshaping, to prepare the data for training the model. By incorporating an attention mechanism, AttnDesal can focus on the parts of the input sequence, thereby improving prediction accuracy. The accurate forecasting of performance indicators by AttnDesal positions it as a tool for optimizing desalination plant operations, ultimately enhancing efficiency and cost-effectiveness. The model’s success highlights the potential of networks with attention mechanisms to advance desalination technology and tackle global water challenges.