As a typical encoder–decoder, the transformer architecture has inherent limitations such as secondary time complexity, high memory usage, and a complex model structure; these issues can lead to lower prediction accuracy and decreased computational efficiency when applied to the prediction of the remaining useful life (RUL) of rolling bearings. For this reason, herein, a novel encoder–decoder, the Policy Gradient Informer (PG–Informer) model, is proposed and applied to the prediction of the RUL of rolling bearings for the first time. First, in the new encoder–decoder architecture of PG–Informer, a probabilistic sparse self-attention m echanism is used to replace the original self-attention mechanism of the transformer architecture to improve its nonlinear approximation ability and reduce its time and space complexity. Then, the self-attention distillation operation is used to reduce its number of parameters and their dimensions and enhance the prediction robustness of time series. Moreover, the generative decoder of PG–Informer only needs to decode the decoding input in one step to output the prediction results without dynamic multistep decoding, which improves the prediction speed of time series. Finally, a policy-gradient learning algorithm is constructed to improve the training speed of the PG–Informer parameters. These advantages enable the proposed rolling-bearing RUL-prediction method to obtain higher prediction accuracy, better robustness, and higher computational efficiency. Results for the No. 1 rolling bearing at the Center for Intelligent Maintenance Systems of the University of Cincinnati show that the proposed method was able to predict an RUL value of 963 min, representing a prediction error of only 6.50% when compared to the experimental result; compared to the transformer-based RUL prediction method, this represents a higher prediction accuracy, a smaller prediction error, and greater robustness. The proposed method consumed only 132.37 s for RUL prediction, shorter than the time taken by the transformer-based RUL-prediction method. These results verify the effectiveness and advantages of the proposed method. © 2024 Sichuan University. All rights reserved.